3. It's all about Rings
• x86 CPUs provide a range of protection levels also
known as rings in which code can execute. Ring 0 has
the highest level privilege and is where the operating
system kernel normally runs. Code executing in Ring 0
is said to be running in system space, kernel mode or
supervisor mode. All other code such as applications
running on the operating system operate in less
privileged rings, typically Ring 3.
4. Rings in virtualization
Traditional systems
– Operating system runs in privileged mode in
Ring 0 and owns the hardware
– Applications run in Ring 3 with less privileges
Virtualized systems
– VMM runs in privileged mode in Ring 0
– Guest OS inside VMs are fooled into thinking
they are running in Ring 0, privileged
instructions are trapped and emulated by the
VMM
– Newer CPUs (AMD-V/Intel-VT) use a new
privilege level called Ring -1 for the VMM to
reside allowing for better performance as the
VMM no longer needs to fool the Guest OS
that it is running in Ring 0.
5. Hosted Products
• Overhead of a full general-purpose
operating system between the virtual
machines and the physical hardware
results in performance 70-90-% of native
6. Hosted Products
VMware offer Workstation, Server, Fusion, Player
Microsoft has MS Virtual Server 2005, MS Virtual PC
Oracle has Virtual Box with multi platform capability.
– Requires a host operating system
(Windows/Linux/Mac), installs like an application
– Virtual machines can use all the hardware resources
that the host can see
– Maximum hardware compatibility as the operating
system supplies all the hardware device drivers
7. Differences between
Workstation and Server
Workstation
– Optimized for desktop
OS (better graphics
performance, i.e. 3D
acceleration)
– Optimized for use for
one person sitting in
front of the PC running it
– Multiple snapshots and
linked clones
– Record/Replay
functionality
– $$$
Server
– Optimized for I/O and
running server-like
loads
– Designed to run
headless with a
network based admin
interface
– Single snapshot
capability
– Free
8. VMware Player
• Stripped-down version of Workstation
• Intended only for "playing" or running
virtual machines that someone else has
made and provides no means for editing or
creating them
• Great for running virtual appliances
• Free
9. Bare-metal products
• ESX & ESXi install right on the bare metal and
therefore offers higher performance but runs on
a narrower range of hardware.
• Used for server consolidation for Data Centers
• High performance and scalability
• Many advanced features for resource
management, high availability and security
• Centralized administration with vCenter Server
• Supports more VMs per physical CPU then hosted
products do.
• The hypervisor or VMM is referred to as the
VMKernel in ESX & ESXi
10. Hypervisor
What is a hypervisor?
• A hypervisor, also called a virtual machine
manager (VMM), is a program that allows multiple
operating systems to share a single hardware
host. Each operating system appears to have the
host's processor, memory, and other resources all
to itself. However, the hypervisor is actually
controlling the host processor and resources,
allocating what is needed to each operating
system in turn and making sure that the guest
operating systems (called virtual machines) cannot
disrupt each other.
11. Bare-metal product examples
• ESX and ESXi from VMware (also known
as VMware vSphere and VMware
vSphere Hypervisor)
• Microsoft Hyper-V
• Citrix Xen Server
• Oracle VM Server
• Red Hat Enterprise Virtualization for
Server (RHEV), Beta Version
12. ESX & ESXi
• Because there is no overhead from a full
host operating system performance is 83-
98% of native. There is a small bit of
overhead from the virtualization layer of
the VMKernel.
13. Differences between ESX & ESXi
• ESX has a Service Console is based on Red Hat Enterprise
Linux 5 that is heavily modified and stripped down and is
used for management purposes. During the boot process the
Service Console bootstraps the VMKernel using initrd and
then turns over full control of all hardware resources to the
VMkernel. When the VMkernel takes over the hardware
resources of the host, the Service Console is warm booted
and managed as a privileged virtual machine within the
VMkernel.
• ESXi does not have a full Service Console but instead has a
limited management console based on an implementation of
the Posix variant of Unix within a Busybox framework and
has many features that you will find in the full Service
Console.
14. Differences between ESX & ESXi
ESX
• Manage using VI Client, web
client, SSH, RCLI or VIMA
• Supports scriptable installations
using utilities like Kickstart
• Supports boot from SAN
• Patches are similar to OS
patches and may have
dependencies
• Built-in firewall protects the
service console and is more
complex with over a dozen
inbound and outbound connection
types allowed by default.
ESXi
• Manage using VI Client, RCLI or
VIMA
• No support for scriptable
installations
• No support for boot from SAN
Any given patch or update is
all-inclusive of previous patches
and updates
• Built-in firewall is much simpler
because there is no service
console to protect. Only two
connection types are allowed by
default.
• Free ESXi cannot be managed
by vCenter Server
15. Virtual Machines
So what exactly is a virtual machine?
• A virtual machine is defined as a
representation of a physical machine
by software that has its own set of
virtual hardware upon which an
operating system and applications can
be loaded. With virtualization each
virtual machine is provided with
consistent virtual hardware regardless
of the underlying physical hardware
that the host server is running. When
you create a VM a default set of
virtual hardware is given to it. You can
further customize a VM by adding or
removing additional virtual hardware as
needed by editing its configuration.
16. Virtual Machines
Virtual machines provide:
– Hardware independence –
VM sees the same hardware
regardless of the host
hardware
– Isolation – VM’s operating
system is isolated from the
host operating system
– Encapsulation – Entire VM
encapsulated into a single
file
17. Virtual Machine Hardware
So a VM has virtual hardware but what kind of hardware is
presented to it by the host server?
• System Manufacturer: VMware
• BIOS: Phoenix 6.0
• Motherboard: Intel 440BX
• CD-ROM: NEC VMware IDE CDR00
• Processor: This will vary based on the processor in the host
server, AMD hosts will present an AMD processor(s) to a
VM of the actual type in the host server and Intel hosts will
present an Intel processor(s) to a VM of the actual type in
the host server. A VM will only see the amount of
processors that is assigned to it regardless of the amount
the host has. Also all processors presented to VMs are
single-core processors even if the host has multi-core
processors.
18. Virtual Machine Hardware
• Memory: 4 memory slots that can be populated with
memory of the speed and type (not size) of the memory in
the host server. This is not configurable and happens
automatically. For example a VM with 512MB of memory will
typically see one slot configured with a 512MB DIMM and a
VM with 4GB of memory will typically see two slots
configured with 2048MB DIMMs.
• Network Controller (NIC): This will depend on the
operating system that you choose when configuring the VM.
The most commonly used NIC in most 32-bit VMs is based
on the AMD PCnet physical NIC and is used with the
flexible or vlance adapter types. Additional NICs include
ones based on Intel’s e1000 (64-bit VMs and 32-bit Vista
VMs) and also VMware’s own vmxnet (no physical
counterpart, used in ESX 2.x).
19. Virtual Machine Hardware
• IDE Controller: Intel 82371 AB/EB PCI Bus Master IDE
Controller
• Video controller: VMware Standard VGA Graphics Adapter
with 4MB video memory
• SCSI Controller: Can be either an LSI Logic PCI-X
Ultra320 or a Buslogic BA80c30 PCI-SCSI MultiMaster
depending on the operating system chosen when creating a
VM. LSI Logic is the preferred choice and offers slightly
better performance on some workloads. The Buslogic is
typically used by older operating systems; you can manually
select the SCSI controller type if you choose the Custom
wizard type instead of Typical when creating a VM. You will
notice that you cannot add a SCSI controller to a VM,
controllers are automatically added or removed when you
add hard disks and assign them a virtual device node ID.
20. Virtual Machine Hardware
• Note that USB and audio devices (sound cards) are not
supported at all on ESX hosts. The total IDE devices in a
VM can not exceed 4 which is the limit of CD/DVD drives
that you can add to a VM. Also the total number of PCI
devices in a VM can not exceed 6, included in this total are
NICs, SCSI controllers and the Video adapter. Since you
can’t remove the Video adapter from a VM that leaves 5 PCI
devices to be divided up between NICs and SCSI
controllers.
21. Virtual Machine Files
• A virtual machine is comprised of a
number of files that are located in
it's home directory.
• If you take a look at a VMs home
directory on an ESX host using a file
browser application like WinSCP or
the Datastore Browser that is built
into the VI Client you will see a list
of files that are associated with the
VM. Most of the files start with the
actual name of the VM and have
different file extensions based on
the type of file that it is.
22. Virtual Machine Files
• You may not see all of the possible file types until your VM is in a
certain state; for example the .vswp file is only present when the
VM is powered on and the .vmss file is only present when a VM is
suspended. Below is a typical VM directory listing using WinSCP.
Note the VI Client's datastore browser will combine the listing of
each of the 2 files that make up a virtual disk into one file.
23. Virtual Machine Files
.nvram file - This small file contains the Phoenix BIOS that is
used as part of the boot process of the virtual machine.
Similar to a physical server that has a BIOS chip that let’s
you set hardware configuration options; a VM also has a
virtual BIOS that is contained in the NVRAM file. The
BIOS can be accessed by accessing when a VM first starts
up by pressing the F2 key, whatever changes are made to
the hardware configuration of the VM are then saved in
the NVRAM file. This file is in binary format and if deleted
it will be automatically re-created when a VM is powered
on.
24. Virtual Machine Files
.vmx file – This file contains all of the configuration
information and hardware settings of the virtual machine.
Whenever you edit the settings of a virtual machine all of
that information is stored in text format in this file. This
file can contain a wide variety of information about the
VM including things like its specific hardware
configuration (i.e. RAM size, NIC info, hard drive info and
serial/parallel port info) advanced power and resource
settings, VMware tools options and power management
options. While you can edit this file directly to make
changes to a VM’s configuration it is not recommended
that you do so unless you know what you are doing. If you
do make changes directly to this file it’s a very good idea
to make a backup copy of this file first.
25. Virtual Machine Files
• vmdk files – All virtual disks are made up
of two files, a large data file equal to the
size of the virtual disk and a small text
disk descriptor file which describes the
size and geometry of the virtual disk file.
The descriptor file also contains a pointer
to the large data file as well as information
on the virtual disks drive sectors, heads,
cylinders and disk adapter type. In most
cases these files will have the same name
as the data file that it is associated with
(i.e. myvm1.vmdk and myvm1-flat.vmdk). You
can match the descriptor file to the data
file by checking the Extent Description
field in this file to see which –flat, -rdm or
–delta file is linked to it.
26. Virtual Machine Files
• .vswp file - When you power on a VM a memory swap file is
created that can be used in lieu of physical host memory if a
ESX host exhausts all of its physical memory because it is
overcommitted. These files are created equal in size to the
amount of memory assigned to a VM minus any memory
reservations (default is 0) that a VM may have set on it (i.e. a
4GB VM with a 1GB reservation will have a 3GB vswp file
created). These files are always created for virtual machines
but only used if a host exhausts all of its physical memory.
As virtual machine memory that is read/written to disk is not
as fast as physical host RAM your VM’s will have degraded
performance if they do start using this file. These files can
take up quite a large amount of disk space on your VMFS
volumes so ensure that you have adequate space available for
them as a VM will not power on if there is not enough room to
create this file. These files are deleted when a VM is
powered off or suspended.
27. Virtual Machine Files
• .vmss file - This file is used when virtual machines are
suspended and is used to preserve the memory contents of
the VM so it can start up again where it left off. This file
will be approximately the same size as the amount of RAM
that is assigned to a VM (even empty memory contents are
written). When a VM is brought out of a suspend state the
contents of this file are written back into the physical
memory of a host server however the file is not
automatically deleted until a VM is powered off (an OS
reboot won’t work). If a previous suspend file exists when a
VM is suspended again this file is re-used instead of
deleted and re-created. If this file is deleted while the VM
is suspended then the VM will start normally and not from a
suspended state.
28. Virtual Machine Files
• .vmsn file - This file is used with snapshots to store the
state of a virtual machine when a snapshot is taken. A
separate .vmsn file is created for every snapshot that is
created on a VM and is automatically deleted when the
snapshot is deleted. The size of this file will vary based on
whether or not you choose to include the VM’s memory
state with your snapshot. If you do choose to store the
memory state this file will be slightly larger then the
amount of RAM that has been assigned to the VM as the
entire memory contents including empty memory is copied to
this file. If you do not choose to store the memory state of
the snapshot then this file will be fairly small (under 32KB).
This file is similar in nature to the .vmss that is used when
VM’s are suspended.
29. Virtual Machine Files
• .log file – These are the files that are created to log
information about the virtual machine and are often times
used for troubleshooting purposes. There will be a number
of these files present in a VM’s directory; the current log
file is always named vmware.log and up to 6 older log files
will also be retained with a number at the end of their name
(i.e. vmware-2.log). A new log file is created either when a
VM is powered off and back on or if the log file reaches the
maximum defined size limit. The amount of log files that are
retained and the maximum size limits are both defined as
VM advanced configuration parameters (log.rotateSize &
log.keepOld).
30. Virtual Machine Files
• .vmxf file - This file is a supplemental configuration file
that is not used with ESX but is retained for compatibility
purposes with Workstation. It is in text format and is used
by Workstation for VM teaming where multiple VMs can be
assigned to a team so they can be powered on/off or
suspended and resumed as a single object.