Assumption - You are using hardware RAID configured such that your storage is presented as one large disk /dev/sda (e.g. 2TB)
Step 1 - Install a minimal Debian squeeze system with a 4GB ext3 root partition (/dev/sda1) and 1GB swap (/dev/sda2) using the Debian net installer. Leave the rest of the disk unpartitioned.
Step 2 - Install lvm (logical volume manager) to take care of the disks for your virtual machines:
apt-get install lvm2
Step 3 - Use fdisk to create partition /dev/sda3 to fill the remaining space
fdisk /dev/sda
Afterwards run fdisk -l to check your partitions:
root@xen:~# fdisk -l
Disk /dev/sda: 1999.3 GB, 1999307276288 bytes
255 heads, 63 sectors/track, 243068 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031e29
Device Boot Start End Blocks Id System
/dev/sda1 * 1 973 7811072 83 Linux
/dev/sda2 973 1216 1952768 82 Linux swap / Solaris
/dev/sda3 1216 243068 1942678846 83 Linux
Disk /dev/sda: 1999.3 GB, 1999307276288 bytes
255 heads, 63 sectors/track, 243068 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00031e29
Device Boot Start End Blocks Id System
/dev/sda1 * 1 973 7811072 83 Linux
/dev/sda2 973 1216 1952768 82 Linux swap / Solaris
/dev/sda3 1216 243068 1942678846 83 Linux
Step 4 - Use pvcreate to set up the lvm space
pvcreate /dev/sda3
Step 5 - Use vgcreate to create a volume group on sda3
vgcreate xen-vol /dev/sda3
Afterwards use vgscan to check your volume groups
root@xen:~# vgscan
Reading all physical volumes. This may take a while...
Found volume group "xen-vol" using metadata type lvm2
Reading all physical volumes. This may take a while...
Found volume group "xen-vol" using metadata type lvm2
Step 6 - Install xen hypervisor
apt-get install linux-image-xen-amd64 xen-hypervisor-4.0-amd64 xen-tools
Step 7 - enable network bridging
nano /etc/xen/xend-config.sxp
#add the line
network-script network-bridge
#add the line
network-script network-bridge
Step 8 - Disable saving of domU's when dom0 shuts down
nano /etc/default/xendomains
XENDOMAINS_SAVE=""
XENDOMAINS_RESTORE=false
XENDOMAINS_SAVE=""
XENDOMAINS_RESTORE=false
Step 9 - Make xen the default grub entry, not Debian
mv /etc/grub.d/10_linux /etc/grub.d/50_linux
Step 10 - Add these lines to /etc/default/grub to disable OS probing (otherwise you may get entries for your VMs !!!
nano /etc/default/grub
#Disable OS Probing
GRUB_DISABLE_OS_PROBER=true
#Disable OS Probing
GRUB_DISABLE_OS_PROBER=true
Step 11 - Update grub and reboot
update-grub2
reboot
reboot
Step 12 - Customise the standard VM configuration file for your VMs
nano /etc/xen-tools/xen-tools.conf
lvm=xen-vol
dist=squeeze
disk_device=xvda
serial_device=hvc0
lvm=xen-vol
dist=squeeze
disk_device=xvda
serial_device=hvc0
Step 13 - Now create your squeeze VM using the base configuration with some overrides
xen-create-image --hostname=webserver --size=8Gb --swap=1Gb --ip=192.168.0.181 --memory=2Gb
Step 14 - Start the VM
xm create /etc/xen/webserver.cfg
Step 15 - Connect to the VM
xm console webserver
To disconnect from a running VM:
CTRL ]