Xen dom0 not enough free loop devices starting a new domU

The Xen® hypervisor, the powerful open source industry standard for virtualization, offers a powerful, efficient, and secure feature set for virtualization of x86, x86_64, IA64, ARM, and other CPU architectures.

Xen dom0 not enough free loop devices starting a new domU

Postby lik » Tue Jan 18, 2011 11:46 am

Xen dom0 not enough free loop devices when trying to start a new domU or when trying to "mount -o loop" from the cmdline

Linux "loop" module has max 8 loop devices (/dev/loop*) as a default. Every Xen "file:" backed domU disk uses one loop device in dom0, and if you do "mount -o loop disk.img /mnt" in dom0 that uses a loop device aswell.

You can check all the loop devices in use by running
Code: Select all
losetup -a

You can detach a loop device (free it) by running
Code: Select all
losetup -d /dev/loopX

when it's not mounted or otherwise in use.

You can increase the amount of available loop devices by loading the linux "loop" module with an option "max_loop=X", for example
Code: Select all
modprobe loop max_loop=128

You can add "max_loop=X" option to /etc/modprobe.conf, /etc/modules (or whatever cfgfile your dom0 distribution uses for module options) to make it boot time default.
To set the amount of loop devices during the kernel load one can specify the following kernel option max_loop=128:
Code: Select all
...
...
module /boot/vmlinuz-2.6.18-194.3.1.el5xen ro max_loop=128 root=LABEL=/
...
...


You can also use Xen "phy:" backed LVM volumes instead of disk images. "phy:" doesn't require loop devices.
Such an error message may also be indicative of other issues (such as the guest crashing and restarting so quickly that xend does not have time to free the older loopback device).
lik
Founder
Founder
 
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

Return to Xen related

 


  • Related topics
    Replies
    Views
    Last post
cron