Terry : Virtualization

Virtualization

What is Virtualization?

Virtualization (or virtualisation) is the simulation of the software and/or hardware upon which other software runs. This simulated environment is called a virtual machine (VM). There are many forms of virtualization, distinguished primarily by computing architecture layer, and virtualized components may include hardware platforms, operating systems (OS), storage devices, network devices or other resources.

Hardware virtualization or platform virtualization refers to the creation of a virtual machine that acts like a real computer with an operating system. Software executed on these virtual machines is separated from the underlying hardware resources. For example, a computer that is running Microsoft Windows may host a virtual machine that looks like a computer with the Ubuntu Linux operating system; Ubuntu-based software can be run on the virtual machine.

In hardware virtualization, the host machine is the actual machine on which the virtualization takes place, and the guest machine is the virtual machine. The words host and guest are used to distinguish the software that runs on the physical machine from the software that runs on the virtual machine. The software or firmware that creates a virtual machine on the host hardware is called a hypervisor or Virtual Machine Manager.

Different types of hardware virtualization include

  • Full virtualization: Almost complete simulation of the actual hardware to allow software, which typically consists of a guest operating system, to run unmodified.
  • Partial virtualization: Some but not all of the target environment is simulated. Some guest programs, therefore, may need modifications to run in this virtual environment.
  • Paravirtualization: A hardware environment is not simulated; however, the guest programs are executed in their own isolated domains, as if they are running on a separate system. Guest programs need to be specifically modified to run in this environment.

Hardware-assisted virtualization is a way of improving the efficiency of hardware virtualization. It involves employing specially designed CPUs and hardware components that help improve the performance of a guest environment.

Hardware virtualization is not the same as hardware emulation. In hardware emulation, a piece of hardware imitates another, while in hardware virtualization, a hypervisor (a piece of software) imitates a particular piece of computer hardware or the entire computer. Furthermore, a hypervisor is not the same as an emulator; both are computer programs that imitate hardware, but their domain of use in language differs.

  • Full Virtualization
    VMware Workstation, VirtualBox
  • Hardware-assisted Virtualization
    KVM, Xen HVM, VMware Workstation
  • Partial Virtualization
  • Paravirtualization
    Xen PV
  • Operating System Level Virtualization
    Solaris zones, FreeBSD Jail, OpenVZ, LXC (Linux Containers)

Reference: http://en.wikipedia.org/wiki/Hardware_virtualization

Hypervisor / VMM (Virtual Machine Manager)

In computing, a hypervisor or virtual machine manager (VMM) is a piece of computer software, firmware or hardware that creates and runs virtual machines.

A computer on which a hypervisor is running one or more virtual machines is a host machine. Each of those virtual machines is called a guest machine. The hypervisor presents to the guest operating systems a virtual operating platform and manages the execution of the guest operating systems. Multiple instances of a variety of operating systems may share the virtualized hardware resources.

Concept

Conceptually hypervisor is 1 level higher than a supervisory program.

Hypervisor Classifications

  • Type 1 (or native, bare metal) hypervisors run directly on the host's hardware to control the hardware and to manage guest operating systems. A guest operating system thus runs on another level above the hypervisor. This model represents the classic implementation of virtual machine architectures; the original hypervisors were the test tool, SIMMON, and CP/CMS, both developed at IBM in the 1960s. CP/CMS was the ancestor of IBM's z/VM. Modern equivalents of this are Oracle VM Server for SPARC, the Citrix XenServer, KVM, VMware ESX/ESXi, and Microsoft Hyper-V hypervisor.
  • Type 2 (or hosted) hypervisors run within a conventional operating system environment. With the hypervisor layer as a distinct second software level, guest operating systems run at the third level above the hardware. BHyVe, VMware Workstation and VirtualBox are examples of Type 2 hypervisors.

In other words, Type 1 hypervisor runs directly on the hardware; a Type 2 hypervisor runs on another operating system, such as FreeBSD, Linux or Windows.

Virtualization solutions

VMware Woskstation

Latest Version 10.0.x

One of the best commercial product for desktop users, available on Windows and Linux. There is VMWare Fusion for Mac OS X users.

VMware Server

Recommended version is 1.0.9, I do not recommend 2.x because there is not GUI console to manage the VMs. From 2.0 a web based administration console is being used.

Formerly VMWare GSX server, now it is free of charge.

VMware ESX/ESXi

A part of the vSphere. Native, bare metal hyperviosr (Type 1), to be installed on bare metal.

VirtualBox

Latest version 4.x. Acquired by Sun, now Oracle VM VirtualBox.

Supported platform

  • Linux
  • OS X
  • Windows
  • Solaris (x86)

It's catching up very fast and now is considered even better than VMWare Workstation / Fusion. VBoxManage CLI tool is unbelievably powerful. You can convert vmdk to vdi and to many other supported formats. It's even more capable with Vagrant + provisioning tools like Chef or Puppet. Time to move away from VMware.

If you are using Debian GNU/Linux or Ubuntu, just add the official repository in your source list.

For example Ubuntu

Add the PGP key to the list of trusted keys

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

Add the VirtualBox APT repository:

echo deb http://download.virtualbox.org/virtualbox/debian\ `lsb_release -sc` contrib | \
    sudo tee /etc/apt/sources.list.d/virtualbox.list

