Red Hat Virtualization, Part 2: Understanding Hardware Virtualization Internals

Red Hat Virtualization, Part 2: Understanding Hardware Virtualization Internals

Abstract

Too many datacenters are overrun with duplicated hardware that is idling most of the time. The idea behind virtualization of memory is to provide just enough resources as needed by each application. Shared code for applications reduced the memory footprint by removing duplicate similar functions and subroutines. A new layer of software, the hypervisor, saves memory and better shares the hardware among many entire machines. This white paper, the second in a 3-part series on Red Hat Virtualization, shows how virtualization of hardware allows for better utilization factors when the newer hardware designs, with the latest processor updates and multiple cores, are factored into the mix.

Sample

Overview

The idea of better utilization of resources is a major selling point in virtualization hardware. The true nature of the beast is a drive to sell the latest hardware advances, namely multiple Central Processing Units (CPUs) on a single computer motherboard, and be able to do many more things in a smaller spaced footprint.

The biggest obstacle to any new technology advances is finding a useful outlet for all the new power. This is where Virtualized Hardware pops up over the horizon as the next selling tool.

Multiple CPUs on One Motherboard

It seems that the speeds of the CPU have not increased much lately, staying in the 2-4 GigaHertz range. Instead, the makers of these chips have added duplication of the processor portion on the same chip. Two processors on the same chip is referred to as a Dual-Core chip, four

4 GB Virtual Memory Space

Technically, on a 32-bit processor-based computer, an application has the ability to address 2 to the power of 32 different memory locations. This equates to 4 GB (1024x1024x1024x4 bytes, which is more than 4.0 billion). Every other computer processor chip has moved on to 64 bits instead of 32 bits except for the processors used in laptops and computers of the last decade. More and more computers built since 2005 use 64-bit chips that were and still are dumbed down to 32 bits because of the operating system (OSs) installed. This is also changing as modern OS versions are now 64 bit.

A memory location holds one BYTE, one character on a display, one number value, one special character, one "thing." Each character in this line of text, including spaces and commas, require one byte of memory.

If the host has 2 GB of memory on a 32-bit machine, how does each application get a 4 GB virtual address space to play in? The reality is that it gets as much memory as it actually needs for its program code, data, and program stack. The rest of the addresses do not require real memory. If the program ever wants to load more information, then the OS grants access to more physical memory.

CPU Scheduling For Multiple Applications

When there is more than one application doing something important, the CPU must split its time between these applications, and the normal system functions like keeping the clock ticking along. This splitting of the CPU time is done by scheduling blocks of CPU time in rapid succession to each process that needs some CPU time, including the process managing this scheduling.

Standardized Guest Environment

Operating systems are peculiar animals of software, they require specific interfacing software, known as a driver, during installation in order for the OS to function on reboot. You cannot usually install the Macintosh OS on a regular personal computer that originally was designed for a Microsoft OS. The MAC OS would not look for the hardware in some cases and would not have the required driver. The MAC OS would not install onto the average desktop or laptop computer. The MAC OS only installs on the specially designed MAC type of computers that use the same Intel processing units, have video cards, have a different type of mouse, have a keyboard, and have a disk drive-but they are just not "normal." The MAC OS installation would not discover the right environment and would just not install.

Most desktop and laptop computers made by every other vendor are geared to the Microsoft and Linux OSs. These OSs would be able to discover and configure software drivers for all the local hardware usually, or the vendor would supply drivers on a CDROM. Buyers assume each desktop and laptop would only have the exact same hardware if they were from the same vendor and were the same model (usually, but not always true).

Creating the environment of a standard computer, within a different computer, is what the hypervisor does for each guest OS. This is one of the key features of virtualization of hardware, the hardware that is presented to the guest OS is considered common and guaranteed to have no trouble during installation in finding and configuring the proper drivers as the OS is installed.

Duplicate Memory Recovery

Another feature of the hypervisor is reduction of duplicate memory addresses. If the same application is being run in multiple locations on a guest PC, the OS tries to reduce the duplication. The hypervisor goes one more step and compares the code pages between all similar running VMs and further reduces the memory requirements.

Related Courses

EX318 Red Hat Enterprise Virtualization Administrator Exam
RH318 Red Hat Enterprise Virtualization
RH033 Red Hat® Linux Essentials
RH133 Red Hat® Linux System Administration & Red Hat® Certified Technician (RHCT®) Lab Exam
RH253 Red Hat® Linux Networking and Security Administration
RH300 Red Hat® Linux (RHCE®) Rapid Track Certification Course & RHCE Lab Exam

Related White Papers

Red Hat Virtualization, Part 1: Understanding How We Got to Hardware Virtualization
Red Hat Virtualization, Part 3: Understanding CPU Evolution and Virtualization

Download Now

Date: 3/9/2010

Author: David Egan

Format: PDF

Pages: 19