23 Dec 2012 mikal   » (Journeyer)

Image handlers (in essex)

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.

Tags for this post: openstack loop nbd libvirt file_injection rackspace
Related posts: Some quick operational notes for users of loop and nbd devices; Moving on


Syndicated 2012-12-22 15:51:00 from stillhq.com : Mikal, a geek from Canberra living in Silicon Valley (no blather posts)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!