+ %TITLE%
<toc>
+ Xen Server dom0
You should create a partition a bit larger than the amount of ram allocated to domU guests. If you shutdown the dom0, the domU guests are saved state to '/var/lib/xen/save'
<code> lvcreate --size 4.1g --name xen vg01 mkdir /var/lib/xen </code>
And add to /etc/fstab
<code> /dev/mapper/vg01-xen /var/lib/xen reiserfs noatime 0 2 </code>
and mount
<code> mount /var/lib/xen </code>
|
+ %TITLE%
<toc>
+ Xen Server dom0
You should create a partition a bit larger than the amount of ram allocated to domU guests. If you shutdown the dom0, the domU guests are saved state to '/var/lib/xen/save'
<code> lvcreate --size 4.1g --name xen vg01 mkdir /var/lib/xen </code>
And add to /etc/fstab
<code> /dev/mapper/vg01-xen /var/lib/xen reiserfs noatime 0 2 </code>
and mount
<code> mount /var/lib/xen </code>
|
Below 'vm01' is the hostname of my VirtualMachine
<code> lvcreate --size 600M -i 2 --name vm01-slash vg01 lvcreate --size 2G -i 2 --name vm01-swap vg01 lvcreate --size 10G -i 2 --name vm01-usr vg01 lvcreate --size 4G -i 2 --name vm01-var vg01
mkfs.ext3 /dev/vg01/vm01-slash mkswap /dev/vg01/vm01-swap mkfs.reiserfs /dev/vg01/vm01-usr mkfs.reiserfs /dev/vg01/vm01-var
mount /dev/vg01/vm01-slash /mnt/ mkdir /mnt/usr /mnt/var mount /dev/vg01/vm01-usr /mnt/usr/ mount /dev/vg01/vm01-var /mnt/var/
debootstrap --arch amd64 --include=reiserfsprogs,linux-image-2.6-xen-amd64,ssh lenny /mnt
cd /mnt cp /etc/hosts etc/ sed -i 's/xen01/vm01/g' etc/hosts echo vm01 > etc/hostname cp /etc/apt/sources.list /etc/apt/preferences etc/apt/ </code>
*etc/network/interfaces*:
<code> # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).
# The loopback network interface auto lo iface lo inet loopback
# The primary network interface auto eth0 iface eth0 inet static address 1.2.3.4 netmask 255.255.255.0 gateway 1.2.3.1 </code>
*etc/fstab*:
<code> # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/sda1 / ext3 defaults,errors=remount-ro 0 1 /dev/sda3 /usr reiserfs defaults 0 2 /dev/sda4 /var reiserfs noatime 0 2 /dev/sda2 none swap sw 0 0 /dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0 </code>
*boot/grub/menu.lst*:
<code> title Debian GNU/Linux, kernel 2.6.26-2-xen-amd64 root (hd0,0) kernel /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 xencons=tty ro initrd /boot/initrd.img-2.6.26-2-xen-amd64
title Debian GNU/Linux, kernel 2.6.26-2-xen-amd64 (single-user mode) root (hd0,0) kernel /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 xencons=tty ro single initrd /boot/initrd.img-2.6.26-2-xen-amd64 </code>
*/etc/xen/vm01.cfg*:
<code> # Debian 5.0 memory = 1024 name = "vm01" bootloader = "/usr/lib/xen-3.2-1/bin/pygrub" disk = [ 'phy:vg01/vm01-slash,sda1,w', 'phy:vg01/vm01-swap,sda2,w', 'phy:vg01/vm01-usr,sda3,w', 'phy:vg01/vm01-var,sda4,w' ] # Default bridged network interface vif = [ 'bridge=xenbr0' ] vcpus = 2 # Single-user mode #extra = "1" </code>
<code> umount /mnt/usr /mnt/var /mnt cd /etc/xen/auto ln -s ../vm01.cfg . xm create -c vm01.cfg </code>
After boot you need to:
# Set a root password, create local user accounts # *dpkg-reconfigure tzdata* # *dpkg-reconfigure exim4-config*
|
Below 'vm01' is the hostname of my VirtualMachine
<code> lvcreate --size 600M -i 2 --name vm01-slash vg01 lvcreate --size 2G -i 2 --name vm01-swap vg01 lvcreate --size 10G -i 2 --name vm01-usr vg01 lvcreate --size 4G -i 2 --name vm01-var vg01
mkfs.ext3 /dev/vg01/vm01-slash mkswap /dev/vg01/vm01-swap mkfs.reiserfs /dev/vg01/vm01-usr mkfs.reiserfs /dev/vg01/vm01-var
mount /dev/vg01/vm01-slash /mnt/ mkdir /mnt/usr /mnt/var mount /dev/vg01/vm01-usr /mnt/usr/ mount /dev/vg01/vm01-var /mnt/var/
debootstrap --arch amd64 --include=reiserfsprogs,linux-image-2.6-xen-amd64,ssh lenny /mnt
cd /mnt cp /etc/hosts etc/ sed -i 's/xen01/vm01/g' etc/hosts echo vm01 > etc/hostname cp /etc/apt/sources.list /etc/apt/preferences etc/apt/ </code>
*etc/network/interfaces*:
<code> # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).
# The loopback network interface auto lo iface lo inet loopback
# The primary network interface auto eth0 iface eth0 inet static address 1.2.3.4 netmask 255.255.255.0 gateway 1.2.3.1 </code>
*etc/fstab*:
<code> # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/sda1 / ext3 defaults,errors=remount-ro 0 1 /dev/sda3 /usr reiserfs defaults 0 2 /dev/sda4 /var reiserfs noatime 0 2 /dev/sda2 none swap sw 0 0 /dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0 </code>
*boot/grub/menu.lst*:
<code> title Debian GNU/Linux, kernel 2.6.26-2-xen-amd64 root (hd0,0) kernel /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 xencons=tty ro initrd /boot/initrd.img-2.6.26-2-xen-amd64
title Debian GNU/Linux, kernel 2.6.26-2-xen-amd64 (single-user mode) root (hd0,0) kernel /boot/vmlinuz-2.6.26-2-xen-amd64 root=/dev/sda1 xencons=tty ro single initrd /boot/initrd.img-2.6.26-2-xen-amd64 </code>
*/etc/xen/vm01.cfg*:
<code> # Debian 5.0 memory = 1024 name = "vm01" bootloader = "/usr/lib/xen-3.2-1/bin/pygrub" disk = [ 'phy:vg01/vm01-slash,sda1,w', 'phy:vg01/vm01-swap,sda2,w', 'phy:vg01/vm01-usr,sda3,w', 'phy:vg01/vm01-var,sda4,w' ] # Default bridged network interface vif = [ 'bridge=xenbr0' ] vcpus = 2 # Single-user mode #extra = "1" </code>
<code> umount /mnt/usr /mnt/var /mnt cd /etc/xen/auto ln -s ../vm01.cfg . xm create -c vm01.cfg </code>
After boot you need to:
# Set a root password, create local user accounts # *dpkg-reconfigure tzdata* # *dpkg-reconfigure exim4-config*
|