Merge lp:~termie/nova/fix_snapshot into lp:~hudson-openstack/nova/trunk

Proposed by termie
Status: Merged
Approved by: Jesse Andrews
Approved revision: 995
Merged at revision: 995
Proposed branch: lp:~termie/nova/fix_snapshot
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 45 lines (+12/-8)
1 file modified
nova/virt/libvirt_conn.py (+12/-8)
To merge this branch: bzr merge lp:~termie/nova/fix_snapshot
Reviewer Review Type Date Requested Status
Jesse Andrews (community) Approve
Vish Ishaya (community) Approve
Brian Lamar (community) Approve
Review via email: mp+57735@code.launchpad.net

Description of the change

The change to utils.execute's call style missed this call somehow, this should get libvirt snapshots working again.

To post a comment you must log in.
lp:~termie/nova/fix_snapshot updated
989. By Thierry Carrez

Final versioning for Cactus

990. By Thierry Carrez

Diablo versioning.

991. By Josh Kearney

Only poll for instance states that compute should care about.

992. By Josh Kearney

Removed the unused self.interfaces_xml variable.

Revision history for this message
Brian Lamar (blamar) wrote :
review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

looks like there is one other error with snapshotting. The name field shouldn't be in the properties dict, but move up one level into the main metadata dict.

review: Needs Fixing
lp:~termie/nova/fix_snapshot updated
993. By Brian Lamar

Add additional logging for WSGI and OpenStack API authentication.

994. By termie

change libvirt snapshot to new style execute

995. By termie

move name into main metadata instead of properties

Revision history for this message
termie (termie) wrote :

upgedated

Revision history for this message
Vish Ishaya (vishvananda) wrote :

Awesome. Lgtm

review: Approve
Revision history for this message
Jesse Andrews (anotherjesse) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/virt/libvirt_conn.py'
2--- nova/virt/libvirt_conn.py 2011-04-15 15:58:28 +0000
3+++ nova/virt/libvirt_conn.py 2011-04-17 03:27:27 +0000
4@@ -58,7 +58,6 @@
5 from nova import exception
6 from nova import flags
7 from nova import log as logging
8-#from nova import test
9 from nova import utils
10 from nova import vnc
11 from nova.auth import manager
12@@ -471,8 +470,8 @@
13 metadata = {'disk_format': base['disk_format'],
14 'container_format': base['container_format'],
15 'is_public': False,
16+ 'name': '%s.%s' % (base['name'], image_id),
17 'properties': {'architecture': base['architecture'],
18- 'name': '%s.%s' % (base['name'], image_id),
19 'kernel_id': instance['kernel_id'],
20 'image_location': 'snapshot',
21 'image_state': 'available',
22@@ -499,12 +498,17 @@
23 # Export the snapshot to a raw image
24 temp_dir = tempfile.mkdtemp()
25 out_path = os.path.join(temp_dir, snapshot_name)
26- qemu_img_cmd = '%s convert -f qcow2 -O raw -s %s %s %s' % (
27- FLAGS.qemu_img,
28- snapshot_name,
29- disk_path,
30- out_path)
31- utils.execute(qemu_img_cmd)
32+ qemu_img_cmd = (FLAGS.qemu_img,
33+ 'convert',
34+ '-f',
35+ 'qcow2',
36+ '-O',
37+ 'raw',
38+ '-s',
39+ snapshot_name,
40+ disk_path,
41+ out_path)
42+ utils.execute(*qemu_img_cmd)
43
44 # Upload that image to the image service
45 with open(out_path) as image_file: