My, "this works but probably isn't even 100% right for LVM and DEFINITELY isn't right for non-lvm cases" patch:
--- a/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py +++ b/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py @@ -821,29 +821,7 @@ class LibvirtDriver(driver.ComputeDriver): xml_desc = virt_dom.XMLDesc(0) domain = etree.fromstring(xml_desc) source = domain.find('devices/disk/source') - disk_path = source.get('dev') - - LOG.debug("creating snapshot") - out, err = utils.execute('lvcreate', - '-s',disk_path, - '-L','10G', - '-n',"_snap_%s"%snapshot_name, - run_as_root=True) - snap_file = '/dev/%s/_snap_%s' % (FLAGS.libvirt_images_volume_group,snapshot_name) - LOG.debug("temporary_chown(%s) to %s" % (snap_file,os.getuid())) - with utils.temporary_chown(snap_file): - snap_h=open(snap_file,"r") - LOG.debug("sending snapshot image to image service") - image_service.update(context, - image_href, - metadata, - snap_h) - snap_h.close() - out, err = utils.execute('lvremove', - '-f',snap_file, - run_as_root=True) - - return None + disk_path = source.get('file')
(state, _max_mem, _mem, _cpus, _t) = virt_dom.info() state = LIBVIRT_POWER_STATE[state]
My, "this works but probably isn't even 100% right for LVM and DEFINITELY isn't right for non-lvm cases" patch:
--- a/usr/lib/ python2. 7/dist- packages/ nova/virt/ libvirt/ driver. py python2. 7/dist- packages/ nova/virt/ libvirt/ driver. py driver. ComputeDriver) : g(xml_desc) find('devices/ disk/source' ) 'lvcreate' , snap_%s" %snapshot_ name, libvirt_ images_ volume_ group,snapshot_ name) "temporary_ chown(% s) to %s" % (snap_file, os.getuid( ))) _chown( snap_file) : open(snap_ file,"r" ) update( context, 'lvremove' ,
+++ b/usr/lib/
@@ -821,29 +821,7 @@ class LibvirtDriver(
xml_desc = virt_dom.XMLDesc(0)
domain = etree.fromstrin
source = domain.
- disk_path = source.get('dev')
-
- LOG.debug("creating snapshot")
- out, err = utils.execute(
- '-s',disk_path,
- '-L','10G',
- '-n',"_
- run_as_root=True)
- snap_file = '/dev/%s/_snap_%s' % (FLAGS.
- LOG.debug(
- with utils.temporary
- snap_h=
- LOG.debug("sending snapshot image to image service")
- image_service.
- image_href,
- metadata,
- snap_h)
- snap_h.close()
- out, err = utils.execute(
- '-f',snap_file,
- run_as_root=True)
-
- return None
+ disk_path = source.get('file')
(state, _max_mem, _mem, _cpus, _t) = virt_dom.info() POWER_STATE[ state]
state = LIBVIRT_