Archive for the ‘Xen’ Category.

sEDF CPU Scheduler in Xen

By default the Xen Hypervisor uses the credit CPU scheduler. The sEDF (simple earliest deadline first) CPU scheduler can be used by setting the sched boot parameter equal to sedf. The easiest way to do this is by editing the grub boot loader config file, menu.lst. The file is located in /boot/grub/menu.lst. The file must be edited by a root user (this can be done in Ubuntu by using the sudo command). This is demonstrated in the entry below. I just copied the existing Xen boot entry and added this one with the sched parameter so I could choose between schedulers at boot time.

title    Xen 3.3 / Ubuntu 8.04.3 LTS, kernel 2.6.24-26-xen sEDF SCHEDULER
root     (hd1,0)
kernel   /boot/xen-3.3.gz sched=sedf
module   /boot/vmlinuz-2.6.24-26-xen root=UUID=e8c13945-5158 console=tty0
module   /boot/initrd.img-2.6.24-26-xen
quiet

Xen Cannot Run More Than 4 VMs

I have been setting up a test Xen 3.3 box running on Ubuntu 8.04. I have been getting the following error: “Device xxxx (vbd) cannot be connected. failed to find an unused loop device”  where xxxx is some number. It turns out that by default only 8 loopback devices are enabled. The following command shows how many loopback devices are enabled:

ls -l /dev/loop*

To increase the number of loopback devices the following line needs to be added to the /etc/modules file. I used a value of 64 so I can run up to 32 virtual machines.

add loop max_loop=64
Now when you run ls -l /dev/loop* you will see additional loopback devices.

root@xen-server:~# ls -l /dev/loop*
brw-rw—- 1 root disk 7,  0 2009-07-09 03:43 /dev/loop0
brw-rw—- 1 root disk 7,  1 2010-02-02 15:22 /dev/loop1
brw-rw—- 1 root disk 7, 10 2010-02-02 15:22 /dev/loop10
brw-rw—- 1 root disk 7, 11 2010-02-02 15:22 /dev/loop11
brw-rw—- 1 root disk 7, 12 2010-02-02 15:22 /dev/loop12
brw-rw—- 1 root disk 7, 13 2010-02-02 15:22 /dev/loop13
brw-rw—- 1 root disk 7, 14 2010-02-02 15:22 /dev/loop14
brw-rw—- 1 root disk 7, 15 2010-02-02 15:22 /dev/loop15
brw-rw—- 1 root disk 7, 16 2010-02-02 15:22 /dev/loop16
brw-rw—- 1 root disk 7, 17 2010-02-02 15:22 /dev/loop17
brw-rw—- 1 root disk 7, 18 2010-02-02 15:22 /dev/loop18
brw-rw—- 1 root disk 7, 19 2010-02-02 15:22 /dev/loop19
brw-rw—- 1 root disk 7,  2 2010-02-02 15:22 /dev/loop2
brw-rw—- 1 root disk 7, 20 2010-02-02 15:22 /dev/loop20