CLOUDSTACK-7228 Only shrink disk when CLVM is in use.

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
John Dilley 2014-08-14 10:38:08 +00:00 committed by SrikanteswaraRao Talluri
parent 396f29c135
commit 9b783d19ad

View File

@ -30,7 +30,8 @@ from marvin.lib.base import (ServiceOffering,
Account,
Volume,
Host,
DiskOffering)
DiskOffering,
StoragePool)
from marvin.lib.common import (get_domain,
get_zone,
get_template)
@ -660,6 +661,20 @@ class TestVolumes(cloudstackTestCase):
"Check if the data volume resized appropriately"
)
can_shrink = False
list_volume_response = Volume.list(
self.apiClient,
id=self.volume.id,
type='DATADISK'
)
storage_pool_id = [x.storageid for x in list_volume_response if x.id == self.volume.id][0]
storage = StoragePool.list(self.apiclient, id=storage_pool_id)[0]
# At present only CLVM supports shrinking volumes
if storage.type.lower() == "clvm":
can_shrink = True
if can_shrink:
self.services["disk_offering"]["disksize"] = 10
disk_offering_10_GB = DiskOffering.create(
self.apiclient,