-
Notifications
You must be signed in to change notification settings - Fork 898
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
Tag associated resource for conversion hosts #18505
Conversation
@fdupont-redhat @mturley Please take a look. |
I would have seen this on the enable/disable actions. We can have a conversion host and easily know if it's configured. |
Checked commits https://github.com/djberg96/manageiq/compare/2daceddc313e72a23d054d2de8d2e6c86f7f6c30~...70dd7bd368214e3445c5710d11c40f2ab7474854 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@miq-bot add_labels transformation, enhancement |
@miq-bot add_label hammer/yes |
@miq_bot add_reviewer @agrare |
To Fabien's point:
Is it possible to have a conversion host that is not configured, at least via the REST API? Create/enable is one request, and the disable request also destroys the record, right? |
@mturley ATM, It's only possible through manual fiddling, probably by using the non-async methods directly on an active record instance on the console. Yes, disable destroys the record. Anticipating your next question, perhaps you're wondering why tag the resource at all if it's not a conversion host? My thinking was that, this way, we could still tell that it had been converted to a conversion host at some point in its lifecycle. |
That makes sense! Perfect, thanks. Having this tag will be nice for excluding already-configured hosts from selection in the wizard, which I was anticipating having to do by checking each one against the conversion_hosts results. 👍 |
On a related question, @djberg96 , what would happen if a user requested conversion host enablement on a host that is already configured, or on a host which is in the process of being configured? |
At the moment, I can only guess that the python script that performs the actual enablement would bomb. If that doesn't do any sort of validation, then the answer is.....I don't know. So, good point. Once tagging support is added, I can add another validation that you can't enable an already enabled conversion host, which we can check by looking at its tags. |
Ok. I'm going to filter out those hosts from the wizard, so it should be next to impossible for this to happen via the UI, but technically possible (e.g. user A opens the wizard and loads eligible hosts, user B enables one of them, user A tries to finish the wizard with the same host). Ideally that API request should fail (403 Forbidden, or maybe 400 Bad Request). Also ideally, it should fail even if the host isn't enabled, if there is a task in progress to enable that host (although I'm sure that's more of a stretch). |
The Python script you mention is |
@fdupont-redhat Ok, so we don't need to really worry about it. Good to know, thanks. |
@djberg96 Yes, the main challenge I see is collecting the log of the playbook. |
# Wrapper method for the various tag_resource_as_xxx methods. | ||
#-- | ||
# TODO: Do we need this? | ||
# | ||
def tag_resource_as(status) | ||
send("tag_resource_as_#{status}") | ||
end |
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.
Yeah lets delete this if it isn't used...it doesn't look that helpful
Tag associated resource for conversion hosts (cherry picked from commit a7b4e8e) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702033
Hammer backport details:
|
A resource that's been designated as a conversion host should be tagged and identifiable as such. This PR modifies the ConversionHost model so that on
create
ordelete
it is tagged appropriately. I also added some comments and specs.Note that I modified the existing tagging methods slightly so that it can only be
v2v_transformation_host/true
orv2v_transformation_host/false
. Previously it could end up with both tags.In addition, it only sets
v2v_transformation_method/vddk
orv2v_transformation_method/ssh
if they're actually supported. Those are deleted if the conversion host is deleted.Part of https://bugzilla.redhat.com/show_bug.cgi?id=1622728https://bugzilla.redhat.com/show_bug.cgi?id=1695855