summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>2010-12-13 16:11:12 +0000
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>2010-12-13 16:11:12 +0000
commite33cce1b76d5e0752c49b51cdc24c3368d12125f (patch)
tree216044ffb048e7838147ed9da748e5aff843bd80 /nova
parent49a1cadd61b4badff0578ecd26adb57fb284ad9a (diff)
only needs work for distinguishing pv from hvm
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/xenapi/vm_utils.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 3ab4581c4..320869ae2 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -79,7 +79,7 @@ class VMHelper():
'platform': {},
'PCI_bus': '',
'recommendations': '',
- 'affinity': '',
+ 'affinity': '',
'user_version': '0',
'other_config': {},
}
@@ -98,6 +98,7 @@ class VMHelper():
#TODO: Windows needs a platform flag...
rec['HVM_boot_policy'] = 'BIOS order'
rec['HVM_boot_params'] = {'order': 'dc'}
+ rec['platform']={'acpi':'true','apic':'true','pae':'true','viridian':'true'}
logging.debug('Created VM %s...', instance.name)
vm_ref = yield session.call_xenapi('VM.create', rec)
@@ -162,18 +163,21 @@ class VMHelper():
url = images.image_url(image)
access = AuthManager().get_access_key(user, project)
logging.debug("Asking xapi to fetch %s as %s", url, access)
- fn = use_sr and 'get_vdi' or 'get_kernel'
+ logging.debug("Salvatore: image type = %d",type)
+ fn = (type<>0) and 'get_vdi' or 'get_kernel'
+ logging.debug("Salvatore: fn=%s",fn)
args = {}
args['src_url'] = url
args['username'] = access
args['password'] = user.secret
args['add_partition']='false'
args['raw']='false'
- if use_sr<>0:
+ if type<>0:
args['add_partition'] = 'true'
- else:
- if use_sr==2:
+ if type==2:
args['raw']='true'
+ logging.debug("Salvatore: args['raw']=%s",args['raw'])
+ logging.debug("Salvatore: args['add_partition']=%s",args['add_partition'])
task = yield session.async_call_plugin('objectstore', fn, args)
uuid = yield session.wait_for_task(task)
defer.returnValue(uuid)