[SAP] Added admins view all volume_admin_metadata #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds the ability for admins to view
volume_admin_metadata when fetching volumes from the API.
This patch ensures that ensure_export at init_host time can
do a model update.
referencing:
https://review.opendev.org/c/openstack/cinder/+/779835
This patch slightly refactors create_export, ensure_export and
initialize_connection to allow saving a model_update back for each
of those calls.
The model update returns some vital information about the volume,
the vcenter uuid, the datastore name, and the vcenter storage profile
associated with that volume. That information is stored in the
volume_admin_metadata table as key/value pairs that are then returned
(for admin users) when a volume list or show is called from the API.
ensure_export is called for every in-use, available volume at cinder
startup. So existing volumes will get updated in the db at
cinder startup.
We will then be able to update the host entries later if/when we
migrate to supporting datastores as pools. Each volume will need
to get updated to change its host entry to include the pool name
(datastore name) as part of the host entry, so cinder knows which
cinder-volume service instance manages that specific volume.