-
Notifications
You must be signed in to change notification settings - Fork 125
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
Create a ConversionHost table #242
Conversation
@fdupont-redhat What other properties do we need to add to a conversion host? |
@agrare If it's a VM, how do we get the credentials ? For the host it's already there, but AFAIK it's not for the VM. Or at least it's not visible in the UI. |
@fdupont-redhat that's a different issue :) Lets tackle that in a different PR/Trello card. |
@agrare LGTM, then. |
@fdupont-redhat really nothing else? Maybe a version string? |
We don't really have a notion of version, but capabilities might be good. Currently, we use tags to store the transport method, but it could be an attribute. Could it be a JSON field ? I don't know what we could store in there: virt-v2v capabilities, transport methods, other things that we don't know yet. |
E.g. some Conversion host build number would be nice to detect old ones.. |
I can imagine storing various capabilities and versions could make sense. But that brings the question how will you keep them up-to-date with what's really on the host? |
@nyoxi that would have to be done by whoever communicates with the code on the conversion host. This won't be able to be updated by inventory refresh because it won't be based on properties available to the RefreshWorker in provider inventory. |
Okay @nyoxi I added a version string and a serialized capabilities so we can have some flexibility in what we store there. As long as we're not planning on doing any queries based on capabilities we should be good with that. |
@agrare we do requests based on capabilities. Currently, the only capability we use in transport_method, which can be vddk, ssh, whatever we come up with. IIUC, it might be a good idea to have a specific column for that one, isn't it ? |
@bdunne can you take a look? |
Yes it would, I was going off of:
which seemed pretty vague 😄 If a transport_method string column is all that you need then I'll add that. |
That's all I need. It's the only attribute that is used during host selection, apart from current number of migrations which is calculated. |
@fdupont-redhat is that going to be a single value or is it possible for multiple to be supported? |
In the current implementation, we use a single value as it also decides the transport method to use for the migration. But IMO, it should be a per-mapping/plan/vm choice. So, being able to use the same host for many transport methods should be possible, as I don't see why a conversion wouldn't be able to use more than one transport method. Please make it a multiple value attribute. |
Going to need multiple columns then, don't want to be doing LIKE queries on a comma separated list :/ |
You mean one boolean column per transport method, right ? |
@fdupont-redhat correct, is this something that can be inferred from the version? Or is it something that could be different for conversion hosts on the same version? |
t.string :name | ||
t.string :address | ||
t.string :type | ||
t.string :resource_type |
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.
t.references :resource, :type => :bigint, :polymorphic => true
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.
👍 that's slick
@agrare It's not related to the version. Version will most likely refer to ovirt-ansible-v2v-conversion-host package version. |
@fdupont-redhat okay I added two columns to represent if vddk and/or ssh transport is supported, PTAL |
👍 |
@bdunne what do you think about disabling this cop? I think this goes against how we want migrations to be written. |
@@ -0,0 +1,6 @@ | |||
class AddConversionHostIdToMiqTasks < ActiveRecord::Migration[5.0] | |||
def change | |||
add_column :miq_tasks, :conversion_host_id, :bigint |
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.
This feels very specific, is there some doc / design I can look describing how this will be used?
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.
We wanted to add a method for throttling how many tasks run on a conversion host without having to loop through all active tasks and pull the conversion host out of the task options.
I don't see a trello card yet (/cc @fdupont-redhat) but there is an ongoing design doc here https://docs.google.com/document/d/1ANBPzDLF-id3MS9_8ztmrNjNwh3FJ6yGCvA2BUE808c/edit#heading=h.lzsppid3wjo9
Since this is still in design maybe we should hold off on this and come back and add this 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.
Here's the Trello card: https://trello.com/c/DOClRvfD/189-migration-throttling-cf-model
8646c7a
to
cf1a489
Compare
Checked commits agrare/manageiq-schema@ad331a4~...cf1a489 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 db/migrate/20180807153714_add_conversion_host_table.rb
|
@agrare As the How would you implement the polymorphism ? In the ConversionHost class using |
@fdupont-redhat it was for the case where the conversion host is not in MIQ inventory e.g. a bare metal conversion host. It looks like both the host and the vm models have an |
@agrare Thanks for the refresh. I'll create IP address methods in ConversionHost class. |
This adds a table for conversion hosts which can be polymorphically related to other inventory items i.e. Vms/Hosts.