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

This commit is contained in:
Zuul 2022-09-27 05:23:20 +00:00 committed by Gerrit Code Review
commit 5227d9374f
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

@ -630,15 +630,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.