iXsystems / cinder

Other
35 stars 18 forks source link

Enhancement fix for #42 adding manage/unmanage support for volume/snapshot #45

Closed YiHuangDB closed 11 months ago

YiHuangDB commented 11 months ago

42 Issue descriptions:

Driver feature manage/unmanage volume/snapshot from Truenas internal reference not yet supported

Failed tempest ci test case https://docs.openstack.org/tempest/latest/_modules/volume/admin/test_snapshot_manage.html#SnapshotManageAdminTest https://docs.openstack.org/tempest/latest/_modules/volume/admin/test_volume_manage.html#VolumeManageAdminTest.test_unmanage_manage_volume

Solution: Adding driver implementation method to to support cinder manage/unmanage volume/snapshot

Changes: iscsi.py add functions: manage_existing manage_existing_snapshot manage_existing_get_size manage_existing_snapshot_get_size get_manageable_volumes get_manageable_snapshots

common.py add function get_volume get_snapshot get_all_snapshot get_volume_from_snapshot

utils.py add function generate_volume_id_from_freenas_volume_name generate_snapshot_id_from_freenas_snapshot_name

Additional notes:

  1. change cinder volume name to truenas zvol name mapping from uuid aaa-bbb-ccc-ddd-eee -> volume-aaa to volume-aaa-bbb-ccc-ddd-eee (this is ensure 1 to 1 mapping so no extra meta storage is required when manage/unmanage two system cinder vs truenas)
  2. change cinder snapshot name to truenas zvol name mapping from uuid aaa-bbb-ccc-ddd-eee -> snap-aaa to snap-aaa-bbb-ccc-ddd-eee
  3. manage_existing depends on renaming volume from old to new name, use replication api as workaround
  4. manage_existing_snapshot depends on renaming snapshot from old name to new name, no api available at this moment, leave for future implementation once rename snapshot name api available or use zfs native command zfs rename instead
  5. https://docs.openstack.org/tempest/latest/_modules/volume/admin/test_volume_manage.html#VolumeManageAdminTest.test_unmanage_manage_volume test pass https://docs.openstack.org/tempest/latest/_modules/volume/admin/test_snapshot_manage.html#SnapshotManageAdminTest test failed due to no snapshot rename implemented for now
  6. get_manageable_volumes and get_manageable_snapshots is not covered by tempest testcase and it's not mandatory leave it for future implementation.