mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7228 Only shrink disk when CLVM is in use.
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
parent
396f29c135
commit
9b783d19ad
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user