CSE 501 Monday, September 26, 2011 Kevin Cleary kpcleary@buffalo.edu What is Virtualization? What are the different types of virtualization. Practical Uses Popular virtualization products Demo Question, answer, discussion Can mean many things: Application virtualization Desktop (client) virtualization Memory virtualization (beginnings of cloud computing) Hardware virtualization Storage virtualization Software simulation of hardware resources Simulated resources can execute operating systems and programs like real physical machines. Software run on virtual machines is isolated from the underlying hardware resources. 1
This is typically what we think of when we talk about Virtualization. The term host refers to the actual machine on which the virtualization takes place The term guest, refers to the virtualized machine. The software or firmware that creates a virtual machine on the host hardware is called a hypervisor or Virtual Machine Monitor/Software. Is Emulation the same as Virtualization? Host Operating System Hypervisor or Virtualization Software Guest Operating System 1 Guest Operating System 2 Guest Operating System 3 Simulated Hardware Physical Hardware 2
The software or firmware that creates a virtual machine is called a Hypervisor or Virtual Machine Monitor. Hypervisors can provide different levels of virtualization: Full - Almost complete simulation of the actual hardware Slowest Partial - Some of the target environment is simulated Para - hardware environment is not simulated; guest software is executed in own isolated domains Fastest Guest software needs to be specifically modified or virtual machine aware to run in a para-virtualization environment. Increase the utilization of costly hardware resources such as CPU and memory. More granular control of hardware resources A virtual machine can be more easily controlled and inspected from outside than a physical one, and its configuration is more flexible. This makes virtual machines useful for: Kernel Development Teaching operating system courses A new virtual machine can be provisioned as needed without the need for an up-front hardware purchase. A virtual machine can easily be relocated from one physical machine to another as needed. Copy a virtual machine with demonstration software to a laptop Migrate from faulty to backup hardware Disaster Recovery purposes Site Colocation Virtual machine images can be easily cloned and re-used. Ability to Snapshot known good configurations 3
Lower cost (money and time) of deploying services Less hardware needed More efficient use of hardware resources Easy to develop and test systems and software An error inside a virtual machine does not harm the host system Risky tasks can be isolated in a virtual machine Web Browsing! Needing to run an application not natively supported by the host OS. Ex: Mac User s needing to run Windows Apps. Evaluate an alternate OS. Ex: Windows users giving Ubuntu a test drive. Server Virtualization Running multiple virtual servers on a single physical server. Duplicating environments: A way of distributing pre-configured environments to other users. When is it not advantageous to virtualize a machine? When applications require a lot of CPU or memory resources such as a compute server. When applications generate a lot of disk I/O. When some type of service is already performing a virtualization task Ex: Citrix or Sunray Services When there is a high network link utilization that cannot be bound to a particular NIC 4
Hardware-assisted virtualization requires explicit support in the host CPU, which is not available on all x86/x86_64 processors Virtualization often exacts performance penalties resources required to run the hypervisor reduced performance on the virtual machine compared to running native on the physical machine. A guest operating system will run faster on the bare CPU. Upfront costs are not cheap! More expensive hardware is needed in some cases Robust setups may need additional storage and expensive hypervisor software Duo booting requires more of a change to the hard disk. Resizing of volumes and partitioning can sometimes cause problems that result in data loss. Sometimes files are not shared between the OSs (although this seems to be getting better). Virtual disk images expand on demand and make more efficient use of drive space. Ultimately one OS goes unused more often, which means more time goes by until patches and anti virus definitions can be applied. Virtualization gives more flexibility on 2 nd, 3 rd, N th operating system setups. At least some type of duo core CPU with some type of virtualization extension support. Available for both Intel and AMD. Intel virtualization (VT-x) AMD virtualization (AMD-V) Support for this may need to be enabled in the BIOS. At least 2-4 gigabytes of RAM If you want to virtualize a 64 bit OS you will need a 64 bit CPU. 5
Interacting with a desktop which is being simulated on a separate physical machine. Separate physical machine are capable of accommodating many users. Advantages: Distribution of pre-configured desktop significantly reduces hardware and utility costs. Easier to backup data Easier to distribute applications Disadvantages: Reliance on sound network connections Initial deployments can be very complex and costly Virtual desktop infrastructure (VDI), can be thought as a more advanced form of hardware virtualization: Users interact with a client program rather than directly interacting with a host computer via a keyboard, mouse and monitor connected to it User interacts with the host computer over a network connection using another desktop computer or a mobile device. Client programs: My Virtual Lab: http://ubit.buffalo.edu/software/virtual/ Session virtualization, allows multiple users to connect and log into a shared but powerful computer over a network and use it simultaneously. This is very similar to timesharing! Client based programs: Oracle Virtual Desktop Connector: https://wiki.cse.buffalo.edu/services/content/oracle-virtualdesktop-client Xwin and the Linux XDMCP protocol http://ubit.buffalo.edu/software/win/xwin32/ 6
Interacting with a desktop which is being simulated on a separate physical machine. Thin Clients such as Sunray and Citrix terminals Simple computers that are primarily designed to connect to a network. They lack significant hardware resources. Thin clients are very network dependent. These days, cost saving margins are razor thin Web Based Virtual Desktops: http://www.eyeos.org/ http://www.oodesk.com/home.php Fooling (encapsulating) an application at runtime into believing that it is directly interfacing with a different operating system. Compatibility modes in Windows Wine allows Microsoft Windows applications to run on Linux http://www.winehq.org/ Useful for: Legacy applications Applications with buggy code Operating system migrations Aggregation of RAM from networked, and therefore distributed, servers to shared pool of memory. Pooled memory can be shared at: The application level through programming APIs The OS level through a page cache http://scalemp.com/ 7
Application API or Kernel Page Cache Pooled RAM RAM Computer 1 RAM Computer 2 RAM Computer 3 RAM Computer N With a cloud infrastructure (AKA infrastructure as a service, IaaS) we take the pooling of resources one step further. CPUs, memory and storage are all pooled. We insert a layer of middleware known as the infrastructure virtualization software to abstract compute, network and storage infrastructures. This middleware can create elastic pools that can be dynamically scaled up or down depending on application workloads. Middleware providers include: Amazons EC2: http://aws.amazon.com/ec2/ Eucalyptus (Open Source): http://www.eucalyptus.com/ Virtual Machine 1 Virtual Machine 2 Virtual Machine 3 Infrastructure Virtualization Software Pooled Storage Pooled CPUs Pooled RAM RAM RAM RAM RAM CPU(s) CPU(s) CPU(s) CPU(s) Computer 1 Computer 2 Computer 3 Computer N 8
Public or Private Clouds? Upfront cost is reduced in a public cloud model Capital expenditure is converted to operational expenditure Lower barriers to entry Pricing on a utility computing basis is fine-grained Both private and public clouds offer hardware elasticity via dynamic ("on-demand") provisioning of resources on a fine-grained, self-service basis near real-time. Public or Private Clouds? With Public Clouds a greater importance is placed on understanding and negotiating service level agreements (SLAs). This means replacing IT staff with lawyers Access times may decrease to resources in a public cloud model. Usually internal network speeds are faster than internet connections. Public or Private Clouds? Which is more secure? Concerns can persist about loss of control over certain sensitive data, and the lack of security for stored kernels. Sometimes IAAS providers are able to devote more resources to solving security issues that many customers cannot afford. Complexity of security is greatly increased when data is distributed over a wider area or greater number of devices and in multi-tenant systems that are being shared by unrelated users. Private cloud installations are in part motivated by users' desire to retain control over the infrastructure and avoid losing control of information security. 9
Parallels: http://www.parallels.com/ Vmware: http://www.vmware.com/ For CSE student licensing information see: https://wiki.cse.buffalo.edu/services/content/vmw are-academic-program VirtualBox: http://www.virtualbox.org/ Windows Hyper-V: http://www.microsoft.com/windowsserver2008 /en/us/hyperv-main.aspx Xen: http://www.xen.org/ Eucalyptus IAAS: http://www.eucalyptus.com/ Amazon EC2: http://aws.amazon.com/ec2/ For more details on demoed products see: http://aws.amazon.com/ec2/ http://www.virtualbox.org/ 10