Skip to content

Commit

Permalink
Use bare container format by default
Browse files Browse the repository at this point in the history
Set container_format to bare during libvirt snapshot, when VM image in
glance was deleted. Currently, if VM image in glance was already deleted
before snapshot, nova will attempt to create snapshot image with
container_format: None. This cause glance to return error on attempt to
upload snapshot. According to glance docs container_format is not used
anywhere in glance or nova explicitly and it is safe to set it to bare,
when you are unsure which container_format you need to use.
Current snapshot logic sets snapshot disk_format to currently used
image_format in absence of base image in glance.

This resolves bug 921774 without need for snapshot mechanism redesign.

Change-Id: I7beea35120aaeac0837daecdf58f38f62e24454c
  • Loading branch information
Boris Filippov authored and openstack-gerrit committed Sep 5, 2012
1 parent 84c62b3 commit 804732d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nova/virt/libvirt/driver.py
Expand Up @@ -784,8 +784,7 @@ def snapshot(self, context, instance, image_href):
else:
metadata['disk_format'] = image_format

if 'container_format' in base:
metadata['container_format'] = base['container_format']
metadata['container_format'] = base.get('container_format', 'bare')

# Find the disk
xml_desc = virt_dom.XMLDesc(0)
Expand Down

0 comments on commit 804732d

Please sign in to comment.