-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to receive datastore by name or by id #15101
Closed
masayag
wants to merge
1
commit into
ManageIQ:master
from
masayag:accept_datastore_id_when_adding_disk
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @masayag - renaming
:datastore
todatastore_name
would offer more clarity, as: datastore_id
doesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bronaghs, @abellotti wouldn't it be considered as breaking the API ?
In [1] the datastore is exposed as
diskscsi##.datastore=<datastore name>
, therefore changing it todatastore_name
will cause any existing users/customer scripts not to work.I can add
diskscsi##.datastore_name
in addition, with the same semantics as thediskscsi##.datastore
, and later on to deprecate the latter, but I'm not familiar with the API deprecation policy.[1] https://access.redhat.com/documentation/en-US/Red_Hat_CloudForms/3.2/html/Red_Hat_CloudForms_SOAP_API/Defining_new_disks_during_provisioning.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will defer to @abellotti on using
datastore_name
in addition.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug could you review ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we skip all this logic and just look for the datastore based on the
ext_management_system
handle to avoid this issue?datastore = ext_management_system.storages.find_by(:name => options[:datastore])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug that's good idea. I'll update the PR to address it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I thought the root cause is having a datastore with the same name twice under the the same ems. If this is the case, then scoping it to ems does not help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by #15245, closing the current one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@durandom the use case in which datastore appears twice for the same RHV provider happened when the provider was first added to manageiq, then removed and added again.
The previous datastore remained on cmdb, however, its association with any provider was removed. Therefore the code above will allow to select only a datastore which is associated with a datastore related to the provider in which the vm is about to be added.
However, @agrare raised an issue on ManageIQ/manageiq-providers-ovirt#42 where VMware might have several datastores with the same name.