Image handlers (in essex)

Share

George asks in the comments on my previous post about loop and nbd devices an interesting question about the behavior of this code on essex. I figured the question was worth bringing out into its own post so that its more visible. I’ve edited George’s question lightly so that this blog post flows reasonably.

Can you please explain the order (and conditions) in which the three methods are used? In my Essex installation, the “img_handlers” is not defined in nova.conf, so it takes the default value “loop,nbd,guestfs”. However, nova is using nbd as the chose method.

The handlers will be used in the order specified — with the caveat that loop doesn’t support Copy On Write (COW) images and will therefore be skipped if the libvirt driver is trying to create a COW image. Whether COW images are used is configured with the use_cow_images flag, which defaults to True. So, loop is being skipped because you’re probably using COW images.

My ssh keys are obtained by cloud-init, and still whenever I start a new instance I see in the nova-compute.logs this sequence of events:

qemu-nbd -c /dev/nbd15 /var/lib/nova/instances/instance-0000076d/disk
kpartx -a /dev/nbd15
mount /dev/mapper/nbd15p1 /tmp/tmpxGBdT0
umount /dev/mapper/nbd15p1
kpartx -d /dev/nbd15
qemu-nbd -d /dev/nbd15

I don’t understand why the mount of the first partition is necessary and what it happens when the partition is mounted.

This is a bit harder than the first bit of the question. What I think is happening is that there are files being injected, and that’s causing the mount. Just because the admin password isn’t being inject doesn’t mean that other things aren’t being injected still. You’d be able to tell what’s happening by grepping your logs for “Injecting .* into image” and seeing what shows up.

Share

Some quick operational notes for users of loop and nbd devices

Share

A quick note for OpenStack operators — if you are using loop or nbd devices to mount disk images in nova-compute, then you would be well served to have plenty of device files hanging around to reduce contention. For loop devices, that seems as simple as making more of them with MAKEDEV. With nbd, you’ll also need to increase the value of the max_nbd_devices flag to nova-compute. The latter is improved in grizzly, where we will autodetect nbd devices.

Share

Starquake

Share

The sequel to the very excellent Dragon’s Egg, this book covers the continued interaction between the humans and the super cute Cheela. Unfortunately for the Cheela they suffer a major natural disaster which destroys society. I love an author who is willing to kill of characters when it progresses the story, and there is lots of that happening in this book. Really enjoyable.

[isbn: 0345312333]

Share

Moving on

Share

Thursday this week is my last day at Canonical. After a little over a year at Canonical, I’m moving on to the private cloud team at Rackspace — my first day with Rackspace will be the 17th of December. I’m very excited to be joining Rackspace — I’m excited by the project, the team, and the opportunity to make OpenStack even better. We’ve also talked about some interesting stuff we’d like to do in the Australian OpenStack community, but I’m going to hold off on talking about that until I’ve had a chance to settle in.

I am appreciative of my time at Canonical — when I joined I was unaware of the existence of OpenStack, and without Canonical I might never have found this awesome project that I love. I also had the chance to work with some really smart people who taught me a lot. This move is about spending more time on OpenStack than Canonical was able to allow.

Share