[vdsm] Test failure not free loop devices

Mark Wu wudxw at linux.vnet.ibm.com
Mon Aug 12 00:52:33 UTC 2013


On Fri 09 Aug 2013 09:45:02 PM CST, David Caro Estevez wrote:
> Sometimes we get this error when running the vdsm tests:
>
> ======================================================================
> ERROR: testLoopMount (mountTests.MountTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>    File "/ephemeral0/vdsm_unit_tests_gerrit_el/tests/mountTests.py", line 69, in testLoopMount
>      m.mount(mntOpts="loop")
>    File "/ephemeral0/vdsm_unit_tests_gerrit_el/vdsm/storage/mount.py", line 222, in mount
>      return self._runcmd(cmd, timeout)
>    File "/ephemeral0/vdsm_unit_tests_gerrit_el/vdsm/storage/mount.py", line 238, in _runcmd
>      raise MountError(rc, ";".join((out, err)))
> MountError: (2, ';mount: could not find any free loop device\n')
> -------------------- >> begin captured logging << --------------------
> Storage.Misc.excCmd: DEBUG: '/sbin/mkfs.ext2 -F /tmp/tmpq95svr' (cwd None)
> Storage.Misc.excCmd: DEBUG: SUCCESS: <err> = 'mke2fs 1.41.12 (17-May-2010)\n'; <rc> = 0
> Storage.Misc.excCmd: DEBUG: '/usr/bin/sudo -n /bin/mount -o loop /tmp/tmpq95svr /tmp/tmpcS29EU' (cwd None)
>
> The problem is that it seems that the loop devices that are not being released (maybe when the test fails?) and the system runs out of devices eventually.
> Can you take a look to see where the cleanup fails and fix it?

It seems the system run out of loop devices.  You could use 'losetup 
-l'  to check the usages of the loop devices. If there's some leaks,  
you could use losetup to fix it manually.  Otherwise,  that means you 
need increase the number of loop devices. How to do that depends on 
your distro:

On latest fedora,  loop module is kernel built-in,  so you have to 
change the boot kernel parameter: append to the end of each linux line 
in /boot/grub2/grub.cfg:
max_loop=64

For distros which loop modules is loaded as a separate module:
enter following line in /etc/modprobe.conf
options loop max_loop=64

Hope it helps.

>
> Thanks!
>
> pd. To free a loop device you have to umount it and then losetup -d <loopdevice>, that way the device gets liberated. Also it might be a good solution to create a specific device per test, that way it will never run out of them no matter how many tests run in parallel, but that requires a little more modifications.
>
> ----
> David Caro
>
> Red Hat Czech s.r.o.
> Continuous Integration Engineer - EMEA ENG Virtualization R&D
>
> Tel.: +420 532 294 605
> Email: dcaro at redhat.com
> Web: www.cz.redhat.com
> Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno, Czech Republic
> RHT Global #: 82-62605
>
>
> _______________________________________________
> vdsm-devel mailing list
> vdsm-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel




More information about the vdsm-devel mailing list