Virtual machine layer

advertisement
Virtual Machine Overview
Agenda
•
•
•
•
What is Virtual Machine ?
How can virtualization help us ?
Major Virtual Machine Techniques
Introducing 4 popular Virtual Machine
• XEN
• KVM
• VirtualBOX
• VMware player
What's Virtual Machine ?
•
Virtual machine (VM):
A software implementation of a machine (computer) that executes
programs like a physical machine.
•
Types of virtual machine categories:
 System virtual machines - Hardware virtual machine
Provides a complete system platform environment which supports the
execution of a complete operating system (OS).
 Process virtual machine - Application virtual machine
Provides a platform-independent programming environment that
abstracts away details of the underlying hardware or operating system
from software or application runtime.
Example:
 Hardware virtual machine: VMWare, Xen, VirtualBOX ..
 Application virtual machine: Java Virtual Machine, .NET Framework
•
(From Wikipedia)
How can virtualization help us ?
•
•
•
•
Test before we go:
Virtual machine just like a experiment box. You are able to test
your application on different kind of system in same machine. It's easy to
destroy, rebuild or backup your whole testing environments - Virtual
Machine.
Server consolidation:
Many small physical servers could be replaced by virtual machine,
runs on virtualization environment provided by one powerful physical
server. Although hardware is consolidated, typically OSs are not.
Instead, each OS running on a physical server becomes converted to a
distinct OS running inside a virtual machine. The large server can "host"
many such "guest" virtual machines.
Increase hardware utilization:
To increase the utilization of costly hardware resources such as
cpu, memory or even like storage space.
Rapid provisioning, dynamic fault tolerance..
For example:
 Computing task can now be utilized down to core of cpu level.
 Big system memory can partition as smaller portions for legacy system
runs within a virtual machine.
Traditional vs. Virtual Architecture
Traditional Architecture
Virtual Architecture
( Quote from VMware )
Xen Architecture
◇ Virtual machine layer
◇ Hypervisor layer
◇ Hardware/physical layer
Hardware or physical layer:
Physical hardware components including memory, CPU, network cards, and disk
drives.
Hypervisor layer:
Thin layer of software that runs on top of the hardware. The Xen hypervisor gives
each virtual machine a dedicated view of the hardware.
Virtual machine layer:
Operating system hosted on the hypervisor and appearing to the user as a separate
physical computer. However, the machine shares physical resources with other
virtual machines, and it is portable because the virtual machine is abstracted from
the physical hardware.
VM Techniques (1) - Full-Virtualization
•
Technical aspects:
Full virtualization is a virtualization technique used to provide a
certain kind of virtual machine environment, saying, a complete
simulation of the underlying hardware which represents total
abstraction of the underlying physical system, and create a
complete virtual system in which the guest operating system can
execute.
In such an environment, any software capable of execution on
the raw hardware, can be run in the virtual machine and; in
particular, any operating systems (Guest Operating System). No
modification is required in the guest operating system or application;
the guest operating system or application is not even aware that it is
running within a virtualized environment.
•
Typical solution of Full-Virtualization:
 Commercial: VMWare ESX, Microsoft Virtual Server, Citrix
XenServer.
 Opensource: Linux Xen hypervisor – Hardware Virtual Machine
(HVM), KVM.
Full-Virtualization - Continue
•
•
Advantages:
 Operating System does not
need to be modified in order to
run in a virtualized
environment.
 Virtual machine can smoothly,
easily change to different
virtual system.
Example: converting VMWare
guest image into Xen image
Disadvantages:
 Incur performance and resource penalty on VMs.
 Some Virtual Machine require CPUs with special virtualization
support built in (such as Intel-VT and AMD-V), Example: Xen.
VM Techniques (2) - Para-Virtualization
•
Technical aspects:
Para-virtualization is a virtualization technique that attempts to
provide most services directly from the underlying hardware instead of
abstracting it. Para-virtualization allows for near-native performance.
Para-virtualization requires that a guest operating system be modified
to support virtualization. This typically means that guest operating systems
are limited to open source systems such as Linux.
•
Typical solution of Para-Virtualization:
• Commercial: Sun Solaris container.
• Opensource: Linux Xen Hypervisor.
Para-Virtualization - Continue
•
Advantages:
 Para-virtualized guest system comes closer to native performance
