CIS Module-2 Notes
CIS Module-2 Notes
Virtualization:
Virtualization in Cloud Computing:
Virtualization Definition:
Virtualization means creating a virtual (not real) version of computing resources such as a
server, operating system, storage, or network.
In simple words, virtualization allows one physical computer to act like multiple computers.
Instead of giving one physical machine to one user, virtualization shares a single physical
system among many users by creating multiple virtual environments.
(OR)
Virtualization is the process of creating a virtual version of computing resources like hardware,
software, storage, or network.
Virtualization has three main components:
• Host machine – The real physical machine
• Guest machine – virtual machine created on the physical machine. Each guest machine
works like a real computer, has its own OS and applications, is isolated from other
virtual machines.
• Virtualization Layer (Hypervisor) – software that connects the guest to the host and
manages resources
Virtualization allows multiple systems to run on a single physical machine efficiently.
(OR)
Virtualization is a technology that allows multiple virtual machines to run on a single physical
machine by sharing hardware resources efficiently.
Instead of giving one physical machine to one user, virtualization shares a single physical
system among many users by creating multiple virtual environments.
1
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Virtualization Architecture
Virtualization Layer/Hypervisor/Virtual Machine Monitor:
• It is an interface or a monitoring system in virtualization layer to present a virtual
operating platform to a guest operating system.
• There are two types of hypervisors.
• Type- 1 Hypervisor
• Type- 2 Hypervisor
Type- 1 Hypervisor Type- 2 Hypervisor
2
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
OR OR
Examples: Citrix Xen Server, Oracle VM, Examples: VMWare Workstation, Oracle Virtual
VMWare ESX/ESXi, Hyper-V. Box.
3
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Virtual machines can be backed up, migrated, or restored easily. If a physical server fails, VMs
can be moved to another server with minimal downtime.
6. On-Demand Resource Provisioning
Virtualization enables cloud services to be provided on-demand. Users can instantly access
servers, storage, and applications without worrying about underlying hardware.
7. Simplified Management
Centralized management of virtual machines makes monitoring, maintenance, and updates
easier for cloud service providers.
4
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Management
Centralized tools help administrators monitor and manage multiple virtual machines from a
single console, making maintenance easier.
Disaster Recovery
Virtual machines can be quickly backed up and restored from remote locations, enabling fast
recovery during failures.
Testing and Development
Virtualization helps create testing and development environments easily without extra
physical hardware.
Energy Efficiency
Virtualization reduces power consumption by running multiple virtual machines on fewer
physical servers.
Increased Uptime
Virtual machines can be moved to another physical system during hardware failure, reducing
downtime.
Cost Savings
It lowers hardware, power, and maintenance costs, resulting in long-term savings.
Cloud Migration
Virtualization makes it easier to move existing systems to the cloud and use cloud services.
5
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
• Complex Management
Needs skilled administrators and monitoring tools.
• Single Point of Failure
If the host fails, all VMs may go down.
• Security Risks at Hypervisor Level
A compromised hypervisor affects all VMs.
• Resource Contention (competition for shared resources)
Poor allocation can degrade VM performance.
• Dependency on Hypervisor
If the hypervisor fails, multiple VMs can be affected.
1. Hardware Virtualization
• Hardware Virtualization occurs when virtual machine software (called Hypervisor or
VMM) is installed directly on the physical hardware.
• Each VM behaves like a separate computer with its own OS.
6
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
• Full Virtualization and Para Virtualization are the two types of Hardware Virtualization
techniques.
Usage:
• Managing multiple virtual machines is easier than managing multiple physical
servers.
• It improves scalability and performance in data centers.
Use Case: Cloud servers, data centers, running multiple OS on one physical server.
1. Operating System Virtualization (Containerization)
Operating System Virtualization happens when the virtual machine software (VMM /
Hypervisor) is installed on top of the Host Operating System, instead of directly on the
hardware.
• Multiple isolated virtual environments (containers) share the same host OS kernel.
• The Host OS sits between the host machine hardware and the virtual machines.
• Multiple isolated virtual environments (containers) share the same host OS kernel.
• Virtual machines run as applications on the host OS.
7
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Purpose:
• Lightweight virtualization for running applications efficiently without full OS overhead.
Technologies:
• Docker: Packages applications and dependencies into containers.
• Kubernetes: Orchestrates and manages containers (deployment, scaling, management).
Use case:
Microservices, application development/testing, cloud-native apps.
2. Server Virtualization
• Server Virtualization occurs when a single physical server is divided into multiple
virtual servers using virtualization software.
• Each virtual server works independently.
• Resources are allocated to virtual servers based on demand.
Usage:
• Load balancing
8
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Usage
• Data backup
• Disaster recovery
• Easy storage management
• Improved data availability
4. Network Virtualization:
• Network virtualization is a method of combining the available resources in a network to
consolidate multiple physical networks, divide a network into segments or create software
networks between VMs.
• IT teams can use network virtualization to create multiple isolated virtual networks that
share the same underlying physical infrastructure.
• Network hypervisor creates an abstraction layer that hosts and supports different virtual
networks.
• The hypervisor is not only responsible for abstraction, but also controls the resources,
bandwidth and capacity for each virtual network.
9
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
5. Application Virtualization:
Application Virtualization is a cloud computing technique in which applications are
separated from the underlying operating system and hardware. Instead of being installed
directly on a user’s device, applications run in isolated virtual environments and are
delivered to users on demand through the cloud.
This approach reduces compatibility issues, enhances security through isolation, and
supports remote access.
Use cases:
Used in enterprises for remote working, software testing, educational labs, and large-scale
application deployment.
10
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
6. Desktop Virtualization
Desktop Virtualization is a technology in which a user’s desktop environment (operating
system, applications, and user data) is hosted on a centralized server or cloud infrastructure
instead of running locally on a physical machine. Users access their desktops remotely through
thin clients, laptops, or mobile devices over a network.
11
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
x86 processors use privilege rings to protect hardware. Ring 0 is for the kernel and Ring 3 is
for applications.
If user want to run multiple operating systems on the same hardware. Each OS thinks it
should run in Ring 0.
Multiple OS → All want Ring 0
Introduce a new software layer called a hypervisor. In virtualization, the hypervisor takes
Ring 0, and the guest operating system is pushed down to a lower ring.
Ring 0 → Hypervisor
Ring 1 → Guest OS
Ring 3 → Applications
• In x86 systems, some CPU instructions work only in Ring 0 (highest privilege).
• x86 processors were designed assuming only one operating system runs in Ring 0.
• Privileged instructions: Instructions related to memory management, CPU
control, Hardware access.
12
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
virtualization, where the guest OS is unaware of the virtualization layer and runs
unmodified, paravirtualization requires changes to the guest OS to improve
performance, security, and efficiency. Example: XenoLinux is a modified Linux OS
that runs on Xen hypervisor.
13
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
2. Strong Isolation: Xen offers strong isolation between virtual machines, which
enhances security and stability.
3. Open Source: Xen is open-source software, making it a cost-effective choice for
organizations looking to implement virtualization without significant licensing costs.
4. Live Migration: Xen supports live migration, allowing virtual machines to be moved
between physical hosts with minimal downtime.
5. Compatibility: Xen supports a wide range of operating systems as both guests and
hosts, making it versatile and suitable for various use cases.
Cons of Xen:
1. Complex Configuration: Xen can be complex to set up and configure, especially for
beginners.
2. Limited Desktop Virtualization Support: While Xen can be used for desktop
virtualization, it is not as well-optimized for this purpose as some other virtualization
platforms.
3. Hardware Support: Hardware support can be a limitation. Xen relies on hardware
virtualization extensions (Intel VT-x or AMD-V) for certain features.
4. Integration and Compatibility: Integrating Xen with certain management tools or
integrating Xen-based VMs with other virtualization platforms may be more
challenging due to the specific paravirtualization features.
14
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
6. Wide Guest OS Support: VMware supports a wide range of guest operating systems,
making it versatile for different types of workloads and applications.
15
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Cons of VMware:
1. Cost: One of the significant drawbacks of VMware is the cost. VMware’s products can
be expensive, especially for smaller organizations. Licensing costs can add up quickly.
2. Resource Intensive: While VMware is known for its performance, it can be resource-
intensive. The hypervisor and management tools may require dedicated hardware and
resources, which can impact the overall infrastructure costs.
3. Vendor Lock-In: There’s a concern that once an organization heavily invests in
VMware’s ecosystem, it may be challenging to migrate to other virtualization platforms
due to vendor lock-in.
Microsoft Hyper-V:
• It is a virtualization technology and hypervisor developed by Microsoft. It allows you to
create and manage virtual machines (VMs) on Windows-based servers.
• It runs directly on physical hardware, supports both Windows and Linux guest operating
systems, and requires CPU-level virtualization support.
• Hyper-V is commonly used in data centers, enterprise environments, and cloud services to
consolidate workloads, enhance resource utilization, and provide scalable and flexible
virtualization solutions.
Hardware at the Bottom: This is the actual physical machine:
• CPU
• Memory
• Storage
• Hyper-V runs directly on the hardware.
• It controls:
• CPU scheduling
• Memory allocation
• Hardware access
• It creates and manages virtual machines (VMs).
Root Partition (Parent OS): A special Windows OS that starts first.
• It has device drivers, VM management services
• It does not run user workloads.
• It manages all virtual machines.
16
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
17
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Introduction to Containerization:
VMs vs Containers:
Virtual machines and Containers are two ways of deploying multiple, isolated services on a
single platform.
Virtual Machine:
It runs on top of an emulating software called the hypervisor which sits between the hardware
and the virtual machine. The hypervisor is the key to enabling virtualization. It manages the
sharing of physical resources into virtual machines. Each virtual machine runs its guest
operating system. They are less agile and have lower portability than containers.
Container:
It sits on the top of a physical server and its host operating system. They share a common
operating system that requires care and feeding for bug fixes and patches. They are more agile
and have higher portability than virtual machines.
18
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
19
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
• Container Engine:
Software that creates and manages containers, acts between the OS and containers,
and handles resource allocation and isolation (e.g., Docker Engine).
20
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Docker Architecture:
• Docker is a containerization platform.
• It helps developers build, test, and deploy applications quickly.
• Docker packages an application into a container.
• A container includes Application code, Libraries, System tools, Runtime.
• It ensures “Build once, run anywhere”.
• Applications run the same on local system, cloud, any OS.
Common Commands:
• docker build: Builds an image from a Dockerfile.
21
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Container Images:
• A container image is a lightweight, stand-alone, executable package containing the
application code, runtime, libraries, environment variables, and configuration files
needed to run the application across various environments.
• A Container Image contains:
• Application code
• Runtime (e.g., Java, Python, [Link])
• System libraries
• Dependencies
• Configuration files
Container Image Architecture:
A container image is built using a layered architecture, where each layer adds specific
functionality.
All layers are read-only and immutable, making images lightweight and reusable.
1. Base OS Layer
• Minimal operating system
• Examples: Alpine Linux, Ubuntu
• Provides basic OS utilities
22
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
2. Runtime Layer
• Provides language runtime
• Examples:
• Java → JDK
• Python → Python Interpreter
• [Link] → Node Runtime
3. Dependency Layer
• Required libraries and frameworks
• Ensures application runs without dependency conflicts
4. Application Layer
• Contains application code
• Business logic and configuration files
Container Registries:
• A container registry allows you to store, share, and manage container images in a
centralized location for easy distribution.
• Some registries are public, such as Docker Hub or Google Container Registry, where
anyone can upload and download images.
• Other registries are for private internal use.
• Private registries typically require authentication to access, so only authorized users can
upload or pull images. Private registries also control access based on user roles or
permissions.
• Registries are highly available and scalable, enabling developers to quickly retrieve the
needed images, even in a production environment with large-scale systems.
23
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Introduction to Kubernetes:
• Kubernetes or K8S is an open-source container management tool.
• Kubernetes helps in:
o Deploying applications
o Scaling them when users increase
o Keeping them running without failure
o Automating operations
24
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Kubernetes Features:
• Service Discovery & Load Balancing – Provides stable network access and distributes
traffic
• Storage Orchestration – Automatically connects containers to required storage
• Automated Rollouts & Rollbacks – Updates apps safely and restores previous version
if needed
• Automatic Bin Packing – Places containers efficiently based on CPU & memory
• Self-Healing – Restarts or replaces failed containers automatically
• Secret & Config Management – Securely manages passwords and app settings
• Batch Execution – Runs and manages background jobs
• Horizontal Scaling – Easily scale applications up or down
• Extensibility – Supports adding custom features and integrations
Kubernetes Architecture:
Kubernetes Cluster Architecture describes,
• What components it has, where they run, and what each one does.
• How Kubernetes is organized internally to run applications reliably.
• Kubernetes cluster consist of nodes, which can be physical or virtual machines.
• There are two primary types of nodes in Kubernetes:
o Worker Nodes and
o Master Node
• Master Nodes: These are responsible for controlling and managing the Kubernetes cluster,
including the scheduling of pods and maintaining the desired state of the system.
• Worker Nodes: These are the machines where the actual work is done. They run the
applications (in the form of containers) inside pods.
25
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Kubernetes Pods:
In the following diagram, you can see cube-like structures they are called containers. Each of
the containers will have one application. The cylinder-like structure is called volume, where
the data of the containers will be stored and the circles are called pods.
26
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
A Pod can contain one or more containers, and all containers inside a Pod share:
• The same IP address
• Storage volumes
• Network resources
• Other required configurations
Pods allow easy movement of containers within a cluster. They are created and managed
by controllers, which handle:
• Rollouts (new versions of Pods)
• Replication (keeping the right number of Pods running)
• Health monitoring (restarting or replacing failed Pods)
Kubernetes Deployment
A Kubernetes Deployment is a high-level resource used to manage and scale applications while
ensuring they remain in the desired state. It provides a declarative way to define how many
Pods should run, which container images they should use, and how updates should be
applied.
A Kubernetes Deployment managed ReplicaSet. Each one represents a different version of the
deployed application. Each ReplicaSet manages a set of identically versioned Pods.
27
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Kubernetes Service:
• A Kubernetes Service provides a stable network endpoint to access a group of Pods.
Since Pods are temporary and their IP addresses change whenever they restart or are
replaced, connecting directly to Pod IPs is unreliable.
• A Service solves this problem by offering a permanent IP address and DNS name that
remain the same even when the underlying Pods change. It also distributes traffic
automatically among available Pods.
• Instead of communicating with individual Pod IPs, applications connect to the
Service, which ensures stable and reliable communication.
28
CSE Department, KLEF, Bachupally Campus Y24 Regulation II Year-Even Sem.
Types of Service:
When we define a service configuration, we can specify the type of the service, the type
attribute can have four different values:
1. ClusterIP
2. Headless Service
3. NodePort
4. Load Balancer
1. ClusterIP Service
• ClusterIP is the most common Service as well as it is the Default type of Service,
meaning when you create a Service and not specify a type it will automatically take
ClusterIP as a type.
2. Headless Service
• Headless Service is a type of Service that allows the client to directly communicate
with the Pods.
• It is a useful tool for building distributed applications.
• Headless Services are used in deploying Stateful Application in Kubernetes.
3. NodePort
• NodePort is a Service that is accessible on a static Port on each Worker Node in the
cluster.
• The NodePort Service makes the external traffic accessible on static or fixed port on
each worker Node which is different from the ClusterIP Service which was only
accessible within the Cluster.
4. Load Balancer
• Load Balancer Service type allows the Service to become accessible externally through
a Cloud Provider's Load Balancer functionality.
• Load Balancer Service is an extension of NodePort Service.
29