Taking Xen guests (domU) alive via routed network

The xend config looks like this:

playground:~# grep -v ^# /etc/xen/xend-config.sxp
(network-script ‘network-bridge netdev=dummy0′)
(vif-script vif-bridge)
(dom0-min-mem 196)
(dom0-cpus 0)

Creating volume group for Xen domU (/dev/hdb2 was allready created with id 8e):

playground:~# pvcreate /dev/hdb2
Physical volume “/dev/hdb2″ successfully created
playground:~# vgcreate xen-vol /dev/hdb2
Volume group “xen-vol” successfully created
playground:~# vgscan
Reading all physical volumes. This may take a while…
Found volume group “xen-vol” using metadata type lvm2

Creating first domU:

playground:~# xen-create-image –ip 192.168.222.50 –hostname xetch.blubb.cyconet.org
General Infomation
——————–
Hostname : xetch.blubb.cyconet.org
Distribution : etch
Fileystem Type : ext3
Size Information
—————-
Image size : 4Gb
Swap size : 1024Mb
Image type : full
Memory size : 128Mb
Kernel path : /boot/vmlinuz-2.6.18-4-xen-vserver-686
Initrd path : /boot/initrd.img-2.6.18-4-xen-vserver-686
Networking Information
———————-
IP Address 1 : 192.168.222.50
Netmask : 255.255.255.0
Gateway : 192.168.222.1
Creating ext3 filesystem on /dev/xen-vol/xetch.blubb.cyconet.org-disk
Done
Installing your system with debootstrap mirror ftp://ftp.de.debian.org/debian/
Done
Running hooks
Done
No role script specified. Skipping
Creating Xen configuration file
Done
Setting up root password
Enter new UNIX password:
etype new UNIX password:
passwd: password updated successfully
All done
Logfile produced at:
/var/log/xen-tools/xetch.blubb.cyconet.org.log

Add the following to /etc/network/interfaces:

auto dummy0
iface dummy0 inet static
address 192.168.222.1
netmask 255.255.255.0
network 192.168.222.0
broadcast 192.168.222.255

Bringing up network interface, restarting xen and starting the domU:

playground:~# ifup dummy0
playground:~# /etc/init.d/xendomains stop
playground:~# /etc/init.d/xend restart
playground:~# /etc/init.d/xendomains start
playground:~# xm create xetch.blubb.cyconet.org.cfg -c
Using config file “/etc/xen/xetch.blubb.cyconet.org.cfg”.

If you want to autostart your domUs, you have to symlink the configfile to /etc/xen/auto:

playground:~# mkdir /etc/xen/auto/
playground:~# ln -s /etc/xen/xetch.blubb.cyconet.org.cfg /etc/xen/auto/xetch.blubb.cyconet.org.cfg

Creative Commons License
The Taking Xen guests (domU) alive via routed network by Cyconet Blog, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Terms and conditions beyond the scope of this license may be available at blog.waja.info.

0 Responses to “Taking Xen guests (domU) alive via routed network”


  • No Comments

Leave a Reply


Too Cool for Internet Explorer