than a fully virtualized guest.
 The latest virtualization CPU support is not needed for paravirtualized.
•
Disadvantages:
 Requires that a guest operating system be modified to support
virtualization. This typically means that guest operating systems are
limited to open source systems such as Linux.
 It is not possible to migrate a guest Operating System from one
platform to another.
VM Techniques (3) - Hardware assisted FullVirtualization
•
Hardware-assisted virtualization:
 Is a platform virtualization approach that enables efficient full
virtualization using help from hardware capabilities, primarily from
the host processors.
 Hardware-assisted virtualization was recently (2006) added to x86
processors (Intel VT or AMD-V).
 Is also known as accelerated virtualization; Xen calls it hardware
virtual machine (HVM). KVM--which stands for "Kernel-based
Virtual Machine"--provides for hardware-assisted virtualization.
VM Techniques (3) - Hardware assisted FullVirtualization - Continue
•
Benefits of Hardware-Assisted Virtualization:
 Hardware-assisted virtualization changes the access to the
operating system itself.
 With hardware-assisted virtualization, the operating system has
direct access to resources without requirement to any emulation or
OS modification.
Introducing 4 popular Virtual Machine Software
•
•
•
•
XEN
KVM
VirtualBOX
VMware player
XEN (1)
•
Xen is a virtual machine monitor for IA-32 (x86, x86-64), IA-64 and
PowerPC 970 architectures. It allows several guest operating systems to
be executed on the same computer hardware concurrently.
•
Xen was initially created by the University of Cambridge, Computer
Laboratory and is now developed and maintained by the Xen community
as free software, as well as Citrix XenServer Commercial version variant.
•
A Xen system is structured with the Xen hypervisor as the lowest and
most privileged layer. Above this layer are “one” or “more” guest
operating systems, which the hypervisor schedules across the physical
CPUs.
•
The first guest operating system called in Xen terminology a.k.a "domain
0" (dom0), is booted automatically when the hypervisor boots and given
special management privileges and direct access to the physical
hardware.
•
System administrator can log into dom0 in order to manage any further
guest operating systems, called "domain U" (domU) in Xen terminology.
XEN (2)
$ xm list
Name
ID Mem(MiB) VCPUs State
Time(s)
CentOS5.3_testbed
79
2047
2
-b----
7039.6
Ubuntu9.10_testbed
14
2047
1
-b----
114443.9
0
25456
8
r-----
8021232.4
Domain-0
KVM (1)
KVM (for Kernel-based Virtual Machine)
•
Open source software, full virtualization solution for Linux on x86 hardware,
which containing virtualization extensions (Intel VT or AMD-V).
It consists of a loadable kernel module:
 “kvm.ko”, that provides the core virtualization infrastructure.
 “kvm-intel.ko”, processor specific module for Intel CPU.
 “kvm-amd.ko”, processor specific module for amd CPU.
