summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCerberus <matt.dietz@rackspace.com>2011-02-10 13:42:57 -0600
committerCerberus <matt.dietz@rackspace.com>2011-02-10 13:42:57 -0600
commitd8a7a76cd4fd22a6ad9fc1a7b879a8dbffcede5f (patch)
treec8c13c9d3291f2f531f946e8718b3ae0f4116a82
parent5ed3abd0c689517db7a76e19c5b44fa4cc5d811f (diff)
downloadnova-d8a7a76cd4fd22a6ad9fc1a7b879a8dbffcede5f.tar.gz
nova-d8a7a76cd4fd22a6ad9fc1a7b879a8dbffcede5f.tar.xz
nova-d8a7a76cd4fd22a6ad9fc1a7b879a8dbffcede5f.zip
Some more cleanup
-rw-r--r--nova/compute/manager.py7
-rw-r--r--nova/virt/xenapi/vmops.py3
-rw-r--r--nova/virt/xenapi_conn.py5
-rw-r--r--plugins/xenserver/xenapi/etc/xapi.d/plugins/migration3
4 files changed, 9 insertions, 9 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index ac09f7c8c..54c3412f4 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -429,7 +429,8 @@ class ComputeManager(manager.Manager):
self.db.migration_update(context, migration_id,
{ 'status': 'post-migrating', })
- # This is where we would update the VM record after resizing
+ #TODO(mdietz): This is where we would update the VM record
+ #after resizing
service = self.db.service_get_by_host_and_topic(context,
migration_ref['dest_host'], FLAGS.compute_topic)
@@ -449,8 +450,8 @@ class ComputeManager(manager.Manager):
migration_ref['instance_id'])
# this may get passed into the following spawn instead
- self.driver.attach_disk(context, instance_ref)
- self.driver.spawn(context, instance_ref, preexisting=True)
+ disk_info = self.driver.attach_disk(context, instance_ref)
+ self.driver.spawn(context, instance_ref, disk_info=disk_info)
self.db.migration_update(context, migration_id,
{'status': 'finished', })
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index ea4b7899b..7d88876e4 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -106,7 +106,8 @@ class VMOps(object):
instance.ramdisk_id, user, project, ImageType.KERNEL_RAMDISK)
vm_ref = VMHelper.create_vm(self._session,
instance, kernel, ramdisk, pv_kernel)
- VMHelper.create_vbd(self._session, vm_ref, vdi_ref, 0, True)
+ VMHelper.create_vbd(session=self._session, vm_ref=vm_ref, vdi_ref=vdi_ref,
+ userdevice=0, bootable=True)
if network_ref:
VMHelper.create_vif(self._session, vm_ref,
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index cc43050b4..8c756a7e3 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -152,7 +152,7 @@ class XenAPIConnection(object):
"""List VM instances"""
return self._vmops.list_instances()
- def spawn(self, instance):
+ def spawn(self, instance, disk_info=None):
"""Create VM instance"""
self._vmops.spawn(instance)
@@ -164,9 +164,6 @@ class XenAPIConnection(object):
"""Resize a VM instance"""
raise NotImplementedError()
- def attach_disk(self, instance_ref):
-
-
def reboot(self, instance):
"""Reboot VM instance"""
self._vmops.reboot(instance)
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
index e81b18a5e..0fb7b5806 100644
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/migration
@@ -70,6 +70,7 @@ def move_vhds_into_sr(session, args):
instance_id = params['instance_id']
sr_path = get_sr_path(session)
+ sr_temp_path = "%s/images/" % sr_path
# Discover the copied VHDs locally, and then set up paths to copy
# them to under the SR
@@ -77,7 +78,7 @@ def move_vhds_into_sr(session, args):
source_base_copy_path = "%s/base_copy.vhd" % source_image_path
source_cow_path = "%s/cow.vhd" % source_image_path
- temp_vhd_path = "%s/instance%d/" % (sr_path, instance_id)
+ temp_vhd_path = "%s/instance%d/" % (sr_temp_path, instance_id)
new_base_copy_path = "%s/%s.vhd" % (temp_vhd_path, str(uuid.uuid4()))
new_cow_path = "%s/%s.vhd" % (temp_vhd_path, str(uuid.uuid4()))