You are on page 1of 6

Definition:

CPU Virtualization emphasizes running programs and instructions through a virtual machine, giving the
feeling of working on a physical workstation. All the operations are handled by an emulator that controls
software to run according to it. Nevertheless, CPU Virtualization does not act as an emulator. The
emulator performs the same way as a normal computer machine does. It replicates the same copy or data
and generates the same output just like a physical machine does. The emulation function offers great
portability and facilitates working on a single platform, acting like working on multiple platforms. With
CPU Virtualization, all the virtual machines act as physical machines and distribute their hosting
resources like having various virtual processors. Sharing of physical resources takes place to each virtual
machine when all hosting services get the request. Finally, the virtual machines get a share of the single
CPU allocated to them, being a single-processor acting as a dual-processor.

Types of CPU Virtualization

The various types of CPU virtualization available are as follows

1. Software-Based CPU Virtualization

This CPU Virtualization is software-based where with the help of it, application code gets executed on the
processor and the privileged code gets translated first, and that translated code gets executed directly on
the processor. This translation is purely known as Binary Translation (BT). The code that gets translated
is very large in size and also slow at the same time on execution. The guest programs that are based on
privileged coding runs very smooth and fast. The code programs or the applications that are based on
privileged code components that are significant such as system calls, run at a slower rate in the virtual
environment.

2. Hardware-Assisted CPU Virtualization


There is hardware that gets assistance to support CPU Virtualization from certain processors. Here, the
guest user uses a different version of code and mode of execution known as a guest mode. The guest code
mainly runs on guest mode. The best part in hardware-assisted CPU Virtualization is that there is no
requirement for translation while using it for hardware assistance. For this, the system calls runs faster
than expected. Workloads that require the updation of page tables get a chance of exiting from guest
mode to root mode that eventually slows down the program’s performance and efficiency.

3. Virtualization and Processor-Specific Behavior

Despite having specific software behavior of the CPU model, the virtual machine still helps in detecting
the processor model on which the system runs. The processor model is different based on the CPU and
the wide variety of features it offers, whereas the applications that produce the output generally utilize
such features. In such cases, vMotion cannot be used to migrate the virtual machines that are running on
feature-rich processors. Enhanced vMotion Compatibility easily handles this feature.

4. Performance Implications of CPU Virtualization

CPU Virtualization adds the amount of overhead based on the workloads and virtualization used. Any
application depends mainly on the CPU power waiting for the instructions to get executed first. Such
applications require the use of CPU Virtualization that gets the command or executions that are needed to
be executed first. This overhead takes the overall processing time and results in an overall degradation in
performance and CPU virtualisation execution.

CPU virtualization is very important in cloud computing. It enables cloud providers to offer services like

 Virtual private servers (VPSs)


 Cloud storage (EBS)
 Cloud computing platforms (AWS, Azure and Google Cloud)
How CPU Virtualization Works? In Step By Step Process
Step 1: Creating Virtual Machines (VMs)

 Let’s take an example you have a powerful computer with a CPU, memory, and other resources.
 To start CPU virtualization, you use special software called a hypervisor. This is like the
conductor of a virtual orchestra.
 The hypervisor creates virtual machines (VMs) – these are like separate, isolated worlds within
your computer.
 The “virtual” resources of each VM include CPU, memory, and storage. It’s like having multiple
mini-computers inside your main computer.
Step 2: Allocating Resources

 The hypervisor carefully divides the real CPU’s processing power among the VMs. It’s like
giving each VM its own slice of the CPU pie.
 It also makes sure that each Virtual memory (VM) gets its share of memory, storage, and other
resources.
Step 3: Isolation and Independence

Each VM operates in its own isolated environment. It can’t see or interfere with what’s happening in
other VMs.

Step 4: Running Operating Systems and Apps

 Within each Virtual Machine, you can install & run different operating systems (like Windows,
Linux) and applications.
 The VM thinks it’s a real computer, even though it’s sharing the actual computer’s resources with
other VMs.
Step 5: Managing Workloads

 The hypervisor acts as a smart manager, deciding when each VM gets to use the real CPU.
 It ensures that no VM takes up all the CPU time, making sure everyone gets their turn to work.
Step 6: Efficient Use of Resources

 Even though there’s only one physical CPU, each VM believes it has its own dedicated CPU.
 The hypervisor cleverly switches between VMs so that all the tasks appear to be happening
simultaneously.
Advantages Of CPU Virtualization In Cloud Computing
1) Efficient Resource Utilization
2) Cost Savings
3) Scalability
4) Isolation and Security
5) Compatibility and Testing

Disadvantages Of CPU Virtualization In Cloud Computing:


1) Overhead
2) Performance Variability
3) Complexity
4) Compatibility Challenges
5) Resource Sharing

CPU virtualization emphasizes performance and runs directly on the processor whenever possible. The
underlying physical resources are used whenever possible and the virtualization layer runs instructions
only as needed to make virtual machines operate as if they were running directly on a physical machine.

CPU virtualization is not the same thing as emulation. ESXi does not use emulation to run virtual CPUs.
With emulation, all operations are run in software by an emulator. A software emulator allows programs
to run on a computer system other than the one for which they were originally written. The emulator does
this by emulating, or reproducing, the original computer’s behavior by accepting the same data or inputs
and achieving the same results. Emulation provides portability and runs software designed for one
platform across several platforms.

When CPU resources are overcommitted, the ESXi host time-slices the physical processors across all
virtual machines so each virtual machine runs as if it has its specified number of virtual processors. When
an ESXi host runs multiple virtual machines, it allocates to each virtual machine a share of the physical
resources. With the default resource allocation settings, all virtual machines associated with the same host
receive an equal share of CPU per virtual CPU. This means that a single-processor virtual machines is
assigned only half of the resources of a dual-processor virtual machine.
ss

You might also like