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

OrchestrationStack provisioning #7

Merged
merged 1 commit into from
Jul 19, 2019
Merged

Conversation

miha-plesko
Copy link
Contributor

@miha-plesko miha-plesko commented Jul 18, 2019

With this commit we implement Deployment Template provisioning aka OrchestrationStack provisioning. Provisioning is supposed to be started from the ServiceCatalogItem of type "Orchestration" which admin is expected to provide with a template deployment JSON. User is then prompted to input template parameter values upon item ordering.

Related PR: ManageIQ/manageiq-ui-classic#5840 (introduces AzureStack as an option on UI)

@miha-plesko miha-plesko added the enhancement New feature or request label Jul 18, 2019
@miha-plesko
Copy link
Contributor Author

@agrare I'll come up with a core PR tomorrow to actually register the azure_stack deployment type, but this code here need to get in anyway so feel free to merge.

@@ -1,4 +1,4 @@
class ManageIQ::Providers::Azure::CloudManager::OrchestrationStack::Status < ::OrchestrationStack::Status
class ManageIQ::Providers::AzureStack::CloudManager::OrchestrationStack::Status < ::OrchestrationStack::Status
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This little typo almost made me mad because orch stack was getting "Succeeded" status upon polling but stack.status.completed? was still reporting false :)

@@ -0,0 +1,105 @@
class ManageIQ::Providers::AzureStack::CloudManager::OrchestrationTemplate < ::OrchestrationTemplate
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This entire file is a copy-paste from Azure provider, not sure whether I should explicitly give credit in a comment or something?

@agrare
Copy link
Member

agrare commented Jul 18, 2019

@bzwei can you help with taking a look?

state = client.deployments.get(resource_group, name).properties.provisioning_state
Status.new(state.downcase, state)
end
rescue => err
Copy link

Choose a reason for hiding this comment

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

Are you able to distinguish stack_not_exist vs stack_status_error? This difference is critical for debugging provisioning issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated.

@@ -1,6 +1,58 @@
class ManageIQ::Providers::AzureStack::CloudManager::OrchestrationStack < ManageIQ::Providers::CloudManager::OrchestrationStack
require_nested :Status

def self.raw_create_stack(ems, stack_name, template, options = {})
Copy link

Choose a reason for hiding this comment

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

Why raw_update_stack method is missing in this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it now, thanks. Didn't plan to do it all in one PR but actually it's not that complicated.

def raw_status
ext_management_system.with_provider_connection(:service => :Resources) do |client|
state = client.deployments.get(resource_group, name).properties.provisioning_state
Status.new(state.downcase, state)
Copy link

Choose a reason for hiding this comment

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

The second argument is the reason. It is very important to retrieve the failure reason from provide. Without clear reason every failure likely produces a support ticket, but often the problem occurs on the provide side rather than the manageiq side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I've added as descriptive message as I could fetch

@miha-plesko
Copy link
Contributor Author

miha-plesko commented Jul 18, 2019

Thanks for review @bzwei I'll apply tomorrow first thing in the morning. Can I ask for your blind guess why I'm not seeing any "Related VMs" on the "My Services" page on UI? Provisioning succeeds and all and inventory gets refreshed so that OrchestrationStack is nicely connected to the related VMs, but UI still won't show any VMs there, nor the related OrchestrationStack. Do I need to do something special to make it visible?

Copy link
Contributor Author

@miha-plesko miha-plesko left a comment

Choose a reason for hiding this comment

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

Thanks for your comments @bzwei , I've pushed the updated version.

@@ -1,6 +1,58 @@
class ManageIQ::Providers::AzureStack::CloudManager::OrchestrationStack < ManageIQ::Providers::CloudManager::OrchestrationStack
require_nested :Status

def self.raw_create_stack(ems, stack_name, template, options = {})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it now, thanks. Didn't plan to do it all in one PR but actually it's not that complicated.

def raw_status
ext_management_system.with_provider_connection(:service => :Resources) do |client|
state = client.deployments.get(resource_group, name).properties.provisioning_state
Status.new(state.downcase, state)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I've added as descriptive message as I could fetch

state = client.deployments.get(resource_group, name).properties.provisioning_state
Status.new(state.downcase, state)
end
rescue => err
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, updated.

@miha-plesko
Copy link
Contributor Author

Sending in additional minor patch to make one for the dialog dropdowns required

With this commit we implement Deployment Template provisioning
aka OrchestrationStack provisioning. Provisioning is supposed
to be started from the ServiceCatalogItem of type "Orchestration"
which admin is expected to provide with a template deployment
JSON. User is then prompted to input template parameter values
upon item ordering.

Signed-off-by: Miha Pleško <[email protected]>
Copy link

@bzwei bzwei left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks.

@bzwei
Copy link

bzwei commented Jul 19, 2019

@miha-plesko The stack and VMs should have been added to the service. You may want to debug starting from https://github.com/ManageIQ/manageiq/blob/master/app/models/service_orchestration.rb#L108.

@agrare agrare merged commit 69165eb into ManageIQ:master Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants