| From d2a67266ecc5a9b851b589da1839b74deaec3585 Mon Sep 17 00:00:00 2001 |
| From: Peter Penchev <openstack-dev@storpool.com> |
| Date: Mon, 26 Sep 2022 16:04:36 +0300 |
| Subject: [PATCH 3/9] StorPool: drop copy_image_to_volume() and |
| copy_volume_to_image() |
| |
| These methods seem to be leftovers from a bygone era when the parent |
| driver could not or would not attach volumes safely. |
| |
| Change-Id: I6e1a9026e677aee6c7ccad908fe6f92dc253762a |
| Closes-Bug: #2002996 |
| --- |
| cinder/volume/drivers/storpool.py | 45 ------------------------------- |
| 1 file changed, 45 deletions(-) |
| |
| diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py |
| index 9414bc62a..6c67ae567 100644 |
| --- a/cinder/volume/drivers/storpool.py |
| +++ b/cinder/volume/drivers/storpool.py |
| @@ -314,51 +314,6 @@ class StorPoolDriver(driver.VolumeDriver): |
| 'pools': pools |
| } |
| |
| - def copy_volume_to_image(self, context, volume, image_service, image_meta): |
| - req_id = context.request_id |
| - volname = self._attach.volumeName(volume['id']) |
| - name = self._attach.volsnapName(volume['id'], req_id) |
| - try: |
| - self._attach.api().snapshotCreate(volname, {'name': name}) |
| - except spapi.ApiError as e: |
| - raise self._backendException(e) |
| - self._attach.add(req_id, { |
| - 'volume': name, |
| - 'type': 'copy-from', |
| - 'id': req_id, |
| - 'rights': 1, |
| - 'volsnap': True |
| - }) |
| - try: |
| - return super(StorPoolDriver, self).copy_volume_to_image( |
| - context, volume, image_service, image_meta) |
| - finally: |
| - self._attach.remove(req_id) |
| - try: |
| - self._attach.api().snapshotDelete(name) |
| - except spapi.ApiError as e: |
| - LOG.error( |
| - 'Could not remove the temp snapshot %(name)s for ' |
| - '%(vol)s: %(err)s', |
| - {'name': name, 'vol': volname, 'err': e}) |
| - |
| - def copy_image_to_volume(self, context, volume, image_service, image_id, |
| - disable_sparse=False): |
| - req_id = context.request_id |
| - name = self._attach.volumeName(volume['id']) |
| - self._attach.add(req_id, { |
| - 'volume': name, |
| - 'type': 'copy-to', |
| - 'id': req_id, |
| - 'rights': 2 |
| - }) |
| - try: |
| - return super(StorPoolDriver, self).copy_image_to_volume( |
| - context, volume, image_service, image_id, |
| - disable_sparse=disable_sparse) |
| - finally: |
| - self._attach.remove(req_id) |
| - |
| def extend_volume(self, volume, new_size): |
| size = int(new_size) * units.Gi |
| name = self._attach.volumeName(volume['id']) |
| -- |
| 2.43.0 |
| |