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

Declare Kubevirt's template as eligible for provision #16873

Merged
merged 1 commit into from
Jan 31, 2018

Conversation

masayag
Copy link
Contributor

@masayag masayag commented Jan 23, 2018

Kubevirt is a virtualization provider that allows to create virtual
machines.

For that purpose, the kubevirt's template should be added to the
eligible for provision list of templates.
Kubevirt is a virtualization provider that allows to create virtual
machines. Currently, it is pretty limited and not fully defined,
therefore the initial dialog allows the user to specific the VM memory
only.

The provider PR that adds the vm provision dialog:
ManageIQ/manageiq-providers-kubevirt#25

@masayag
Copy link
Contributor Author

masayag commented Jan 23, 2018

@miq-bot add_labels gaprindashvili/no, enhancement, providers

@masayag
Copy link
Contributor Author

masayag commented Jan 23, 2018

@pkliczewski please review

:required: false
:display: :edit
:data_type: :string
:sysprep_enabled:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need sysprep options? For MVP we only need cloud-init.

:required: false
:display: :edit
:data_type: :integer
:placement_auto:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that placement is beyond us. The way we interact with kubevirt won't let us interfere with placement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the host placement.

:service:
:description: Catalog
:fields:
:number_of_vms:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need only one for now

Copy link
Contributor

Choose a reason for hiding this comment

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

If this works let's keep it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it does.

:notes_display: :show
:min_length:
:max_length: 255
:pxe_image_id:
Copy link
Contributor

Choose a reason for hiding this comment

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

pxe and iso provisioning is out of the scope for mvp.

@masayag
Copy link
Contributor Author

masayag commented Jan 24, 2018

@miq-bot assign @gmcculloug

@gmcculloug
Copy link
Member

@masayag If you are not using the environment and customize tabs I would consider excluding them from the dialog until they are needed. On the hardware tab I would also review the defined fields and remove the ones that do not apply.

@masayag
Copy link
Contributor Author

masayag commented Jan 24, 2018

@gmcculloug done, removed all of the unused entries from the dialog. Will add them when the provider will support them gradually.

:display: :edit
:default: native_clone
:data_type: :string
:linked_clone:
Copy link
Member

Choose a reason for hiding this comment

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

Is this a likely Kubevirt property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:linked_clone: is used by VMWare and Redhat to describe if the vm creation should be thinly-provisioned or not IIUC. It seems that there is no use case to support it for kubevirt. I'll remove it from the workflow and from yml.

The code that implements the provisioning was merged as part of the branch creation. You can find it here:

https://github.com/ManageIQ/manageiq-providers-kubevirt/blob/master/app/models/manageiq/providers/kubevirt/infra_manager/provision_workflow.rb

Kubevirt is an infra manager/provider.

@gmcculloug
Copy link
Member

@masayag Is there a workflow in progress (wip PR maybe) that would use this dialog? Is the Kubevirt provider being developer similar to a cloud or infra provider or something else?

@masayag
Copy link
Contributor Author

masayag commented Jan 29, 2018

@gmcculloug, removed the :linked_clone: from provider's side as well as from the dialog:
ManageIQ/manageiq-providers-kubevirt#25

The code that implements the provisioning was merged as part of the branch creation. You can find it here:

https://github.com/ManageIQ/manageiq-providers-kubevirt/blob/master/app/models/manageiq/providers/kubevirt/infra_manager/provision_workflow.rb

Kubevirt is an infra manager/provider.

@gmcculloug
Copy link
Member

@masayag I wasn't think about the provider repo when I initially reviewed this PR but it would make sense to move the dialog into the provider repo they way we do for Azure provider today: https://github.com/ManageIQ/manageiq-providers-azure/blob/master/content/miq_dialogs/miq_provision_azure_dialogs_template.yaml (The other dialogs will eventually move as well.)

I think the other change needs to remain in the core repo for now. Sorry for realizing this so late.

Kubevirt is a virtualization provider that allows to create virtual
machines.

For that purpose, the kubevirt's template should be added to the
eligible for provision list of templates.
@masayag masayag changed the title Add provision vm dialog to Kubevirt provider Declare Kubevirt's template as eligible for provision Jan 29, 2018
@masayag
Copy link
Contributor Author

masayag commented Jan 29, 2018

@gmcculloug updated both PRs (this and ManageIQ/manageiq-providers-kubevirt#25)

Thanks for the review.

@miq-bot
Copy link
Member

miq-bot commented Jan 29, 2018

Checked commit masayag@6960e36 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🍰

@lfu
Copy link
Member

lfu commented Jan 29, 2018

@masayag Could you link these two PRs to each other in the PR description, the top comment? Thanks.

super.where(:type => %w(ManageIQ::Providers::Redhat::InfraManager::Template
ManageIQ::Providers::Vmware::InfraManager::Template
ManageIQ::Providers::Microsoft::InfraManager::Template
ManageIQ::Providers::Kubevirt::InfraManager::Template))
Copy link
Member

Choose a reason for hiding this comment

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

@agrare I don't think it needs to be part of this PR but do we have a way to do this in a more pluggable way?

Copy link
Member

Choose a reason for hiding this comment

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

😱 this is really nasty, looking at this and the CloudManager::Template.eligible_for_provisioning methods I think they include.....all of them?

Copy link
Member

Choose a reason for hiding this comment

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

https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/controllers/application_controller/miq_request_methods.rb#L167-L179

Looks like all this really does is show Infra or Cloud templates, why don't they just do ManageIQ::Providers::InfraManager::Template.all or ManageIQ::Providers::CloudManager::Template.all ?

Copy link
Member

Choose a reason for hiding this comment

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

From the Lifecycle -> Provisioning UI we show all templates, and that is not always an accurate list of what templates can be provisioned. I think the best example here is that we did not support Microsoft::InfraManager template provisioning for a while after the templates were available in inventory.

Being able to select a provider's template because it is available in inventory without the supporting provisioning workflow/dialog would lead to UI errors.

From a pluggable solution we need to be able to ask each provider if they support template provisioning and then we can query the appropriate templates.

@masayag
Copy link
Contributor Author

masayag commented Jan 30, 2018

@lfu updated both PRs.

@agrare
Copy link
Member

agrare commented Jan 31, 2018

@gmcculloug looks good to me

1 similar comment
@agrare
Copy link
Member

agrare commented Jan 31, 2018

@gmcculloug looks good to me

@gmcculloug gmcculloug merged commit 0ae4687 into ManageIQ:master Jan 31, 2018
@gmcculloug gmcculloug modified the milestones: Sprint 78 Ending Jan 29, 2018, Sprint 79 Ending Feb 12, 2018 Jan 31, 2018
@masayag masayag deleted the provision_vm_dialog branch June 27, 2018 20:29
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.

6 participants