This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
computing:storage:xen_virtualization [2011/11/27 10:55] gcooper |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Xen Virtualization ====== | ||
- | |||
- | http:// | ||
- | |||
- | Comparison - http:// | ||
- | |||
- | Support - http:// | ||
- | |||
- | Getting Started User Guide - http:// | ||
- | |||
- | Wiki - http:// | ||
- | |||
- | Mail Lists - http:// | ||
- | |||
- | [[XenServer]] - http:// | ||
- | |||
- | 2 sockets | ||
- | 4GB RAM | ||
- | Manage single server at a time | ||
- | Free | ||
- | |||
- | **CPU Support** | ||
- | |||
- | echo; echo -n " | ||
- | egrep ' | ||
- | 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:// | ||
- | |||
- | 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 / | ||
- | 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 " | ||
- | 5. Hold down the " | ||
- | 6. Finish the install | ||
- | 7. Do a "yum update" | ||
- | 8. Do a "yum install < | ||
- | |||
- | DomU | ||
- | |||
- | Use separate disk partition | ||
- | |||
- | mkfs.ext3 /dev/sdxn | ||
- | |||
- | **Ubuntu Guest** | ||
- | |||
- | mount /dev/sdxn /mnt | ||
- | |||
- | debootstrap --arch amd64 hardy /mnt http:// | ||
- | mount --bind /dev /mnt/dev | ||
- | mount proc /mnt/proc -t proc | ||
- | chroot /mnt / | ||
- | |||
- | Open another terminal and copy some files to the new guest partition | ||
- | You may need to create some folders first | ||
- | |||
- | cp / | ||
- | cp / | ||
- | cp / | ||
- | cp / | ||
- | cp -R / | ||
- | |||
- | Back int the original (chroot' | ||
- | |||
- | apt-get update | ||
- | apt-get upgrade | ||
- | apt-get install vim [[ssh]] | ||
- | |||
- | Edit the /etc/fstab file | ||
- | / | ||
- | |||
- | passwd | ||
- | exit #the chroot environment | ||
- | umount | ||
- | |||
- | Create the Xen configuration file adjusting the IP addressing | ||
- | |||
- | vi / | ||
- | |||
- | kernel | ||
- | ramdisk | ||
- | memory | ||
- | # | ||
- | # Disk device(s). | ||
- | # | ||
- | root = '/ | ||
- | disk = [ | ||
- | ' | ||
- | ] | ||
- | # | ||
- | # Hostname | ||
- | # | ||
- | name = ' | ||
- | # | ||
- | # Networking | ||
- | # | ||
- | vif = [ ' | ||
- | # | ||
- | # Behaviour | ||
- | # | ||
- | on_poweroff = ' | ||
- | on_reboot | ||
- | on_crash | ||
- | vcpus | ||
- | extra = ' | ||
- | |||
- | xm create / | ||
- | |||
- | xm list | ||
- | |||
- | **Centos Guest** | ||
- | |||
- | LAMP image on Centos 5 saved in /vm/xen on [[appserv]] | ||
- | |||
- | Create Centos 5 VM | ||
- | |||
- | http:// | ||
- | |||
- | ln -s / | ||
- | |||
- | chkconfig --list |grep " | ||
- | |||
- | Disable TLS | ||
- | mv /lib/tls / | ||
- | |||
- | Start xendomains service to stop/start the Xen domains listed in / | ||
- | |||
- | chkconfig --add xendomains | ||
- | |||
- | To stop or start all Xen domains in / | ||
- | service xendomains stop|start|restart | ||
- | |||
- | Start the xend management daemon | ||
- | chkconfig xend on | ||
- | |||
- | Minimal Services | ||
- | http:// | ||
- | |||
- | Helpful Commands | ||
- | |||
- | Sometimes things get confused and communications fail: | ||
- | |||
- | / | ||
- | |||
- | 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. | ||
- | 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]], | ||
- | |||
- | $sshPath -l root $host / | ||
- | |||
- | You can check the log like this: | ||
- | |||
- | tail -50 / | ||
- | |||
- | Currently, on Linus, the woodstock backup is blacked out except for 3:00am Monday morning. | ||
- | |||
- | The DumpPreUsrCmd script suspends/ | ||
- | |||
- | Virtual Machine Manager | ||
- | |||
- | http:// | ||
- | |||
- | yum install kernel-xen xen virt-manager | ||
- | |||
- | The "Virt Install" | ||
- | |||
- | 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, | ||
- | |||
- | The " | ||
- | |||
- | Live Migration | ||
- | |||
- | ''' | ||
- | # virt-clone \ | ||
- | --original demo \ | ||
- | --name newdemo \ | ||
- | --file / | ||
- | ''' | ||
- | |||
- | / | ||
- | |||
- | Last changed (in Tomboy): 2010-11-15 | ||
- | Note created (in Tomboy): 2007-07-28 | ||