KVM also requires a modified QEMU although work is underway to get the
required changes upstream.
•
By 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 (2)
KVM Architecture – with Linux Kernel modules
`
VirtualBox (1)
•
VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product
for enterprise as well as home use. Not only is VirtualBox an extremely
feature rich, high performance product for enterprise customers, it is
also the only professional solution that is freely available as Open
Source Software under the terms of the GNU General Public License
(GPL).
•
Presently, VirtualBox runs on Windows, Linux, Macintosh and
OpenSolaris hosts and supports a large number of guest operating
systems including but not limited to Windows (NT 4.0, 2000, XP, Server
2003, Vista, Windows 7), DOS/Windows 3.x, Linux (2.4 and 2.6),
Solaris and OpenSolaris, and OpenBSD.
•
Nice user interface and easy to install on Windows or Linux.
•
Free Download : http://www.virtualbox.org/wiki/Downloads
VirtualBox (2)
Screenshot of Windows VM running on Linux’s system via VirtualBox
VMware player (1)
•
VMWare, Inc.
Commercial software provider, specialize for providing virtualization
software and corresponding solution. VMware has many popular
virtualization solution across windows and linux platform, like: VMware
Workstation, Server, ESX, GSX and client side software called VMWare
player.
•
VMware Player provide a easiest way to run multiple operating systems at
the same time on your desktop. With its user-friendly interface, VMware
Player makes it effortless for anyone to try out Windows 7, Chrome OS or
the latest Linux releases, or create isolated virtual machines to safely test
new software and surf the Web. VMware Player can also be used to run a
virtual copy of an old PC so that you can recycle the old machines you
have under your desk or stored in the closet.
•
Download: http://www.vmware.com/go/downloadplayer/
VMware player (2)
Screenshot of Linux VM running on Windows’ system via VMWare player
How Infrastructure as a Service (IaaS) utilize
Virtualization
•
From WikipediA:
Cloud infrastructure services or "Infrastructure as a Service (IaaS)"
delivers computer infrastructure, typically a platform virtualization
environment as a service.
•
Company provide IaaS – Clouds vendors:
 Amazon's EC2 (Elastic Compute Cloud)
 Google's App Engine
 Microsoft's Azure platform
 TCloud Computing - Elaster
All the vendors above provide services for delivering custom’s
applications to internet environment and still maintain flexibility,
configurability and pay-only-for-what-you-use model to the client when
subscribe their services.
All cloud service provider leverage the virtualization technologies as a
fundamental building block in the whole infrastructure and management
stack.
Amazon’s Elastic Compute Cloud EC2 and
Virtualization – Xen
•
Amazon Elastic Compute Cloud (EC2):
 A central part of Amazon.com's cloud computing platform, EC2
allows users to rent virtual computers on which to run their own
computer applications.
 EC2 allows scalable deployment of applications by providing a web
service the - Amazon Web Services (AWS) which a user can create
a virtual machine, boot an Amazon Machine Image to which
Amazon calls an "instance", containing any software desired.
 EC2 uses Xen virtualization. Each virtual machine, called an
"instance", functions as a virtual private server.
•
Private Clouds:
A private cloud is a cloud computing infrastructure created by an
organization for its own internal use, rather than using someone else’s
infrastructure (e.g., Amazon EC2). Many open source project provide
management software as a virtualization framework management utility
for private cloud.
Introduce two virtualization management software
 OpenNebula is a virtualization control framework, an open-source
toolkit to easily build any type of cloud, includes private, public and
hybrid.
 OpenNebula has been designed to be integrated with any
networking and storage solution and so to fit into any existing data
center, such as EC2 service.
An Opennebulas architecture
Introduce two virtualization management software Coutinue
 Eucalyptus - Elastic Utility Computing Architecture for Linking Your
Programs To Useful Systems“
 An infrastructure for the implementation of cloud computing on
computer clusters which provides an interface that is compatible
with the Amazon EC2 service.
 With Eucalyptus, Users make more efficient use of their computing
capacity, thus increasing productivity and innovation, deploying
new applications faster, and protecting sensitive data while making
savings in capital expenditure.
 Reference: http://www.eucalyptus.com/
Hands on:
•
Build your own first virtualization
sandbox .. with VMWare Player
•
Introduction of VMWare Player
 What is VMWare Player
 Get your software for free
 Installation and setup
 Prepare your own VM images .. Windows, Linux, ..
•
VMWare software runs on different platforms:
MS Windows, Linux, Mac OSX.
Introduction of VMWare Player
- What is VMWare Player
• Freeware virtualization software
VMWare player is for personal non-commercial use of virtualization
software released by EMC Corp. It can runs on Windows and Linux
32bits or 64 bits OS platform.
VMWare player main aim is on target to compare with same
implementation of desktop virtualization product from Microsoft - Virtual
PC, which is Microsoft's free desktop virtualization software.
• Something we have to know ..
The VMWare Player’s versions which is earlier than 3.0.0 were unable
to create virtual machines, meaning users have to get pre-installed
virtual machines, manually create and edit vm’s profile for VMWare
Player. Version 3.0.0 or later lifts this limitation, allowing users to create
new virtual machines in the GUI.
Introduction of VMWare Player
- Get your software for free
•
•
Register you VMWare Player license and get the software:
Download and register VMWare Player, go to visit VMWare website,
fill the form and get software download link from license notification
email.
Http://www.vmware.com/products/player/
Introduction of VMWare Player
- Installation and setup
•
•
Run VMWare installer
When finished download VMWare Player software,
open the software installer. Software installation
will use total 200MB around disk space for the last
version 3.1.
After VMWare Player installation finished, open the
“VMWare Player”, complete the license agreement.
Then may start to configure the system
environment:
 In preferences, download VMWare Tools , The
“VMware Tools” package provides supports
required for shared folders and for drag and
drop operations, and better display
performance of VMs.
 If need more advance features in VMWare
solution, users are required to upgrade the
Player to “VMWare Workstation.
Introduction of VMWare Player
- Prepare your own VM images ..
• Create virtual machine in VMWare Player
 Acquire operating system iso image or make use of host
machine’s dvd device directly. VMWare player will emulate pc
bios, find out a bootable device which follows the boot device
sequence setup in vm’s bios
 User can create vm firstly, after vm(s) created, then configure
boot device and media source for installation. Just like we will
go for buying a bare metal box (PC), and get start to install
operating system after complete to assemble pc with
components like cpu(s), ram(s) and hard drive(s).
 Select a “Guest Operating System (vm)”, and pick up correct
version (distribution) for that media source you are using.
Remember that VMWare Player can install both 32 or 64bits
guest os on 64bits host (server), but can’t install 64bits vm on
32bits host (server).
Introduction of VMWare Player
- Installation and setup, continue
•
Select “Version” (guest OS). for what operating system you are going to
install.
•
Decide the location (local) for where vm’s virtual hard drive (HDD) and
profile repository to store, the location supposedly to has a large space
to store many vm’s “vmdk” – virtual machine disk file.
•
VM(s) can be migrated and backup via copy whole installation directory
of the vm(s) to another server
Introduction of VMWare Player
- Prepare your own VM
•
•
Configure vm host to store vm’s virtual
disk(s) with single giant file or multiple
one; file access performance of vm will
be degraded if user create a single big
file for vm. User are suggested to
create separated multiple files if need
big disk space for vm.
Refer to VM’s profile information listed
here, more customization of hardware's
specification can be adjusted via select
“Customize Hardware …”:
 Memory
 Number of cpu(s)
 DVD
 Type of device controller:
IDE or SCSI
 Network adapter:
Bridge, NAT, host only
Introduction of VMWare Player
- Prepare your own VM, continue
•
Common Networking Configuration
Explanation of VMWare:
 Bridged Networking
Bridged networking connects a
virtual machine to a network by
using the host computer’s
network adapter.
 Host-Only Networking
Host-only networking creates a network that is contained within
host machine itself; This approach can be useful to set up an
isolated virtual network. In this configuration, the virtual machine
cannot connect to the Internet.
 Network Address Translation
The virtual machine and the host share a single network identity
that is not visible outside the network. NAT can be useful when
your network administrator lets you use a single IP address or
MAC address.
Introduction of VMWare Player
- Prepare your own VM, continue
•
When finish the configuration of vm(s), select your vm from vm
repository, edit “virtual machine settings …”:
 Change the CD/DVD connection to use ISO image or physical
drive of host machine.
 Select Connect at power on (means “start vm”)
•
Right click to select “Play Virtual Machine“, after vm boot up, follow
the OS installation processes to finish the new OS installation.
Notice: there is message remind user to install “vmware tools”, but
it can be done after os installation completed.
Introduction of VMWare Player
- Prepare your own VM, continue
•
Install VMWare Tools in to VM(s):
Enable “Install VMWare Tools…”, and
open a console extract the vmware tools
package from the vm’s cdrom.
• Run the installation script “./vmwareinstall.pl”, wait for installation processes
completed, then reboot the system again
to let the changes take effect (change of
the display driver can take place right
away).
•
After vm system reboot , vm preparation is
now completed
Screenshot of new vm - CentOS on windows..
Reference
•
•
•
•
•
•
•
http://en.wikipedia.org/wiki/Virtual_machine
http://www.xen.org/
http://www.linux-kvm.org/page/Main_Page
http://www.virtualbox.org/
http://www.vmware.com/
http://www.eucalyptus.com/
http://opennebula.org/
Download