Inhaltsverzeichnis
Howto: Xen Bridging mit statischen und DHCP NICs
Anleitung folgtAutomatisches starten der XenU domains unter SuSE 11.1
Folgende Dienste sind zu aktivierenchkconfig --level 35 xend on
Checken ob der XEN daemon läuft mittels
ps -ef | grep -v $$ | grep xend
falls der Daemon läuft kann auch xendomains eingerichtet werden.
chkconfig --level 35 xendomains on
Dies init script wird dazu benutzt, beim Systemstart unter /etc/xen/auto definierte domainU zu booten.
/etc/init.d/xendomains liest dies directory alphabetish. Der Softlink Name muß nicht der gleiche wie der domainU Name sein.
Um eine definierte boot Reihenfolge zu generieren, werden die links entsprechend definiert.
Beispiel:
ln -s /etc/xen/vm/SuSE_nfs /etc/xen/auto/S100_SuSE_nfs ln -s /etc/xen/vm/SuSE_sql /etc/xen/auto/S200_SuSE_sql ln -s /etc/xen/vm/SuSE_appl /etc/xen/auto/S310_SuSE_appl
Setting up virtual machines (domU's)
http://xenamo.sourceforge.net/ar01s04.html#id2524172You can follow the instructions at http://www.howtoforge.com/perfect_setup_xen3_debian_p4 in order to setup a Debian Sarge domU:
mkdir -p /mnt/cluster/xenamo/images
mkdir -p /mnt/cluster/xenamo/config
dd if=/dev/zero of=/mnt/cluster/xenamo/images/vm_base.img \
bs=1024k count=1000
dd if=/dev/zero of=/mnt/cluster/xenamo/images/vm_base-swap.img \
bs=1024k count=500
mkfs.reiserfs /mnt/cluster/xenamo/images/vm_base.img
mkswap /mnt/cluster/xenamo/images/vm_base-swap.img
mkdir /mnt/vm_base
mount -o loop /mnt/cluster/xenamo/images/vm_base.img /mnt/vm_base
debootstrap --arch i386 sarge /vserver/vm_base/ \
http://ftp2.de.debian.org/debian
chroot /mnt/vm_base/
apt-setup
Now edit /etc/apt/sources.list and change testing to stable. Then continue with the setup:
apt-get update
apt-get install localeconf
base-config
apt-get remove nfs-common
rm -f /etc/hostname
Next you need to edit /etc/fstab. It should look like this:
/dev/hda1 / ext3 defaults 1 2
/dev/hda2 none swap sw 0 0
/dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
Then, /etc/network/interfaces needs to be created:
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
And finally /etc/hosts:
127.0.0.1 localhost.localdomain localhost
- The following lines are desirable for IPv6 capable hosts
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Now, you can leave the chroot environment and finalize the setup:
exit
cp -dpR /lib/modules/2.6.16-xen /mnt/vm_base/lib/modules/
mv /mnt/vm_base/lib/tls /mnt/vm_base/lib/tls.disabled
umount /mnt/vm_base
The created image file can be used as a domU template. To create the first domU, do:
cd /mnt/cluster/xenamo/images
cp -pf vm_base.img vm01.img
cp -pf vm_base-swap.img vm01-swap.img
cd /mnt/cluster/xenamo/config
nano vm01.sxp
Create now your first domU config file. It should look like this:
name="vm01"
kernel="/boot/vmlinuz-2.6.16-xen"
root="/dev/hda1"
memory=128 disk='file:/mnt/cluster/xenamo/images/vm01.img,hda1,w','file:/mnt/cluster/xenamo/images/vm01-swap.img,hda2,w'
dhcp="off"
ip="10.0.0.1"
netmask="255.255.255.0"
gateway="10.0.0.254"
hostname="vm01.example.com"
extra="3"
Doing your first live migration
Preparing Xen
In order that you can migrate domU's to other Xen hosts, you must configure Xen to allow connections from the other hosts. To do so, edit the file /etc/xen/xend-config.sxp and change the lines containing the following information:
(xend-relocation-server yes)
(xend-relocation-allow '')
This allows all connections to this Xen host. But you can enter any regular expression or IP address. You can find examples inside of the config file.
Start, stop and live migrate your domU's
To start the previously configured domU, execute the following command:
xm create -c /mnt/cluster/xenamo/config/vm01.sxp
The -c parameter brings you to the console of this virtual machine. Like this, you can follow the boot process. Press Ctrl-] to leave the console and return to the dom0. Entering xm list shows you the state of the currently running domU's on this host. In order to migrate a domU, you need the corresponding ID. Now, do your first live migration:
xm migrate --live <id> <hostname>
Adding USB Devices to a Xen HVM domainU Guest
http://www.virtuatopia.com/index.php/Adding_USB_Devices_to_a_Xen_HVM_domainU_Guest#Adding_the_New_USB_Device_to_the_Xen_domainU_Configuration_File