Skip to content
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

Add supports_conversion_host to Host #315

Merged
merged 2 commits into from
Feb 5, 2019
Merged

Add supports_conversion_host to Host #315

merged 2 commits into from
Feb 5, 2019

Conversation

djberg96
Copy link
Contributor

@djberg96 djberg96 commented Dec 3, 2018

This sets supports :conversion_host to the Host model.

The main purpose for this is for the ManageIQ REST API, where support for conversion_host will be checked before attempting to enable or disable the resource.

Part of the V2V effort.

https://bugzilla.redhat.com/show_bug.cgi?id=1622728
https://bugzilla.redhat.com/show_bug.cgi?id=1695810

@agrare
Copy link
Member

agrare commented Dec 4, 2018

@djberg96 @fdupont-redhat @borod108 are there any requirements on a RHV host to be able to be a conversion host? I thought there was a specific version that it was added in.

@ghost
Copy link

ghost commented Dec 4, 2018

@agrare Yes, the minimum version of RHV is 4.2.4. We check it in the enablement playbook. It would be good to check it here too, but I don't know how to check the hypervisor version.

@agrare
Copy link
Member

agrare commented Dec 4, 2018

@fdupont-redhat it should be ext_management_system.api_version

@ghost
Copy link

ghost commented Dec 5, 2018

@agrare not necessarily. It is the API version of the manager, but the host may use an older version. I don't know how common it is, though. Today, the wrapper checks the version of vdsm and the minimum version is 4.20.31.

@djberg96
Copy link
Contributor Author

djberg96 commented Dec 5, 2018

@agrare @fdupont-redhat Ok, I've updated it so that it must meet a minimum ems.api_version. For now that's set to 4.2.4, but can update to 4.2.31 if you prefer.

Copy link
Contributor

@borod108 borod108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So won't going for the ems version create a bug when the host is of lower version?

@djberg96
Copy link
Contributor Author

djberg96 commented Dec 6, 2018

@borod108 I can restore that code if you feel more comfortable with it. For our types of version strings it shouldn't be an issue, but I suppose it's best to avoid any risk.

@djberg96
Copy link
Contributor Author

djberg96 commented Dec 6, 2018

@borod108 Well, it's potentially a bug either way I would think, so I'm open to suggestions.

@ghost
Copy link

ghost commented Dec 12, 2018

LGTM

@miq-bot
Copy link
Member

miq-bot commented Dec 12, 2018

This pull request is not mergeable. Please rebase and repush.

@djberg96
Copy link
Contributor Author

@miq-bot remove_label unmergeable

Update supports_conversion_host to require a minimum EMS api_version.
@miq-bot
Copy link
Member

miq-bot commented Dec 18, 2018

Checked commit https://github.com/djberg96/manageiq-providers-ovirt/commit/c3aa70dd41451f7b973db7850dfb3229ec932a45 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@agrare
Copy link
Member

agrare commented Dec 18, 2018

@borod108 is there anyway to get the API version of the host from the rhevm api?

@@ -1,4 +1,6 @@
class ManageIQ::Providers::Redhat::InfraManager::Host < ::Host
MINIMUM_CONVERSION_HOST_VERSION = '4.2.4'.freeze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A constant just used in one place seems like overkill, think its fine to just use "4.2.4" below with a comment about this being the minimum supported version (thought the unsupported_reason_add is pretty self explanatory even)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to put this in settings.yml, but I'm fine with whatever other folks prefer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even more overkill, don't think we'd ever want to allow that to be changed right? I was only added to rhev once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking this would let people switch to 4.2.31 if desired, but if that's a bad idea, then I'll just hard code it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it added in 4.2.31 or 4.2.4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agrare I was just trying to provide maximum flexibility as per @fdupont-redhat's comment at #315 (comment)

@agrare
Copy link
Member

agrare commented Feb 1, 2019

hey @djberg96 @borod108 what's the status of this?

@djberg96
Copy link
Contributor Author

djberg96 commented Feb 4, 2019

@agrare I've removed the constant and just hard coded it as per your request. If there's a way to get it dynamically, I never discovered it. I would ask that we go with this for now, and update later if/when needed.

@agrare agrare self-assigned this Feb 5, 2019
@djberg96
Copy link
Contributor Author

@miq-bot add_label hammer/yes

simaishi pushed a commit that referenced this pull request Mar 29, 2019
@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 618cefad991ad7b3219a35a55bd0081fdef862e2
Author: Adam Grare <agrare@redhat.com>
Date:   Tue Feb 5 13:15:21 2019 -0500

    Merge pull request #315 from djberg96/supports_conversion_host
    
    Add supports_conversion_host to Host
    
    (cherry picked from commit 37e9e07055d309134ca6d02cea305ea3fdfb3229)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1694229

simaishi added a commit that referenced this pull request Apr 1, 2019
@simaishi
Copy link
Contributor

simaishi commented Apr 1, 2019

Reverted the backport:

commit fbc2a4b7aff1a092736066899076d25099154c64
Author: Satoe Imaishi <simaishi@redhat.com>
Date:   Mon Apr 1 11:27:41 2019 -0400

    Revert "Merge pull request #315 from djberg96/supports_conversion_host"
    
    This reverts commit 618cefad991ad7b3219a35a55bd0081fdef862e2.

@simaishi
Copy link
Contributor

Hammer backport details:

$ git log -1
commit 1ef3de0858048ebd02bc649c067db190cfd55803
Author: Adam Grare <agrare@redhat.com>
Date:   Tue Feb 5 13:15:21 2019 -0500

    Merge pull request #315 from djberg96/supports_conversion_host
    
    Add supports_conversion_host to Host
    
    (cherry picked from commit 37e9e07055d309134ca6d02cea305ea3fdfb3229)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1702019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants