summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2011-03-04 11:19:35 -0600
committerCerberus <matt.dietz@rackspace.com>2011-03-04 11:19:35 -0600
commit1d8914fc752f7182f942cdd40f2ba18baedeed0c (patch)
tree7d3c8897d8b14918fc35c990bfeb19ada08cd926 /nova/virt
parent0e1a458166ad1e89ca0755d88b8efec39855ee5c (diff)
downloadnova-1d8914fc752f7182f942cdd40f2ba18baedeed0c.tar.gz
nova-1d8914fc752f7182f942cdd40f2ba18baedeed0c.tar.xz
nova-1d8914fc752f7182f942cdd40f2ba18baedeed0c.zip
More fixes
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/vm_utils.py16
-rw-r--r--nova/virt/xenapi/vmops.py11
2 files changed, 14 insertions, 13 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index ca2d634f1..eff207a51 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -270,8 +270,8 @@ class VMHelper(HelperBase):
@classmethod
def create_snapshot(cls, session, instance_id, vm_ref, label):
- """ Creates Snapshot (Template) VM, Snapshot VBD, Snapshot VDI,
- Snapshot VHD """
+ """Creates Snapshot (Template) VM, Snapshot VBD, Snapshot VDI,
+ Snapshot VHD"""
#TODO(sirp): Add quiesce and VSS locking support when Windows support
# is added
LOG.debug(_("Snapshotting VM %(vm_ref)s with label '%(label)s'...")
@@ -284,7 +284,7 @@ class VMHelper(HelperBase):
original_parent_uuid = get_vhd_parent_uuid(session, vm_vdi_ref)
task = session.call_xenapi('Async.VM.snapshot', vm_ref, label)
- template_vm_ref = session.wait_for_task(instance_id, task)
+ template_vm_ref = session.wait_for_task(task, instance_id)
template_vdi_rec = cls.get_vdi_for_vm_safely(session,
template_vm_ref)[1]
template_vdi_uuid = template_vdi_rec["uuid"]
@@ -302,14 +302,14 @@ class VMHelper(HelperBase):
@classmethod
def get_sr(cls, session, sr_label='slices'):
- """ Finds the SR named by the given name label and returns
- the UUID """
+ """Finds the SR named by the given name label and returns
+ the UUID"""
return session.call_xenapi('SR.get_by_name_label', sr_label)[0]
@classmethod
def get_sr_path(cls, session, sr_label='slices'):
- """ Finds the SR and then coerces it into a path on the dom0 file
- system """
+ """Finds the SR and then coerces it into a path on the dom0 file
+ system"""
return FLAGS.xenapi_sr_base_path + cls.get_sr(session, sr_label)
@classmethod
@@ -643,7 +643,7 @@ class VMHelper(HelperBase):
if sr_ref:
LOG.debug(_("Re-scanning SR %s"), sr_ref)
task = session.call_xenapi('Async.SR.scan', sr_ref)
- session.wait_for_task(instance_id, task)
+ session.wait_for_task(task, instance_id)
@classmethod
def scan_default_sr(cls, session):
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 60ce51f4a..01bfa2dc5 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -233,7 +233,7 @@ class VMOps(object):
"start")
def snapshot(self, instance, image_id):
- """ Create snapshot from a running VM instance
+ """Create snapshot from a running VM instance
:param instance: instance to be snapshotted
:param image_id: id of image to upload to
@@ -285,7 +285,7 @@ class VMOps(object):
return
def migrate_disk_and_power_off(self, instance, dest):
- """ Copies a VHD from one host machine to another
+ """Copies a VHD from one host machine to another
:param instance: the instance that owns the VHD in question
:param dest: the destination host machine
@@ -314,7 +314,7 @@ class VMOps(object):
task = self._session.async_call_plugin('migration', 'transfer_vhd',
{'params': pickle.dumps(params)})
- self._session.wait_for_task(instance.id, task)
+ self._session.wait_for_task(task, instance.id)
# Now power down the instance and transfer the COW VHD
self._shutdown(instance, vm_ref, method='clean')
@@ -326,7 +326,7 @@ class VMOps(object):
task = self._session.async_call_plugin('migration', 'transfer_vhd',
{'params': pickle.dumps(params)})
- self._session.wait_for_task(instance.id, task)
+ self._session.wait_for_task(task, instance.id)
finally:
if template_vm_ref:
@@ -338,6 +338,7 @@ class VMOps(object):
return {'base_copy': base_copy_uuid, 'cow': cow_uuid}
def attach_disk(self, instance, disk_info):
+ """Links the base copy VHD to the COW via the XAPI plugin"""
vm_ref = VMHelper.lookup(self._session, instance.name)
new_base_copy_uuid = str(uuid.uuid4())
new_cow_uuid = str(uuid.uuid4())
@@ -350,7 +351,7 @@ class VMOps(object):
task = self._session.async_call_plugin('migration',
'move_vhds_into_sr', {'params': pickle.dumps(params)})
- self._session.wait_for_task(instance.id, task)
+ self._session.wait_for_task(task, instance.id)
# Now we rescan the SR so we find the VHDs
VMHelper.scan_default_sr(self._session)