Support extending attached ScaleIO volumes

Adding ability to extend ScaleIO volumes which are
attached to an instance.

Change-Id: Ib2debfe481d4c1921d14546f81b60d070e8f9f39
This commit is contained in:
Eric Young 2018-03-20 15:45:15 -04:00
parent 43c72f02f2
commit ce90bec66f
4 changed files with 31 additions and 1 deletions
nova
tests/unit/virt/libvirt/volume
virt/libvirt/volume
releasenotes/notes
requirements.txt

@ -58,3 +58,19 @@ class LibvirtScaleIOVolumeDriverTestCase(
sio.disconnect_volume(conn, mock.sentinel.instance)
sio.connector.disconnect_volume.assert_called_once_with(
mock.sentinel.conn_data, None)
def test_libvirt_scaleio_driver_extend_volume(self):
def brick_extend_vol(data):
return data['size']
extended_vol_size = 8
sio = scaleio.LibvirtScaleIOVolumeDriver(self.fake_host)
disk_info = {'size': extended_vol_size,
'name': 'vol01',
'device_path': '/dev/vol01'}
conn = {'data': disk_info}
with mock.patch.object(sio.connector,
'extend_volume',
side_effect=brick_extend_vol):
self.assertEqual(extended_vol_size,
sio.extend_volume(conn, mock.sentinel.instance))

@ -61,3 +61,12 @@ class LibvirtScaleIOVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
super(LibvirtScaleIOVolumeDriver, self).disconnect_volume(
connection_info, instance)
def extend_volume(self, connection_info, instance):
LOG.debug("calling os-brick to extend ScaleIO Volume",
instance=instance)
new_size = self.connector.extend_volume(connection_info['data'])
LOG.debug("Extend ScaleIO Volume %s; new_size=%s",
connection_info['data']['device_path'],
new_size, instance=instance)
return new_size

@ -0,0 +1,5 @@
---
features:
- Added ability to extend an attached ScaleIO volume
when using the libvirt compute driver.

@ -52,7 +52,7 @@ rfc3986>=0.3.1 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0
psutil>=3.2.2 # BSD
oslo.versionedobjects>=1.31.2 # Apache-2.0
os-brick>=2.2.0 # Apache-2.0
os-brick>=2.4.0 # Apache-2.0
os-traits>=0.4.0 # Apache-2.0
os-vif!=1.8.0,>=1.7.0 # Apache-2.0
os-win>=3.0.0 # Apache-2.0