Skip to content

Commit

Permalink
Merge "bug lp845714"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Sep 29, 2011
2 parents a363fd9 + 2dd0445 commit bf181c2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions nova/tests/test_xenapi.py
Expand Up @@ -82,6 +82,7 @@ def setUp(self):
'image_ref': 1,
'kernel_id': 2,
'ramdisk_id': 3,
'local_gb': 20,
'instance_type_id': '3', # m1.large
'os_type': 'linux',
'architecture': 'x86-64'}
Expand Down Expand Up @@ -375,6 +376,7 @@ def _test_spawn(self, image_ref, kernel_id, ramdisk_id,
'image_ref': image_ref,
'kernel_id': kernel_id,
'ramdisk_id': ramdisk_id,
'local_gb': 20,
'instance_type_id': instance_type_id,
'os_type': os_type,
'hostname': hostname,
Expand Down Expand Up @@ -651,6 +653,7 @@ def _create_instance(self, instance_id=1, spawn=True):
'image_ref': 1,
'kernel_id': 2,
'ramdisk_id': 3,
'local_gb': 20,
'instance_type_id': '3', # m1.large
'os_type': 'linux',
'architecture': 'x86-64'}
Expand Down
3 changes: 0 additions & 3 deletions nova/tests/xenapi/stubs.py
Expand Up @@ -282,9 +282,6 @@ def __init__(self, uri):
def VDI_get_by_uuid(self, *args):
return 'hurr'

def VDI_resize_online(self, *args):
pass

def VM_start(self, _1, ref, _2, _3):
vm = fake.get_record('VM', ref)
if vm['power_state'] != 'Halted':
Expand Down
6 changes: 6 additions & 0 deletions nova/virt/xenapi/fake.py
Expand Up @@ -378,6 +378,12 @@ def host_compute_free_memory(self, _1, ref):
def host_call_plugin(self, *args):
return 'herp'

def VDI_resize_online(self, *args):
return 'derp'

def VM_clean_reboot(self, *args):
return 'burp'

def network_get_all_records_where(self, _1, filter):
return self.xenapi.network.get_all_records()

Expand Down
5 changes: 5 additions & 0 deletions nova/virt/xenapi/vmops.py
Expand Up @@ -165,6 +165,11 @@ def _create_disks(self, context, instance):
instance, instance.image_ref,
instance.user_id, instance.project_id,
disk_image_type)

for vdi in vdis:
if vdi["vdi_type"] == "os":
self.resize_instance(instance, vdi["vdi_uuid"])

return vdis

def spawn(self, context, instance, network_info):
Expand Down

0 comments on commit bf181c2

Please sign in to comment.