Revert "PowerFlex driver - fix the display of the incorrect volume"

This reverts commit b1b09d4085.

Reason for revert: Introducing regression, Any volume extension operation fails.

Change-Id: I0e72f3b74209120fd82ae55c5951fe5e878c124f
This commit is contained in:
Jean Pierre Roquesalane 2022-09-21 15:40:00 +00:00
parent b1b09d4085
commit 13c2cec675
3 changed files with 5 additions and 27 deletions

View File

@ -82,27 +82,10 @@ class TestCreateVolume(powerflex.TestPowerFlexDriver):
"""Valid create volume parameters"""
self.driver.create_volume(self.volume)
def test_create_volume_non_8_gran_with_off_round_parameter(self):
self.driver.configuration.powerflex_round_volume_capacity = False
self.volume.size = 14
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.create_volume, self.volume)
def test_create_volume_non_8_gran(self):
self.driver.configuration.powerflex_round_volume_capacity = True
self.volume.size = 14
model_update = self.driver.create_volume(self.volume)
self.assertEqual(self.volume.size, 14)
self.assertFalse(model_update.get('size', False))
def test_create_volume_rest_client(self):
self.driver.configuration.powerflex_round_volume_capacity = True
self.driver.primary_client.create_volume = mock.Mock()
self.volume.size = 12
self.driver.create_volume(self.volume)
self.driver.primary_client.create_volume.assert_called_with(
self.PROT_DOMAIN_NAME, self.STORAGE_POOL_NAME, self.volume.id,
self.volume.size, 'ThinProvisioned', 'None')
self.assertEqual(16, model_update['size'])
def test_create_volume_badstatus_response(self):
self.set_https_response_mode(self.RESPONSE_MODE.BadStatus)

View File

@ -628,15 +628,18 @@ class PowerFlexDriver(driver.VolumeDriver):
volume.size,
provisioning,
compression)
real_size = int(flex_utils.round_to_num_gran(volume.size))
model_updates = {
"provider_id": provider_id,
"size": real_size,
"replication_status": fields.ReplicationStatus.DISABLED,
}
LOG.info("Successfully created volume %(vol_id)s. "
"PowerFlex volume name: %(vol_name)s, "
"Volume size: %(size)s. PowerFlex volume name: %(vol_name)s, "
"id: %(provider_id)s.",
{
"vol_id": volume.id,
"size": real_size,
"vol_name": flex_utils.id_to_base64(volume.id),
"provider_id": provider_id,
})

View File

@ -1,8 +0,0 @@
---
fixes:
- |
PowerFlex driver `Bug #1968164 <https://bugs.launchpad.net/cinder/+bug/1968164>`_:
Fixed the display of the incorrect volume size on volume or snapshot creation.
PowerFlex storage requires volumes sizes to be a multiple of 8 GiB. This size
was being reported to the end user, potentially causing confusion by being
different than what they requested.