3535 get_zone ,
3636 get_template ,
3737 list_hosts ,
38- list_volumes )
38+ list_volumes ,
39+ list_storage_pools )
3940from marvin .codes import FAILED , PASS
4041from nose .plugins .attrib import attr
4142
@@ -56,6 +57,10 @@ def setUpClass(cls):
5657 cls .services ['mode' ] = cls .zone .networktype
5758 cls .hypervisor = testClient .getHypervisorInfo ()
5859
60+ if cls .hypervisor .lower () != "kvm" :
61+ cls .unsupportedHypervisor = True
62+ return
63+
5964 cls .template = get_template (
6065 cls .apiclient ,
6166 cls .zone .id ,
@@ -76,11 +81,44 @@ def setUpClass(cls):
7681 cls ._cleanup .append (cls .account )
7782 cls .debug (cls .account .id )
7883
79- cls .service_offering = ServiceOffering .create (
80- cls .apiclient ,
81- cls .services ["service_offerings" ]["tiny" ]
82- )
83- cls ._cleanup .append (cls .service_offering )
84+ storage_pools_response = list_storage_pools (cls .apiclient ,
85+ zoneid = cls .zone .id ,
86+ scope = "ZONE" )
87+
88+ if storage_pools_response :
89+ cls .zone_wide_storage = storage_pools_response [0 ]
90+
91+ cls .debug (
92+ "zone wide storage id is %s" %
93+ cls .zone_wide_storage .id )
94+ update1 = StoragePool .update (cls .apiclient ,
95+ id = cls .zone_wide_storage .id ,
96+ tags = "test-vm"
97+ )
98+ cls .debug (
99+ "Storage %s pool tag%s" %
100+ (cls .zone_wide_storage .id , update1 .tags ))
101+ cls .service_offering = ServiceOffering .create (
102+ cls .apiclient ,
103+ cls .services ["service_offerings" ]["small" ],
104+ tags = "test-vm"
105+ )
106+ cls ._cleanup .append (cls .service_offering )
107+
108+ do = {
109+ "name" : "do-tags" ,
110+ "displaytext" : "Disk offering with tags" ,
111+ "disksize" :8 ,
112+ "tags" : "test-vm"
113+ }
114+ cls .disk_offering = DiskOffering .create (
115+ cls .apiclient ,
116+ do ,
117+ )
118+ cls ._cleanup .append (cls .disk_offering )
119+ else :
120+ cls .debug ("No zone wide storage found" )
121+ return
84122
85123 cls .virtual_machine = VirtualMachine .create (
86124 cls .apiclient ,
@@ -259,7 +297,7 @@ def create_volume_from_snapshot_deploy_vm(self, snapshotid):
259297 volume = Volume .create_from_snapshot (
260298 self .apiclient ,
261299 snapshot_id = snapshotid ,
262- services = self .services [ "volume_from_snapshot" ] ,
300+ disk_offering = self .disk_offering . id ,
263301 zoneid = self .zone .id ,
264302 )
265303 virtual_machine = VirtualMachine .create (self .apiclient ,
0 commit comments