When initializing IBM SVC with the memory persistence we get an exception:
return IMPL.volume_get_all_by_host(context, host, filters=filters)
AttributeError: 'DB' object has no attribute 'volume_get_all_by_host'
The issue is caused by the SVC driver accessing the database directly,
which is not considered good practice in Cinder nowadays.
The problem with drivers using the DB directly is that cinderlib doesn't
require a DB, it can work storing everything in memory. To facilitate
storage of the resources' metadata cinderlib has its own persistence
plugin mechanism, and has some ad-hoc "workarounds" in the DB class for
drivers that access the DB directly.
The IBM driver has the following DB dependencies:
- volume_get_all_by_host when using objects.VolumeList.get_all_by_host
- volume_type_get when using objects.VolumeType.get_by_name_or_id
- volume_type_get_by_name when using
objects.VolumeType.get_by_name_or_id
- volume_get directly called by get_by_id when using
objects.Volume.get_by_id
- _group_type_get_full directly called by get_by_id when using
objects.GroupType.get_by_id
- volume_admin_metadata_get direct call
- volume_admin_metadata_update direct call
- volume_admin_metadata_delete direct call
In cinderlib we don't currently support groups or consistency groups, so
we don't need to implement `_group_type_get_full` and we have already
implemented workaround for methods `volume_get` and `volume_type_get`,
so this patch implements the remaining 5 methods volume_get_all_by_host,
volume_type_get_by_name, volume_admin_metadata_get,
volume_admin_metadata_update, and volume_admin_metadata_delete in the DB
class.
Reviewed: https:/ /review. opendev. org/648212 /git.openstack. org/cgit/ openstack/ cinderlib/ commit/ ?id=385e6f4a1ec 5c382885321b3db 9d80f26f66c117
Committed: https:/
Submitter: Zuul
Branch: master
commit 385e6f4a1ec5c38 2885321b3db9d80 f26f66c117
Author: Gorka Eguileor <email address hidden>
Date: Wed Mar 27 19:46:05 2019 +0100
Add support for IBM SVC
When initializing IBM SVC with the memory persistence we get an exception:
return IMPL.volume_ get_all_ by_host( context, host, filters=filters) Error: 'DB' object has no attribute 'volume_ get_all_ by_host'
Attribute
The issue is caused by the SVC driver accessing the database directly,
which is not considered good practice in Cinder nowadays.
The problem with drivers using the DB directly is that cinderlib doesn't
require a DB, it can work storing everything in memory. To facilitate
storage of the resources' metadata cinderlib has its own persistence
plugin mechanism, and has some ad-hoc "workarounds" in the DB class for
drivers that access the DB directly.
The IBM driver has the following DB dependencies:
- volume_ get_all_ by_host when using objects. VolumeList. get_all_ by_host
- volume_type_get when using objects. VolumeType. get_by_ name_or_ id
- volume_ type_get_ by_name when using VolumeType. get_by_ name_or_ id
objects.
- volume_get directly called by get_by_id when using Volume. get_by_ id
objects.
- _group_ type_get_ full directly called by get_by_id when using GroupType. get_by_ id
objects.
- volume_ admin_metadata_ get direct call
- volume_ admin_metadata_ update direct call
- volume_ admin_metadata_ delete direct call
In cinderlib we don't currently support groups or consistency groups, so type_get_ full` and we have already get_all_ by_host, type_get_ by_name, volume_ admin_metadata_ get, admin_metadata_ update, and volume_ admin_metadata_ delete in the DB
we don't need to implement `_group_
implemented workaround for methods `volume_get` and `volume_type_get`,
so this patch implements the remaining 5 methods volume_
volume_
volume_
class.
Closes-Bug: #1821898 6f4a9cac2e40943 b74aca4066e
Change-Id: I94b4864c582397