Cloud Infrastructure
Cloud Infrastructure
Date: 06-04-2022
1 External
Contents of Lecture
What is a Data Center?
Servers
Softwares
Networking devices
Storage solutions
Managing the infrastructure
Copyright © 2021 Tata Consultancy Services Limited
4 External
Cloud Data Center :
On-Premises Data Center
▪ An on-prem data center simply means that the organization maintains all of the IT infrastructure needed
by the business on-site.
▪ An on-prem data center includes everything from the servers that support web and email to the
networking hardware connecting them to support infrastructure equipment like uninterruptible power
supplies (UPS).
Cloud Data Center?
▪ A cloud data center moves a traditional on-prem data center off-site. Instead of personally managing
their own infrastructure, an organization leases infrastructure managed by a third-party partner and
accesses data center resources over the Internet.
▪ Under this model, the cloud service provider is responsible for maintenance, updates, and meeting
service level agreements (SLAs) for the parts of the infrastructure stack under their direct control.
5 External
Cloud Data Center: Hybrid Cloud:Shared Responsibility Model
▪ The migration from an on-premises data center to a cloud data center doesn’t mean moving everything
to the cloud. Many companies have hybrid cloud data centers which have a mix of on-premises data
center components and virtual data centers components. In the figure below we see how as-a-service
models are shifting ownership of data center and infrastructure components from a fully owned and
operated on-premises facility towards a commodity service model. Depending on the model selected, an
organization may be responsible for maintaining and securing more or less of their infrastructure stack.
The breakdown of responsibilities is outlined by the cloud services provider in shared responsibilities
models
6 External
On-Premises Data Centers vs Cloud Data Centers
▪ Nearly all organizations now have at least some of their infrastructure hosted in the cloud. The reason for this is
that cloud data centers offer a number of advantages over maintaining an on-prem data center. Some of the
pros and cons of cloud-based vs. on-premises data centers include:
▪ Scalability: In an on-premises data center, resource scalability is limited by the infrastructure that the company
has purchased and deployed. In the cloud, additional resources can be quickly and easily spun up as needed.
▪ Flexibility: In an on-premises data center, resource flexibility is limited by the need to acquire, provision, or
update appliances. In the cloud, a customer can spin up or take down resources quickly to meet business needs.
▪ Cost: Maintaining an on-prem data center is more expensive than a cloud-based one. On-prem, an organization
pays full price for all of their infrastructure. In the cloud, resources can be shared, and cloud service providers
can take advantage of economies of scale.
▪ Availability: In an on-premises data center, an organization has complete control over their infrastructure, which
can be good or bad. In the cloud, availability is protected by service level agreements, which may provide better
guarantees than an organization can in-house.
▪ Security: In the cloud, the cloud service provider is responsible for securing part of an organization’s
infrastructure stack and is likely more practiced at doing so. However, some customers may want
additional security of their cloud-based data centers that are not natively provided by the cloud service
provider.
▪ Accessibility: In an on-prem data center, the organization has complete control over the systems that it deploys
and uses. In the cloud, the organization is limited to what is offered by the service provider.
7 External
Cloud Servers vs Dedicated Servers
▪ Cloud servers can be configured to provide levels of performance, security and control similar to those of
a dedicated server. But instead of being hosted on physical hardware, they reside in a shared
“virtualized” environment that’s managed by your cloud hosting provider.
▪ You benefit from the economies of scale of sharing hardware with other customers. And, you only pay
for the exact amount of server space used. Cloud servers also allow you to scale resources up or down,
depending on demand, so that you're not paying for idle infrastructure costs when demand is low.
▪ With cloud servers, you can optimize IT performance without the huge costs associated with purchasing
and managing fully dedicated infrastructure. Businesses with variable demands and workloads often find
that cloud servers are an ideal fit.
▪ A dedicated server is a physical server that is purchased or rented entirely for your own business needs.
Dedicated servers are typically used by large businesses and organizations that require exceptionally high
levels of data security, or organizations that have steady, high demands for server capacity.
▪ With dedicated servers, businesses still need the IT capacity and expertise to manage ongoing
maintenance, patches and upgrades. Businesses using I/O-heavy applications, such as databases and big
data platforms, find significant value in bare metal dedicated hardware.
8 External
open source software for cloud computing
▪ The question used to be, “What container orchestration platform are you using?” Now the question is,
“So, how are you running Kubernetes?” The past year has seen Kubernetes continue its domination, with
managed “K8s” clusters being offered by all three major cloud providers, and lots of innovation
happening in the surrounding ecosystem. Our 2018 Bossie winners in cloud computing are ushering in
the new era of cloud-native applications.
9 External
Kubernetes
▪ There was a time when other options were considered for container orchestration. But when it comes to
running distributed containerized applications today, Kubernetes has consolidated its dominance. If
you’re going to deploy a new scalable service across AWS, Azure, GCP, or your private cloud, Kubernetes
is likely going to enter the conversation.
▪ Building any container infrastructure means supporting a whole ecosystem of hardware, software, and
network devices. With the Kubernetes 1.11 release, Kubernetes now supports IPVS in-cluster load
balancing and CoreDNS (a pluggable DNS server). This follows major security, storage, and networking
enhancements earlier in the year.
▪ Istio
10 External
Docker
▪ Docker allows you to package your software in “containers” and run them as an OS-level virtual machine.
As opposed to VMware and other popular virtualization technologies, Docker doesn’t waste CPU or
other resources virtualizing a whole computer, or require an additional OS for each “guest.” In just five
short years Docker has totally changed the way virtualization works in computing.
▪ With the ascension of Kubernetes, Docker is no longer the way most people are looking to distribute
containers. However, Docker is certainly still a viable alternative for managing container clusters, and it
continues to be the way most people create and run individual containers.
11 External
Cloud Storage
▪ when we select a cloud storage service, we should consider some essential features such as service
security, privacy, mobile app, pricing, complexity, and speed.
▪ Some of the most popular cloud storage providers are Apple (iCloud), Amazon (Amazon Web Services ),
Dropbox, and Google
▪ How does cloud storage work?
▪ Cloud storage works on a client-server model, in which a client sends the request to the subscribed cloud
service storage and the server at the data center gives the appropriate response.
▪ The main objective of the cloud, instead of saving data at local storage, the data of the user can be
collected at some data center so the user could retrieve his or her data from any device.
▪ What if the data center of the cloud service provider collapses or gets destroyed, would the user data
also be destroyed? The answer is no.
▪ The cloud storage depends on hundreds of data centers, so even if one of the data centers collapses,
there are hundreds of centers that would help you to retrieve and save your data.
12 External
13
Highly connected:
fiber optic cables
10’s to
100’000s
servers
14 External
15
15 External
16
Top of Rack
Links higher in topology
(TOR) are oversubscribed1
Switch - cannot handle all servers
sending at maximum rate
Rack with - design tradeoff to scale
Rack with Servers Rack with
Servers Servers
1Oversubscription ratio: capacity of links below a switch relative to capacity of links above
18 External
19
Partially, because …
- requires enterprise-level switches
19 External
20
Can we do better?
20 External
21
- provides redundancy
21 External
22
23 External
24
Cloud Computing
24 External 17
25
25 External
26
Cloud
26 External
27
Data Center
Cloud
The various types of Clouds all have a
Cloud Computing Stack backed by a
data center
28 External
29
Public Cloud
- anyone can request and use the cloud
Hybrid Cloud
- a composition of public and private cloud resources
- bounded by standardized or proprietary technology
32 External
Server Virtualization
(i) Sharing of physical infrastructure: Virtual machines allow multiplexing of hardware with tens to
100s of VMs residing on the same physical server. Also, it allows rapid deployment of new services.
(ii) Spinning up a virtual machine in seconds: Spinning up a virtual machine might only need seconds
compared to deploying an app on physical hardware, which can take much longer.
(ii) Live VM migration: Further, if a workload requires migration. For example, you do physical server
requiring maintenance. This can be done quickly with virtual machines, which can be migrated
to other servers without requiring interruption of service in many instances. Due to these
advantages today, more endpoints on the network are virtual rather than physical.
vNIC
vNIC
vNIC
The hypervisor provides an emulated view of the
hardware to the VMs, which the VMs treat as their
substrate to run a guest OS on.
Among other hardware resources the network Physical Hypervisor
interface card is also virtualized in this manner. The NIC
hypervisor managing the physical NIC, is exposing pNIC
virtual network interfaces to the VMs. The physical
NIC also connects the server to the rest of the Physical
network. switch
pSwitch
vNIC
vNIC
vNIC
vSw is connected to all the virtual switch
NICs, has them as the physical NIC,
and moved packets between the
VMs and the external network. Hypervisor
vSw
pNIC
Alternate Methods of virtualization:
(i) Using Docker
(ii) Using Linux containers pSwitch
Docker
▪ The Docker Engine container comprises
just the application and its dependencies.
Virtual Machine
37 External Server Virtualization
(i) Using VMs as Virtualization
Application
vNIC
vNIC
vNIC
This means that even running a small
application requires the overhead of
Hypervisor
running an entire guest OS.
pNIC
pSwitch
● It operates at the container (not hardware) level to automate the deployment, scaling
and management of applications.
● K8s works alongside a containerisation tool, like Docker. So if containers are the
‘ingredients’ of an application, then K8S would be the ‘chef’.
42 External
How Does Kubernetes Work?
44 External
Kubernetes Master Node
Master Node is a collection of components like Storage, Controller, Scheduler, API-server that makes up the
control plan of the Kubernetes. When you interact with Kubernetes by using CLI you are communicating with
the Kubernetes cluster’s master node. All the processes run on a single node in the cluster, and this node is
also referred to as the master.
2) etcd is a distributed key-value store that is used to store the cluster state. Kubernetes stores the file in a
database called the etcd. Besides storing the cluster state, etcd is also used to store the configuration details
such as the subnets and the config maps.
3) Kube-scheduler is used to schedule the work to different worker nodes. It also manages the new requests
coming from the API Server and assigns them to healthy nodes.
4) Kube Controller Manager task is to obtain the desired state from the API Server. If the desired state does
not meet the current state of the object, then the corrective steps are taken by the control loop to bring the
current state the same as the desired state. 45 External
Kubernetes Worker Node
The worker nodes in a cluster are the machines or physical servers that run your applications. The Kubernetes
master controls each node. there are multiple nodes connected to the master node. On the node, there are
multiple pods running and there are multiple containers running in pods.
2) Kube-proxy is used to communicate between the multiple worker nodes. It maintains network rules on nodes
and also make sure there are necessary rules define on the worker node so the container can communicate to
each in different nodes.
3) Kubernetes pod is a group of one or more containers that are deployed together on the same host. Pod is
deployed with a shared storage/network, and a specification for how to run the containers. Containers can easily
communicate with other containers in the same pod as though they were on the same machine.
4) Container Runtime is the software that is responsible for running containers. Kubernetes supports several
container runtimes: Docker, containers.
46 External
Benefits of Kubernetes
Self-healing
○ Clusters can auto-restore from errors by rolling back to the last working version of
software. This allows teams to ship quickly without the risk of breaking anything.
● High Availability
○ Clusters can be recreated on a working node to avoid downtime during server
failure.
● Simplifys Maintenance
○ If a server needs to be rebooted, or the host OS needs updating, containers can
be moved to another node whilst maintenance is carried out.
● Automatic Scaling
○ Uses information from user requests and CPU usage to increase or decrease the
number of nodes running to match demand.
● Efficient
○ Automatically spins up any new containers on under-utilized nodes.
47 External
Things Kubernetes does not do...
There are sometimes misconceptions about what Kubernetes can do. Kubernetes does
not…
● Provide any comprehensive machine configuration.
● Provide a configuration language/system
● Dictate logging, monitoring or alerting solution
● Build your application
● Provide middleware, data-processing frameworks, databases, caches etc. BUT these
components can run on Kubernetes
48 External
Networking with Docker
Each container is assigned a virtual interface.
Docker contains a virtual ethernet bridge Container
connecting these multiple virtual interfaces and Application
the physical NIC. …
pNIC
External network connectivity is provided
through a NAT, that is a network address
translator. pSwitch
vNIC
vNIC
vNIC
CPU does
the work! Hypervisor
vSw
pNIC
pSwitch
Need time for Packet I/O: Moving packets from the NIC buffers to the OS
buffers, which requires CPU interrupts. Until recently a single X86 core
couldn't even saturate a ten gigabits per second link. And this is without any
switching required. This was just moving packets from the NIC to the OS.
After significant engineering effort, packet I/O is now doable at those line
rates. However for a software switch we need more.
vNIC
vNIC
vNIC
entirely in the kernel, because of
development difficulties. It's hard
to push changes to kernel level user space
Hypervisor
code, and it's desirable to keep vSw
logic that resides in the kernel as kernel
pNIC
simple as possible.
pSwitch
vNIC
vNIC
vNIC
from other, possibly virtual, “smarts”
such as in the network.
user space
This behavior can also be Hypervisor
programmed using open flow. vSw
So, this part is optimized for kernel
processing network updates, pNIC
and not necessarily for wire
speed packet forwarding.
pSwitch
vNIC
vNIC
vNIC
to optimize the common “smarts”
case, as opposed to the user space
worst case line rate Hypervisor
vSw
requirements and caching kernel
will be the answer to that pNIC
need. Simple, fast
forwarding
pSwitch
– Provides both Command Line Interface (CLI) and Application Programming Interface (API)
– Abstraction
o Host: emulated as an OS level process
o Switch: emulated by using software-based switch
• E.g., Open vSwitch, SoftSwitch
▪ mininet.org
▪ github.com/mininet
▪ github.com/mininet/mininet/wiki/Documentation
▪ reproducingnetworkresearch.wordpress.com
▪ Ben Pfaff, Justin Pettit, Teemu Koponen, Ethan J. Jackson, Andy Zhou, Jarno
Rajahalme, Jesse Gross, Alex Wang, Jonathan Stringer, Pravin Shelar, Keith Amidon,
and Martín Casado, “The design and implementation of open vSwitch”
In Proceedings of the 12th USENIX Conference on Networked Systems Design and
Implementation (NSDI'15). USENIX Association, Berkeley, CA, USA, 2015, pp. 117-
130.
▪ In this lecture, we have discussed server virtualization and also discuss the
need of routing and switching for physical and virtual machines.
▪ To address the problem of networking VMs, two approaches are discussed: (i)
One, using specialized hardware: SR-IOV, single-root I/O virtualization and (ii)
Other using an all software approach: Open vSwitch
▪ Centralized control
(i) Agility
(ii) Location independent addressing
(iii) Performance uniformity
(iv) Security
(v) Network semantics
Routers
Aggregation
switches
Top of Racks
switches
Racks
• Tenant in “silos” –
Means one rack or
a part of the
cluster is devoted
to a particular
service
• Poor Utilization
• Inability to
expand
• IP addresses locked to
topological location!
▪ Agility
– Location independent addressing: Racks are generally assigned
different IP Subnets, because subnets are used as topological
locators so that we can route. To move some service over there,
we're going to have to change its IP address and it is hard to
change the IP addresses of live running services.
– Micro-segmentation : separation of
different regions of a network.
– Much finer grained division and control,
of how data can flow.
– Isolate or control just the data flow
between pairs of applications, or tenants
that should be actually allowed.
▪ Network semantics:
Key Needs:
(i) Agility
(ii) Location independent addressing
(iii) Performance uniformity
(iv) Security
(v) Network Semantics
▪ Analyzed 300K alarm tickets, 36 million error events from the cluster
▪ 0.4% of failures were resolved in over one day
▪ 0.3% of failures eliminated all redundancy in a device group (e.g. both uplinks)
Traditional VL2
An example Clos network between Aggregation and
Intermediate switches provides a richly-connected backbone
well suited for VLB. .e network is built with two separate address
families—topologically significant Locator Addresses (LAs) and
Figures from Greenberg et al. at Application Addresses (AAs).
Unpredictable traffic
▪ Means it is difficult to adapt. So this leads us to a design that is
what's called oblivious routing. It means that the path along
which we send a particular flow does not depend on the
current traffic matrix.
L2 network semantics
▪ Agent intercepts and handles L2 broadcast, multicast
▪ Both of the above require “layer 2.5” shim agent running on host; but, concept
transfers to hypervisor-based virtual switch
Security:
▪ Directory system can allow/deny connections by choosing
whether to resolve an AA to a LA
▪ But, segmentation not explicitly enforced at hosts
▪ The network virtualization platform that was introduced in the paper “Network
virtualization in Multi-tenant Datacenters” by Teemu Koponen et al. in NSDI 2014.
▪ And this comes out of a product developed by the Nicira startup that was acquired by
VMware.
Network hypervisor
Access control
Link Table
▪ But distributed.
▪ Yes, kind of
▪ Relational Database Management Systems (RDBMSs) have been around for
ages
▪ MySQL is the most popular among them
▪ Data stored in tables
▪ Schema-based, i.e., structured tables
▪ Each row (data item) in a table has a primary key that is unique within that
table
▪ Queried using SQL (Structured Query Language)
▪ Supports joins
users table
user_id name zipcode blog_url blog_id Example SQL queries
110 Smith 98765 smith.com 11 1. SELECT zipcode
331 Antony 54321 antony.in 12 FROM users
WHERE name = “John”
767 John 75676 john.net 13
2. SELECT url
Foreign keys FROM blog
Primary WHERE id = 11
keys
blog table
Id url last_updated num_posts 3. SELECT users.zipcode,
11 smith.com 9/7/17 991 blog.num_posts
13 john.net 4/2/18 57 FROM users JOIN blog
ON users.blog_url =
12 antony.in 15/6/16 1090
blog.url
▪ Data: Large and unstructured: Difficult to come out with schemas where the
data can fit
▪ Joins infrequent
▪ Speed
▪ Avoid Single point of Failure (SPoF)
▪ Low TCO (Total cost of operation and Total cost of
ownership)
▪ Fewer system administrators
▪ Incremental Scalability
▪ Scale out, not scale up
▪ Tables
– “Column families” in Cassandra, “Table” in HBase, “Collection” in MongoDB
– Like RDBMS tables, but …
– May be unstructured: May not have schemas
o Some columns may be missing from some rows
– Don’t always support joins or have foreign keys
– Can have index tables, just like RDBMSs
N80 N45
Client Coordinator
Backup replicas for
key K13
Cassandra uses a Ring-based DHT but without
finger tables or routing
Key→server mapping is the “Partitioner”
135 External Design of Apache Cassandra
Data Placement Strategies
▪ Replication Strategy:
1. SimpleStrategy
2. NetworkTopologyStrategy
1. SimpleStrategy: uses the Partitioner, of which there are two kinds
1. RandomPartitioner: Chord-like hash partitioning
2. ByteOrderedPartitioner: Assigns ranges of keys to servers.
o Easier for range queries (e.g., Get me all twitter users starting
with [a-b])
2. NetworkTopologyStrategy: for multi-DC deployments
– Two replicas per DC
– Three replicas per DC
– Per DC
o First replica placed according to Partitioner
o Then go clockwise around ring until you hit a different rack
136 External Design of Apache Cassandra
Snitches
Data updates accumulate over time and SStables and logs need to be
compacted
▪ So every server needs to maintain a list of all the other servers that are
currently in the server
4 4 10111 65
Protocol:
3
•Nodes periodically gossip their Current time : 70 at node 2
membership list
•On receipt, the local membership (asynchronous clocks)
list is updated, as shown
•If any heartbeat older than Tfail, (Remember this?)
node is marked as failed
146 External Design of Apache Cassandra
Suspicion Mechanisms in Cassandra
▪ MySQL is one of the most popular (and has been for a while)
▪ On > 50 GB data
▪ MySQL
– Writes 300 ms avg
– Reads 350 ms avg
▪ Cassandra
– Writes 0.12 ms avg
– Reads 15 ms avg
▪ Orders of magnitude faster
▪ What’s the catch? What did we lose?
1. Consistency: all nodes see same data at any time, or reads return latest
written value by any client
2. Availability: the system allows operations all the time, and operations
return quickly
3. Partition-tolerance: the system continues to work in spite of network
partitions
• Consistency = all nodes see same data at any time, or reads return latest
written value by any client.
▪ When you access your bank or investment account via multiple clients (laptop,
workstation, phone, tablet), you want the updates done from one client to be
visible to other clients.
▪ When thousands of customers are looking to book a flight, all updates from any
client (e.g., book a flight) should be accessible by other clients.
– Partitions can also occur within a datacenter, e.g., a rack switch outage
▪ Cassandra
– Eventual (weak) consistency, Availability, Partition-tolerance
▪ Traditional RDBMSs
– Strong consistency over availability under a partition
▪ If all writes stop (to a key), then all its values (replicas) will converge eventually.
▪ If writes continue, then system always tries to keep converging.
o Moving “wave” of updated values lagging behind the latest values sent by clients,
but always trying to catch up.
▪ May still return stale values to clients (e.g., if many back-to-back writes).
▪ But works well when there a few periods of low writes – system converges
quickly.
Red-Blue
Causal Probabilistic
Red-Blue
Causal Probabilistic
Red-Blue
Causal Probabilistic
Red-Blue
Causal Probabilistic
▪ Use the lowest consistency (to the left) consistency model that is “correct” for
your application
Red-Blue
Causal Probabilistic
▪ Traditional Databases (RDBMSs) work with strong consistency, and offer ACID
▪ Modern workloads don’t need such strong guarantees, but do need fast response
times (availability)
▪ Unfortunately, CAP theorem
▪ Key-value/NoSQL systems offer BASE [Basically Available Soft-
state Eventual Consistency]
– Eventual consistency, and a variety of other consistency models striving
towards strong consistency
▪ We have also discussed the design of Cassandra and different consistency
solutions.