Allow cloud volume to provide a list of volumes for attach #14058
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.
While opening the view to attach a selected volume to a new instance, the UI will currently ask for the VMs that are available in the cloud tenant of the chosen volume. While it works for OpenStack, Amazon has no notion of tenants currently.
Instead of relying on the tenant's VMs, this patch proposes a new method in the cloud volume allowing it to specify the list of VMs this volume can be attached to. In case of OpenStack, this will be delagated to
cloud_tenant
and on Amazon it will be delagated toavailability_zone
(because the volume has to reside in the same AZ).A simple spec test is provided to validate the
available_vms
only return the list of VMs in the same cloud tenant. I've got the counterpart ready for Amazon, but will wait to see if this change is acceptable.Is there any alternative to this approach?
@miq-bot add_label providers/openstack/cloud, providers/amazon, providers/storage, ui