@@ -171,12 +171,15 @@ def setUpCloudStack(cls):
171
171
cls .random_data = "random.data"
172
172
cls .virtual_machine = VirtualMachine .create (
173
173
cls .apiclient ,
174
- cls .services ["small" ],
174
+ {"name" : "StorPool-%s" % uuid .uuid4 ()},
175
+ zoneid = cls .zone .id ,
176
+ templateid = cls .template .id ,
175
177
accountid = cls .account .name ,
176
178
domainid = cls .account .domainid ,
177
- templateid = cls .template .id ,
178
179
serviceofferingid = cls .service_offering .id ,
179
180
overridediskofferingid = cls .disk_offerings_tier1_tags .id ,
181
+ hypervisor = cls .hypervisor ,
182
+ rootdisksize = 10
180
183
)
181
184
182
185
volume = list_volumes (
@@ -222,6 +225,7 @@ def tearDown(self):
222
225
def test_01_check_tags_on_deployed_vm_and_datadisk (self ):
223
226
virtual_machine_tier1_tag = self .deploy_vm_and_check_tier_tag ()
224
227
virtual_machine_tier1_tag .stop (self .apiclient , forced = True )
228
+ virtual_machine_tier1_tag .delete (self .apiclient , expunge = True )
225
229
226
230
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
227
231
def test_02_change_offering_on_attached_root_disk (self ):
@@ -235,6 +239,7 @@ def test_02_change_offering_on_attached_root_disk(self):
235
239
self .vc_policy_tags (volumes = root_volume , vm = virtual_machine_tier1_tag , qos_or_template = self .qos ,
236
240
disk_offering_id = self .disk_offerings_tier2_tags .id , attached = True )
237
241
virtual_machine_tier1_tag .stop (self .apiclient , forced = True )
242
+ virtual_machine_tier1_tag .delete (self .apiclient , expunge = True )
238
243
239
244
def test_03_change_offering_on_attached_data_disk (self ):
240
245
virtual_machine_tier1_tag = self .deploy_vm_and_check_tier_tag ()
@@ -247,6 +252,7 @@ def test_03_change_offering_on_attached_data_disk(self):
247
252
self .vc_policy_tags (volumes = root_volume , vm = virtual_machine_tier1_tag , qos_or_template = self .qos ,
248
253
disk_offering_id = self .disk_offerings_tier2_tags .id , attached = True )
249
254
virtual_machine_tier1_tag .stop (self .apiclient , forced = True )
255
+ virtual_machine_tier1_tag .delete (self .apiclient , expunge = True )
250
256
251
257
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
252
258
def test_04_check_templates_on_deployed_vm_and_datadisk (self ):
@@ -268,6 +274,7 @@ def test_04_check_templates_on_deployed_vm_and_datadisk(self):
268
274
for v in volumes :
269
275
self .check_storpool_template (v , self .disk_offerings_tier1_template .id , self .spTemplate )
270
276
virtual_machine_template_tier1 .stop (self .apiclient , forced = True )
277
+ virtual_machine_template_tier1 .delete (self .apiclient , expunge = True )
271
278
272
279
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
273
280
def test_05_check_templates_on_deployed_vm_and_datadisk_tier2 (self ):
@@ -289,6 +296,7 @@ def test_05_check_templates_on_deployed_vm_and_datadisk_tier2(self):
289
296
for v in volumes :
290
297
self .check_storpool_template (v , self .disk_offerings_tier2_template .id , self .spTemplate )
291
298
virtual_machine_template_tier2 .stop (self .apiclient , forced = True )
299
+ virtual_machine_template_tier2 .delete (self .apiclient , expunge = True )
292
300
293
301
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
294
302
def test_06_change_offerings_with_tags_detached_volume (self ):
@@ -322,6 +330,7 @@ def test_06_change_offerings_with_tags_detached_volume(self):
322
330
self .changeOfferingForVolume (volumes [0 ].id , self .disk_offerings_tier1_tags .id , volumes [0 ].size )
323
331
self .vc_policy_tags (volumes = volumes , vm = virtual_machine_tier2_tag , qos_or_template = self .qos ,
324
332
disk_offering_id = self .disk_offerings_tier1_tags .id , attached = True )
333
+ virtual_machine_tier2_tag .delete (self .apiclient , expunge = True )
325
334
326
335
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
327
336
def test_07_change_offerings_with_template_detached_volume (self ):
@@ -354,6 +363,7 @@ def test_07_change_offerings_with_template_detached_volume(self):
354
363
self .changeOfferingForVolume (volumes [0 ].id , self .disk_offerings_tier1_template .id , volumes [0 ].size )
355
364
self .check_storpool_template (volume = volumes [0 ], disk_offering_id = self .disk_offerings_tier1_template .id ,
356
365
qos_or_template = self .spTemplate )
366
+ virtual_machine_tier2_template .delete (self .apiclient , expunge = True )
357
367
358
368
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
359
369
def test_08_deploy_vm_with_tags_and_template_in_offerings (self ):
@@ -392,6 +402,7 @@ def test_08_deploy_vm_with_tags_and_template_in_offerings(self):
392
402
self .changeOfferingForVolume (volumes [0 ].id , self .disk_offerings_tier1_tags .id , volumes [0 ].size )
393
403
self .vc_policy_tags (volumes = volumes , vm = virtual_machine_tier2_template , qos_or_template = self .qos ,
394
404
disk_offering_id = self .disk_offerings_tier1_tags .id , attached = True )
405
+ virtual_machine_tier2_template .delete (self .apiclient , expunge = True )
395
406
396
407
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
397
408
def test_09_resize_root_volume (self ):
@@ -408,6 +419,7 @@ def test_09_resize_root_volume(self):
408
419
self .vc_policy_tags (volumes = root_volume , vm = virtual_machine_tier1_tag , qos_or_template = self .qos ,
409
420
disk_offering_id = self .disk_offerings_tier2_tags .id , attached = True )
410
421
virtual_machine_tier1_tag .stop (self .apiclient , forced = True )
422
+ virtual_machine_tier1_tag .delete (self .apiclient , expunge = True )
411
423
412
424
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
413
425
def test_10_shrink_root_volume (self ):
@@ -425,6 +437,7 @@ def test_10_shrink_root_volume(self):
425
437
listall = True )
426
438
self .vc_policy_tags (volumes = root_volume , vm = virtual_machine_tier1_tag , qos_or_template = self .qos ,
427
439
disk_offering_id = self .disk_offerings_tier2_tags .id , attached = True )
440
+ virtual_machine_tier1_tag .delete (self .apiclient , expunge = True )
428
441
429
442
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
430
443
def test_11_resize_data_volume (self ):
@@ -441,6 +454,7 @@ def test_11_resize_data_volume(self):
441
454
self .vc_policy_tags (volumes = root_volume , vm = virtual_machine_tier1_tag , qos_or_template = self .qos ,
442
455
disk_offering_id = self .disk_offerings_tier2_tags .id , attached = True )
443
456
virtual_machine_tier1_tag .stop (self .apiclient , forced = True )
457
+ virtual_machine_tier1_tag .delete (self .apiclient , expunge = True )
444
458
445
459
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
446
460
def test_12_shrink_data_volume (self ):
@@ -458,6 +472,7 @@ def test_12_shrink_data_volume(self):
458
472
self .vc_policy_tags (volumes = root_volume , vm = virtual_machine_tier1_tag , qos_or_template = self .qos ,
459
473
disk_offering_id = self .disk_offerings_tier2_tags .id , attached = True )
460
474
virtual_machine_tier1_tag .stop (self .apiclient , forced = True )
475
+ virtual_machine_tier1_tag .delete (self .apiclient , expunge = True )
461
476
462
477
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
463
478
def test_13_deploy_vm_from_volume_check_tags (self ):
@@ -466,6 +481,7 @@ def test_13_deploy_vm_from_volume_check_tags(self):
466
481
listall = True )
467
482
self .vc_policy_tags (volumes = root_volume , vm = vm , qos_or_template = self .qos ,
468
483
disk_offering_id = self .disk_offerings_tier1_tags .id , attached = True )
484
+ vm .delete (self .apiclient , expunge = True )
469
485
470
486
@attr (tags = ["advanced" , "advancedns" , "smoke" ], required_hardware = "true" )
471
487
def test_14_deploy_vm_from_snapshot_check_tags (self ):
@@ -474,6 +490,7 @@ def test_14_deploy_vm_from_snapshot_check_tags(self):
474
490
listall = True )
475
491
self .vc_policy_tags (volumes = root_volume , vm = vm , qos_or_template = self .qos ,
476
492
disk_offering_id = self .disk_offerings_tier1_tags .id , attached = True )
493
+ vm .delete (self .apiclient , expunge = True )
477
494
478
495
def deploy_vm_and_check_tier_tag (self ):
479
496
virtual_machine_tier1_tag = VirtualMachine .create (
@@ -602,8 +619,11 @@ def deploy_vm_from_snapshot_or_template(self, snapshotid, is_snapshot=False):
602
619
self .apiclient ,
603
620
snapshot_id = snapshotid ,
604
621
services = self .services ,
605
- disk_offering = self .disk_offering .id ,
622
+ account = self .account .name ,
623
+ domainid = self .account .domainid ,
624
+ disk_offering = self .disk_offerings_tier1_tags .id ,
606
625
zoneid = self .zone .id ,
626
+ size = 10
607
627
)
608
628
virtual_machine = VirtualMachine .create (self .apiclient ,
609
629
{"name" : "StorPool-%s" % uuid .uuid4 ()},
@@ -617,4 +637,5 @@ def deploy_vm_from_snapshot_or_template(self, snapshotid, is_snapshot=False):
617
637
ssh_client = virtual_machine .get_ssh_client ()
618
638
except Exception as e :
619
639
self .fail ("SSH failed for virtual machine: %s - %s" %
620
- (virtual_machine .ipaddress , e ))
640
+ (virtual_machine .ipaddress , e ))
641
+ return virtual_machine
0 commit comments