summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorCory Wright <cory.wright@rackspace.com>2011-03-04 17:48:28 +0000
committerCory Wright <cory.wright@rackspace.com>2011-03-04 17:48:28 +0000
commit68d894be2ec3b4eaa14dc5c90143f45f7db1e4b8 (patch)
treedb72e2cde9511e9c93b15543e44945feeb014730 /nova/virt
parent6321c5047c082bba8edf10a660fdb6a56430cc44 (diff)
* Tests to verify correct vm-params for Windows and Linux instances
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/xenapi/vm_utils.py14
-rw-r--r--nova/virt/xenapi/vmops.py8
2 files changed, 11 insertions, 11 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 9c0bb5579..a26e391df 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -80,7 +80,8 @@ class VMHelper(HelperBase):
"""
@classmethod
- def create_vm(cls, session, instance, kernel, ramdisk, use_pv_kernel=False):
+ def create_vm(cls, session, instance, kernel, ramdisk,
+ use_pv_kernel=False):
"""Create a VM record. Returns a Deferred that gives the new
VM reference.
the use_pv_kernel flag indicates whether the guest is HVM or PV
@@ -319,7 +320,7 @@ class VMHelper(HelperBase):
'glance_host': FLAGS.glance_host,
'glance_port': FLAGS.glance_port,
'sr_path': get_sr_path(session),
- 'os_type': instance.get('os_type', 'linux')}
+ 'os_type': instance.os_type}
kwargs = {'params': pickle.dumps(params)}
task = session.async_call_plugin('glance', 'upload_vhd', kwargs)
@@ -524,7 +525,7 @@ class VMHelper(HelperBase):
Determine whether the VM will use a paravirtualized kernel or if it
will use hardware virtualization.
- 1. Objectstore (any image type):
+ 1. Objectstore (any image type):
We use plugin to figure out whether the VDI uses PV
2. Glance (VHD): then we use `os_type`, raise if not set
@@ -540,7 +541,8 @@ class VMHelper(HelperBase):
session, vdi_ref, disk_image_type, os_type)
else:
# 1. Objecstore
- return cls._determine_is_pv_objectstore(session, instance_id, vdi_ref)
+ return cls._determine_is_pv_objectstore(session, instance_id,
+ vdi_ref)
@classmethod
def _determine_is_pv_objectstore(cls, session, instance_id, vdi_ref):
@@ -564,7 +566,7 @@ class VMHelper(HelperBase):
"""
For a Glance image, determine if we need paravirtualization.
- The relevant scenarios are:
+ The relevant scenarios are:
2. Glance (VHD): then we use `os_type`, raise if not set
3. Glance (DISK_RAW): use Pygrub to figure out if pv kernel is
@@ -582,7 +584,7 @@ class VMHelper(HelperBase):
is_pv = True
elif disk_image_type == ImageType.DISK_RAW:
# 3. RAW
- is_pv = with_vdi_attached_here(session, vdi_ref, True, _is_vdi_pv)
+ is_pv = with_vdi_attached_here(session, vdi_ref, True, _is_vdi_pv)
elif disk_image_type == ImageType.DISK:
# 4. Disk
is_pv = True
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 1edf39c5b..eedb07a50 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -87,8 +87,6 @@ class VMOps(object):
vdi_ref = self._session.call_xenapi('VDI.get_by_uuid', vdi_uuid)
- os_type = instance.get('os_type', 'linux')
-
kernel = None
if instance.kernel_id:
kernel = VMHelper.fetch_image(self._session, instance.id,
@@ -99,8 +97,8 @@ class VMOps(object):
ramdisk = VMHelper.fetch_image(self._session, instance.id,
instance.ramdisk_id, user, project, ImageType.KERNEL_RAMDISK)
- use_pv_kernel = VMHelper.determine_is_pv(
- self._session, instance.id, vdi_ref, disk_image_type, os_type)
+ use_pv_kernel = VMHelper.determine_is_pv(self._session, instance.id,
+ vdi_ref, disk_image_type, instance.os_type)
vm_ref = VMHelper.create_vm(self._session, instance, kernel, ramdisk,
use_pv_kernel)
@@ -242,7 +240,7 @@ class VMOps(object):
finally:
self._destroy(instance, template_vm_ref, shutdown=False,
destroy_kernel_ramdisk=False)
-
+
logging.debug(_("Finished snapshot and upload for VM %s"), instance)
def reboot(self, instance):