OR

echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list

NOTE: special characters (substitution) like $ and ` back-quote works within double quotes. In this case, `lsb_release -sc` is equivalent to $(lsb_release -sc).

OR

sudo echo "deb http://download.virtualbox.org/virtualbox/debian `lsb_release -sc` contrib" > /etc/apt/sources.list.d/virtualbox.list

Debian

deb http://download.virtualbox.org/virtualbox/debian wheezy contrib
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
deb http://download.virtualbox.org/virtualbox/debian lenny contrib non-free

NOTE: 7 wheezy, 6 squeeze, 5 lenny.

XenServer

XenSource was acquired by Citrix in 2007.

XenServer - XenServer is an industry and value leading open source virtualization platform for managing cloud, server and desktop virtual infrastructures.

Citrix launched open source XenServer 6.2 on June 25, 2013 -> XenServer.og

 What is XenServer?

  • A distribution of Xen, the XAPI toolstack, Linux and other components
  • A shrink-wrapped, ready to run virtualization platform
  • Builds on basic Xen virtualization to provide high level management
    Networking, Storage, HA, Cluster management, User accounts (AD integration, role based management), performance monitoring

NOTE: XenServer was formerly XenSource XenEnterprise.

Oracle VM (Xen + libxl / XL)

Oracle VM is supposed to be installed on hardware directly, it is not a desktop product at all. It is similar to VMWare ESX Server. So forget about it unless you want to use it on a bare machine.

VMware Fusion

Desktop product for Mac OS X only.

Microsoft Virtual PC and Virtual Server, Hyper-V OOTB with Windows Server 2008

Not recommended, forget it about it.

Xen

Open source hypervisor, now a Linux Foundation Collaboration project. XenServer has been fully open source by Citrix also.

Xen is a native (bare-metal) hypervisor providing services that allow multiple computer operating systems to execute on the same computer hardware concurrently.

Since Linux 3.0, Xen support for dom0 and doumU exists in mainline kernel.

http://www.xen.org

AWS / EC2 and Linode (Xen powered).

KVM (Kernel-based Virtual Machine, default Virtualization in RHEL6 and SLES new versions)

KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko. KVM also requires a modified QEMU although work is underway to get the required changes upstream.

Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.

The kernel component of KVM is included in mainline Linux, as of 2.6.20.

KVM is open source software.

Digital Ocean is powered by KVM/QEMU.

OpenVZ (Linux Host Only)

Operating system level virtualization. Claims to have better performance.

OpenVZ allows a physical server to run multiple isolated operating system instances, known as containers, Virtual Private Servers (VPSs), or Virtual Environments (VEs). It is similar to FreeBSD Jails and Solaris Zones.

http://en.wikipedia.org/wiki/Openvz

VPS providers

RAM Host (Used to run Arch Linux)

BuyVM (running Debian)

LXC - Linux Containers

What are Linux Containers?

Linux Containers (LXC) are an OS level virtualization (Operating System Level Virtualization (similar to Linux OpenVZ, BSD Jails, Solaris Zones) method for running multiple isolated server installs (containers) on a single control host. LXC does not provide a virtual machine, but rather provides a virtual environment that has its own process and network space. It is similar to a chroot, but offers much more isolation.

 Linux containers has several features / advantages:

 Pros / Advantages:

  • Better isolation as compared to a chroot (chroot jail)
  • Low overhead. LXC uses minimal resources in terms of RAM and hard drive space without the overhead of installing a guest OS in a virtual machine ( VMWare / VirtualBox / KVM )
  • Applications and services (servers) run at native speed
  • There is support for Linux containers in libvirt
  • Linux containers work well with Btrfs
  • No special hardware is required, runs on 32 and 64 bit processors
  • Linux containers are Open source
  • Unlike XEN or OpenVZ, no patch is required to the kernel

Cons / downside:

  •  Linux containers run Linux processes on a Linux kernel (share host’s kernel). This means you can run Linux (Fedora container on an Ubuntu host) but not other operating systems (Not BSD / OS X / Windows)
  • There are no GUI (graphical) interfaces to configure or manage the containers
  • There is a paucity of documentation on how to install and configure a container
  • Configuring a container requires a modest technical knowledge and skill (and a large grain of patience)

More:

LXC is a userspace tool controlling the kernel namespaces and cgroup features to create system or application containers.

To give you an idea:

  • Feels like somewhere between a chroot and a VM
  • Can run a full distro using the “host” kernel
  • Processes running in a container are visible from the outside
  • Doesn’t require any specific hardware, works on all supported architectures

A libvirt driver for LXC exists (libvirt-lxc), however it doesn’t use the “lxc” userspace tool even though it uses the same kernel features.

LXC Configuration

4 steps

  • Kernel (in the mainline already)
  • LXC tools (lxc)
  • Cgroups (cgroup)
  • Bridge network card (bridge-utils)

Parallels

Earliest player on the Mac OS X platform. Now offers a full range of products.

VMWare Base Images repository

Check the page below for more info.

VMware Base Images

VirtualBox Base Images Repository

VirtualBox Base Images

Customer Environment Lab (CEL, based on VMware technology)

Customer Environment Lab

Reference

http://www.slideshare.net/d.ramirez26/vmware-presentation