Upload
lysander-theron
View
16
Download
0
Embed Size (px)
DESCRIPTION
Xen Virtualization. Andrew Hamilton. TJHSST CSL Logo and Powered By Linux by Dan Tran tjhsst.edu/~dtran. Presentation Overview. Theory Methods of Virtualizing Xen Virtualization Conclusion. Theory. Do one thing and do it well (The UNIX philosophy) Containerize Systems - PowerPoint PPT Presentation
Citation preview
Xen VirtualizationAndrew HamiltonTJHSST CSL Logo and Powered By Linux by Dan Tran tjhsst.edu/~dtran
Presentation OverviewTheoryMethods of VirtualizingXen VirtualizationConclusion
TheoryDo one thing and do it well (The UNIX philosophy)Containerize SystemsMany little machines contained in one
Methods of VirtualizationChrootsMinimal OverheadOne kernel, network connection, process systemRoot can break outFreeBSD Jails / Solaris ContainersSeparate Networking and process systems, root is trappedOverhead is still minimalStill only one kernel
More Methods of VirtualizationFull VirtualizationMultiple OSes, complete segregation of resourcesHigh overhead, oftentimes expensiveParavirtualization (Xen/LDOMs)Multiple Oses with less overheadMay require specialized hardware or a modified operating system
Xen Virtualization
What we haveHypervisorRuns underneath everything and serves as an interface between the hardware and the VMsThe Xen part of Xen VirtualizationDom0Generally a linux kernel with the xen patchesIs able to control the hypervisor and manage VMsNeeds drivers for the server hardwareDomUsThe VMs we want to run
Installing a Dom0First install and configure the linux distribution of your choiceThen install the xen-specific packagesDebian: apt-get install xen-linux-imageGentoo: emerge xen, xen-tools, xen-sourcesRed Hat: yum install xen kernel-xen
Configuring the Dom0GrubBoot using the Xen hypervisor as the kernelLoad the Dom0 Kernel as a ModuleStart xend on bootVM Storage SpaceLocal vs SANFiles or LVM (or other devices)Setup VM NetworkingBridging or NAT
VM Networking: BridgingSwitcheth0xenbr0Vif0.0Vif1.0Vif2.0Network BridgePhysical AdapterNetworkVMs
VM Networking: NATSwitcheth0IPTablesVif0.0Vif1.0Vif2.0NAT/FirewallPhysical AdapterNetworkVMs
Testing Time!Reboot to the Xen Setup (hopefully it boots)Stress Test the new setupRecompiling the kernel repeated works wellFor a in `seq 1 20`; do make clean; make; done;Make sure everything works well nowIf it doesnt fix it now
Creating VMsManual or automatic?Xen-toolsFile-based vs Device-basedCreate the harddrivesLVM create the logical volumesFiles, create the filesFormat the disks
Linux VMsMount the hard-drivesUse an appropriate method to install your OSDebootstrapUntar and chrootCopy over an imageRemember VMs only need a small set of packages
Xen Config Fileskernel = /boot/kernel-2.6.29-r1-amd64-xen-domuInitrd (if required)Memory = 512Disk = [ phy:vgmagellanic/ns1-disk,sda1,wfile:/home/xen/ns1-swap,sda2,w ]Name = ns1vif = [ 'mac=00:02:C6:26:10:B7,mac=00:16:3e:aa:bb:cc,bridge=xenbr1 ]
Managing VMsStarting VMs (xm create)We usually want to be running VMsStopping VMs (xm shutdown)This is the nice safe way to stop VMsReally Stopping VMs (xm destroy)The Xen equivalent of a four-second offMonitoring (xm list, xm top)
Advanced FeaturesLive Migration (xm migrate)Enable in xend configBoth servers need to be able to access the VMs disksSnapshotting for backupsUsing lvm to make consistent backupsSnapshot the domu from the dom0Mount the snapshot and rsync or tar it
ConclusionXen can provide a separation of services with minimal performance hitIt is NOT a guaranteed security measure, but its pretty goodSome programs dislike running in VMsAllows Virtualization on older x86 hardware
http://tjhsst.edu/~ahamilto/josti09/This Presentationhttp://tjhsst.edu/admin/livedoc/Sysadmin Livedoc, lots of general knowledge about Linux/UNIXhttp://www.xen.orgHomepage of the Xen project.A Few Resources
Any Questions?