Ask Your Question
2

nbd error on CentOS 6

asked 2013-12-19 13:19:33 -0500

mulligan gravatar image

On CentOS 6 installing qemu-nbd is problematic as it is no longer available in the usual repos. Accordingly, booting a new image in OpenStack Havana prduces this error:

2013-12-19 09:38:21.028 1875 ERROR nova.virt.disk.mount.nbd [req-6cb60983-44d8-4162-9e64-506789fa1338 da96a07549e3438f9cfff823eeacba3a ab6c5a4d00cc4566a219258eb3d12d70] nbd module not loaded

Is nbd really necessary? Is there a workaround?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
1

answered 2013-12-20 03:32:36 -0500

updated 2013-12-23 03:50:36 -0500

So libguestfs is the alternative to nbd on centos. It's more secure since images are mounted in a separate VM, and supports image inspection to auto determine the injection partition. It will be used automatically if python-libguestfs is installed (which the RDO packages automatically depend on)

Now injection of items to booting images at startup is optional, with configdrive or cloud_init being alternative methods commonly used. Darragh's noted option above to disable injection should work since Folsom.

Now mounting of images is used for other reasons too, which you might be hitting. When resizing an image, it's mounted readonly to determine if it hasn't partitions and thus can be fully extended. Now using nbd to do that for qcow2 images is an option, but it's disabled by default for mainly performance reasons. So I'd double check that resize_fs_using_block_device=False

The other case for mounting of images is for using LXC containers rather than full virtualization. Since Folsom, LXC is not supported in combination with libguestfs for efficiency reasons discussed at https://review.openstack.org/#/c/16178/ In summary, guestfs requires (a small) VM to access the guest image, which was thought to cancel much of the reason for using LXC in the first place. Therefore to use LXC on systems without nbd support you would need to boot from _unpartitioned_ raw format images. If your guests images are partitioned that would need to be changed first and the new image imported. To ensure the raw format it used you could set use_cow_images=False. For details on this setting see http://www.pixelbeat.org/docs/openstack_libvirt_images/

edit flag offensive delete link more

Comments

Actually I am using LXC and I'm sorry if that made this confusing. I can confirm resize_fs_using_block_device is False.

mulligan gravatar imagemulligan ( 2013-12-20 11:26:46 -0500 )edit

I've rolled an unpartitioned, raw CentOS 6.5 image for this purpose and implemented the settings you suggested. However, OpenStack continues to try and fail to mount images during creation: Failed to mount container filesystem '<nova.virt.disk.api._diskimage object="" at="" 0x355f590="">'...

mulligan gravatar imagemulligan ( 2013-12-23 18:28:31 -0500 )edit

Well it still needs to mount the image. The above should be using the loopback driver as long as use_cow_images=False. Are there specific error messages generated?

pixelbeat gravatar imagepixelbeat ( 2013-12-27 10:24:53 -0500 )edit
0

answered 2013-12-19 13:39:27 -0500

darragh-oreilly gravatar image

Try this in nova.conf on the compute node:

libvirt_inject_partition = -2
edit flag offensive delete link more

Comments

I did. That did not help. The attempt to use libguestfs to inject data is now passed but the attempt with nbd still errors.

mulligan gravatar imagemulligan ( 2013-12-19 13:51:53 -0500 )edit
0

answered 2013-12-20 01:27:20 -0500

Nuriel gravatar image

Hi, I was hitting the same error and eventually it turned out to be the image being improper, so I am guessing you might be hitting the same problem. I even went as far as enabling nbd in the kernel to no avail. Can you describe what type of image you are using, how did you create it and how did you import it into glance?

edit flag offensive delete link more

Comments

I'm using the CirrOS image suggested by the OpenStack setup docs: http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img

mulligan gravatar imagemulligan ( 2013-12-20 11:28:21 -0500 )edit

To my knowledge this image is not optimized to work with a container. What I have done is create a centos rootfs, make an image out of it and import into glance. Try to follow the instructions on the links provided in this answer: https://ask.openstack.org/en/question/8769/what-images-to-use-to-launch-instances-using-lxc-with-openstack/

Nuriel gravatar imageNuriel ( 2013-12-21 04:23:49 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-12-19 13:19:33 -0500

Seen: 3,063 times

Last updated: Dec 23 '13