-
Notifications
You must be signed in to change notification settings - Fork 120
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 V2V for VMware to oVirt / RHV #301
Add V2V for VMware to oVirt / RHV #301
Conversation
@miq-bot add-label transformation |
@miq-bot add-label wip |
@@ -0,0 +1,53 @@ | |||
--- | |||
object_type: class |
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.
@fdupont-redhat
This class already exists in master, are there any changes to 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.
Nope. But apparently, Git think there is...
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.
@fdupont-redhat
When the first PR was created the directory for MiqAe didn't have the class prefix.
The actual name should have been MiqAe.class but it got stored in the content repo as MiqAe.
I am not sure how you created the class, if you look at other class directories under
You will see that MiqAe stands out.
Can we fix this issue in a separate PR which might help reduce the # of files in this PR?
@mkanoor, @gmcculloug, @tinaafitz, my Ruby skills hit a limit with the last errors:
Thanks for your help. |
@@ -22,7 +22,7 @@ def main | |||
destination_ems = task.transformation_destination(source_cluster).ext_management_system | |||
raise "Invalid destination EMS type: #{destination_ems.emstype}. Aborting." unless destination_ems.emstype == "rhevm" | |||
|
|||
transformation_host = ManageIQ::Automate::Transformation::TransformationHosts::Common::Utils.get_transformation_host(destination_ems, 'vddk', factory_config) | |||
transformation_host = ManageIQ::Automate::Transformation::TransformationHosts::Common::Utils.get_transformation_host(destination_ems, @handle.get_state_var(:transformation_method), factory_config) |
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.
@fdupont-redhat
Should the transformation_method be set in request/task options hash, since we want that information to persist. The state_var is temporary and will disappear when the task ends. The Request/Task options would persist.
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.
@mkanoor
The transformation method is set in the AssessTransformation method. Currently, it's hardcoded to 'vddk', but in future versions 'ssh' will also be available and provided by the task or transformation plan, or even the transformation mapping. We still don't know which of these objects will hold the information.
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.
@fdupont-redhat
Do you want to open a git issue on moving this to the request or task options instead of leaving it in state vars?
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.
Shouldn't I wait for this PR to be merged before ? If not, I'll open the issue.
@@ -9,7 +9,7 @@ def initialize(handle = $evm) | |||
end | |||
|
|||
def main | |||
playbook = "/usr/share/doc/ovirt-ansible-v2v-conversion-host-1.0.0/examples/conversion_host_check.yml" | |||
playbook = "/usr/share/doc/ovirt-ansible-v2v-conversion-host-1.2.0/examples/conversion_host_check.yml" |
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.
@fdupont-redhat
How do these playbooks get into the appliance, is there a seeding process for each ansible enabled appliance?
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.
@mkanoor
The playbooks are not on the appliance, but on the RHV Manager. They are provided by the ovirt-ansible-v2v-conversion-host
package. So nothing to do on ManageIQ side.
source_vm = task.source | ||
@handle.log(:info, "Source VM: #{source_vm.name}") | ||
source_cluster = source_vm.ems_cluster | ||
@handle.log(:info, "Source Cluster: #{source_cluster.name}") |
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.
@fdupont-redhat
You dont need the .name
You can just change it to
@handle.log(:info, "Source Cluster: #{source_cluster}")
By default the to_s method that is indirectly called here will look for an attribute called name.
https://github.com/ManageIQ/manageiq-automation_engine/blob/a05c976f0983e18aea96f5d9609c931f75d7ad31/lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_object.rb#L20
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.
So, that will be the same anytime I use .name
, isn't it ? Because, a quick grep tells me it is used a lot, and not only in this PR.
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.
@fdupont-redhat
You dont have to make this change, if you just used #{vmdb_object} you will get the name attribute.
…s the first element of an array. Using x[:options][:my_key] instead.
0f55a86
to
4a5e5dc
Compare
@@ -0,0 +1,140 @@ | |||
module ManageIQ |
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.
@fdupont-redhat
Didn't this file get moved when you moved the MiqAe to MiqAe.class. This is not a new file.
Have you rebased after your PR got merged?
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 have made changes to handle generic error messages. I confirm that I have rebased.
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.
The existing files are named with underscore characters: weighted_update_status.rb
and weighted_update_status.yaml
. This PR is adding additional files without underscores in the names.
@fdupont-redhat Please correct.
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.
You're correct. I had renamed the files for consistency with the method name, which has no underscore.
@@ -0,0 +1,73 @@ | |||
--- |
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.
@fdupont-redhat
Even this one was in the MiqAe move to MiqAe.class
Some comments on commits fabiendupont/manageiq-content@b9469bf~...20ce583 content/automate/ManageIQ/Transformation/Infrastructure/VM/rhevm.class/methods/setdescription.rb
|
Checked commits fabiendupont/manageiq-content@b9469bf~...20ce583 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 content/automate/ManageIQ/Transformation/Common.class/methods/acquiretransformationhost.rb
content/automate/ManageIQ/Transformation/Common.class/methods/assesstransformation.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/Common.class/methods/poweroff.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/Common.class/methods/poweron.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/rhevm.class/methods/checkpoweredon.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/rhevm.class/methods/checkvmininventory.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/rhevm.class/methods/setdescription.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/vmwarews.class/methods/collapsesnapshots.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/vmwarews.class/methods/setmigrated.rb
content/automate/ManageIQ/Transformation/Infrastructure/VM/vmwarews.class/methods/utils.rb
content/automate/ManageIQ/Transformation/TransformationHosts/ovirt_host.class/methods/vmchecktransformed_vmwarews2rhevm_vddk.rb
content/automate/ManageIQ/Transformation/TransformationHosts/ovirt_host.class/methods/vmtransform_vmwarews2rhevm_vddk.rb
|
The remaining rubocop errors use the implicit rescue style and is consistent with the existing code base. Rubocop changed their default setting for this check and I prefer keeping them this way for consistency. The recent rubocop change is being discussed here: ManageIQ/guides#310 |
Then go vote, @gmcculloug ! 😉 |
Thanks @fdupont-redhat. I opened issue #315 to address refactoring and spec concerns. |
Add V2V for VMware to oVirt / RHV (cherry picked from commit dc72f1f)
Gaprindashvili backport details:
|
This PR aims at merging the code maintained in https://github.com/fdupont-redhat/v2v-automate/ in the manageiq-content repository, so that it can be shipped with the appliance.
Related PR: #312