User Tools

Site Tools


computing:storage:xen_virtualization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computing:storage:xen_virtualization [2011/11/27 10:50]
gcooper
— (current)
Line 1: Line 1:
-====== Xen Virtualization ====== 
- 
-http://www.howtoforge.com/installing-xen-on-centos-5.2-i386 
- 
-Comparison - http://www.xensource.com/products/ 
- 
-Support - http://www.xensource.com/support/ 
- 
-Getting Started User Guide - http://www.xensource.com/support/3.2/xenserver-userguide.html 
- 
-Wiki - http://wiki.xensource.com/xenwiki/ 
- 
-Mail Lists - http://lists.xensource.com/ 
- 
-XenServer - http://www.citrix.com/xenserver 
- 
-2 sockets 
-4GB RAM 
-Manage single server at a time 
-Free 
- 
-**CPU Support** 
- 
-echo; echo -n "  Full-Virtualization is ";\ 
-egrep '^flags.*(vmx|svm)' /proc/cpuinfo || echo -n "not ";\ 
-echo "suported by your CPU"; echo 
- 
-Dom0 (Host OS) 
- 
-Use 64-Bit for best performance and in order to be able to run 64-bit guests. 
- 
-Use hardware supports Intel VT or AMD SVM for fully virtualized guests (Windows). 
- 
-**[[Ubuntu Server]]****[[ 8.04]]** 
- 
-http://www.howtoforge.com/high-performance-xen-on-ubuntu-8.04-amd64 
- 
-Install the Ubuntu Hardy Heron (x86_64) Server Edition 
- 
-Create and install into a 10GB partition for Dom0 
-apt-get update 
-apt-get upgrade 
-apt-get install ubuntu-xen-server 
-apt-get install vim [[ssh]]-server 
-vi /etc/modules  
- loop max_loop=64 
-uname -a 
-xm list 
- 
-**Centos 5.1** 
- 
-[[Minimal Server Install (Centos 5)]] 
- 
-1. Boot to CD 1, the only CD needed 
-2. Enter "linux text" to get the text installation setup started 
-2.5. Create and install into a 10GB partition for Dom0 
-3. Proceed normally with the installation until it asks which packages to install 
-4. Deselect all of the packages and then click on the "customize package selection" check box 
-5. Hold down the "-" key, which scrolls through all of the package options, and deselects them all 
-6. Finish the install 
-7. Do a "yum update" 
-8. Do a "yum install <package>" for needed packages such as [[ssh]]-server 
- 
-DomU 
- 
-Use separate disk partition 
- 
-mkfs.ext3 /dev/sdxn 
- 
-**Ubuntu Guest** 
- 
-mount /dev/sdxn /mnt  
- 
-debootstrap --arch amd64 hardy /mnt http://archive.ubuntu.com/ubuntu 
-mount --bind /dev /mnt/dev 
-mount proc /mnt/proc -t proc 
-chroot /mnt /bin/bash  
- 
-Open another terminal and copy some files to the new guest partition 
-You may need to create some folders first 
- 
-cp /etc/resolv.conf /mnt/etc/resolv.conf 
-cp /etc/network/interface /mnt/network/interface 
-cp /etc/apt/source.list /mnt/etc/apt/sources.list 
-cp /etc/apt/source.list /mnt/etc/apt/sources.list 
-cp -R /lib/modules/2.6.24-17-xen/* /mnt/lib/modules/2.6.24-17-xen/ 
- 
-Back int the original (chroot'ed) terminal 
- 
-apt-get update 
-apt-get upgrade 
-apt-get install vim [[ssh]] 
- 
-Edit the /etc/fstab file 
-/dev/hda1               /               ext3 defaults        1       2 
- 
-passwd 
-exit    #the chroot environment 
-umount  /mnt/dev /mnt/proc /mnt 
- 
-Create the Xen configuration file adjusting the IP addressing 
- 
-vi /etc/xen/domu1.cfg  
- 
-kernel      = '/boot/vmlinuz-2.6.24-17-xen' 
-ramdisk     = '/boot/initrd.img-2.6.24-17-xen' 
-memory      = '512' 
-# 
-#  Disk device(s). 
-# 
-root        = '/dev/hda1 ro' 
-disk        = [ 
-                  'phy:/dev/sda2,hda1,w', 
-     ] 
-# 
-#  Hostname 
-# 
-name        = 'domu1' 
-# 
-#  Networking 
-# 
-vif         = [ 'ip=192.168.1.102,mac=00:16:3E:62:DA:BB' ] 
-# 
-#  Behaviour 
-# 
-on_poweroff = 'destroy' 
-on_reboot   = 'restart' 
-on_crash    = 'restart' 
-vcpus     = '2' 
-extra = 'xencons=tty1' 
- 
-xm create /etc/xen/domu1.cfg -c 
- 
-xm list  
- 
-**Centos Guest** 
- 
-LAMP image on Centos 5 saved in /vm/xen on [[appserv]] 
- 
-Create Centos 5 VM 
- 
-http://mirrors.easynews.com//linux/centos/5.0/os/i386/ 
- 
-ln -s /etc/xen/vm01 /etc/xen/auto 
- 
-chkconfig --list |grep "3:on" |awk '{print $1}' |sort 
- 
-Disable TLS 
-mv /lib/tls /lib/tls.disabled 
- 
-Start xendomains service to stop/start the Xen domains listed in /etc/xen/auto 
- 
-chkconfig --add xendomains 
- 
-To stop or start all Xen domains in /etc/xen/auto 
-service xendomains stop|start|restart 
- 
-Start the xend management daemon 
-chkconfig xend on 
- 
-Minimal Services 
-http://www.redhatmagazine.com/2007/03/09/understanding-your-red-hat-enterprise-linux-daemons/ 
- 
-Helpful Commands 
- 
-Sometimes things get confused and communications fail: 
- 
-/etc/init.d/xend restart 
- 
-Other useful commands: 
- 
-xm help 
-xm list 
-xm create vmname (start VM) 
-xm console vmname 
-control-] (exit domU to dom0 console) 
-xm shutdown vmname 
-xm destroy vmname (emergency shutdown) 
-virt-install 
- 
-Backup 
- 
-Backup is not so simple.   Image files are pre-allocated and very large - keep them small!  
-They also change frequently so they get backed up every backup run in a file-by-file backup. 
- 
-Need disk-block backup or LVM snapshots. 
- 
-This script suspends, creates a compressed copy of the disk image and resumes all running Xen domains: [[xen_backup.sh]] 
- 
-In [[BackupPC]], I use this DumpPreUsrCmd: 
- 
-$sshPath -l root $host /usr/local/bin/xen_backup.sh 
- 
-You can check the log like this: 
- 
-tail -50 /var/log/xen/xen_backup.log 
- 
-Currently, on Linus, the woodstock backup is blacked out except for 3:00am Monday morning.  This allows [[BackupPC]] on [[appserv]] to complete any lengthy full backups over the weekend. 
- 
-The DumpPreUsrCmd script suspends/resumes each VM in turn: [[ISPConfig]] shuts down for about 1:10, [[appserv]] for about :39 and mgmt takes about :48 minutes. 
- 
-Virtual Machine Manager 
- 
-http://virt-manager.et.redhat.com/ 
- 
-yum install kernel-xen xen virt-manager 
- 
-The "Virt Install" tool (virt-install for short command name, virtinst for package name) is a command line tool which provides an easy way to provision operating systems into virtual machines. 
- 
-The "Virt Clone" tool (virt-clone for short command name, virtinst for package name) is a command line tool for cloning existing inactive guests. It copies the disk images, and defines a config with new name, UUID and MAC address pointing to the copied disks. 
- 
-The "Virt Image" tool (virt-image for short command name, virtinst for package name) is a command line tool for installing guest operating systems based on a pre-defined master image. The image provides metadata describing the requirements of the operating system, minimal resource allocations, and pre-installed disk. 
- 
-The "Virtual Machine Viewer" application (virt-viewer for short package name) is a lightweight interface for interacting with the graphical display of virtualized guest OS. It uses GTK-VNC as its display capability, and libvirt to lookup the VNC server details associated with the guest. It is intended as a replacement for the traditional vncviewer client, since the latter does not support SSL/TLS encryption of x509 certificate authentication. 
- 
-Live Migration 
- 
-''' 
-         # virt-clone \ 
-              --original demo \ 
-              --name newdemo \ 
-              --file /var/lib/xen/images/newdemo.img 
-''' 
- 
-/etc/xen/scripts/vif-bridge: Could not find bridge device xenbr0 
- 
-Last changed (in Tomboy): 2010-11-15 
-Note created (in Tomboy): 2007-07-28 
  
computing/storage/xen_virtualization.1322416249.txt.gz · Last modified: 2011/11/27 10:50 by gcooper