Bug 1623636
Summary: | [RFE] Allow for Instance Calls in Automate State Machine to Specify a Different Zone for Task to be Run | ||
---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | myoder |
Component: | Automate | Assignee: | Lucy Fu <lufu> |
Status: | CLOSED ERRATA | QA Contact: | Nandini Chandra <nachandr> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 5.9.0 | CC: | ghubale, greartes, jocarter, lufu, mfeifer, mkanoor, obarenbo, simaishi, tfitzger |
Target Milestone: | GA | Keywords: | FutureFeature, RFE |
Target Release: | 5.11.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | 5.11.0.5 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-12-12 13:34:23 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | Feature | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | Ansible | Target Upstream Version: | |
Embargoed: |
Description
myoder
2018-08-29 19:04:11 UTC
This is the current work around, and a question if there is a better way to do this: If i run it through a method with option[:miq_zone] set then it works as expected. while this is a nice work around its not as efficient as just creating an instance for the playbooks we need (vs an entire method). is there a way to modify launch_ansible_job to take that option? def ansible_inventory() attrs = {} attrs['job_template_name'] = "ansible_inventory" attrs['dialog_param_host_name'] = @vm.name attrs['dialog_param_host_ip'] = @vm.ipaddresses.first attrs['dialog_param_host_action'] = @action attrs['dialog_param_inventories'] = @inventories attrs['Vm::vm'] = @vm.id options = {} options[:namespace] = ANSIBLE_NAMESPACE options[:class_name] = ANSIBLE_STATE_MACHINE_CLASS options[:instance_name] = ANSIBLE_STATE_MACHINE_INSTANCE options[:user_id] = $evm.vmdb(:user).find_by_userid('admin').id options[:miq_zone] = "Internal Vmware Zone" options[:attrs] = attrs auto_approve = true $evm.execute('create_automation_request', options, 'admin', auto_approve) end Kind Regards, Yoder New commits detected on ManageIQ/manageiq-providers-ansible_tower/master: https://github.com/ManageIQ/manageiq-providers-ansible_tower/commit/26a58b6b21028398ccaa2ce9f5dd46aef6d8f918 commit 26a58b6b21028398ccaa2ce9f5dd46aef6d8f918 Author: Lucy Fu <lufu> AuthorDate: Mon Apr 29 17:17:13 2019 -0400 Commit: Lucy Fu <lufu> CommitDate: Mon Apr 29 17:17:13 2019 -0400 Queue signal with specified priority. https://bugzilla.redhat.com/show_bug.cgi?id=1623636 app/models/manageiq/providers/ansible_tower/automation_manager/template_runner.rb | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) https://github.com/ManageIQ/manageiq-providers-ansible_tower/commit/ed8b3bd86e1986bb370e4688eb14a85a3c725321 commit ed8b3bd86e1986bb370e4688eb14a85a3c725321 Author: Lucy Fu <lufu> AuthorDate: Mon Apr 29 17:18:46 2019 -0400 Commit: Lucy Fu <lufu> CommitDate: Mon Apr 29 17:18:46 2019 -0400 Add method wait_on_ansible_job. https://bugzilla.redhat.com/show_bug.cgi?id=1623636 app/models/manageiq/providers/ansible_tower/automation_manager/template_runner.rb | 17 +- spec/models/manageiq/providers/ansible_tower/automation_manager/template_runner_spec.rb | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) New commit detected on ManageIQ/manageiq-automation_engine/master: https://github.com/ManageIQ/manageiq-automation_engine/commit/097396efa58872928aa4a353612e71a5ab79894b commit 097396efa58872928aa4a353612e71a5ab79894b Author: Lucy Fu <lufu> AuthorDate: Tue May 7 11:25:11 2019 -0400 Commit: Lucy Fu <lufu> CommitDate: Tue May 7 11:25:11 2019 -0400 Expose Ansible Tower TemplateRunner to service model. https://bugzilla.redhat.com/show_bug.cgi?id=1623636 lib/miq_automation_engine/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-template_runner.rb | 10 + spec/service_models/miq_ae_service_manageiq-providers-ansible_tower-automation_manager-template_runner_spec.rb | 19 + 2 files changed, 29 insertions(+) New commit detected on ManageIQ/manageiq-content/master: https://github.com/ManageIQ/manageiq-content/commit/f28660823cc4bed63e3b163bf0d48d7027babf64 commit f28660823cc4bed63e3b163bf0d48d7027babf64 Author: Lucy Fu <lufu> AuthorDate: Mon Apr 29 17:15:31 2019 -0400 Commit: Lucy Fu <lufu> CommitDate: Mon Apr 29 17:15:31 2019 -0400 Launch ansible job with a specified zone. https://bugzilla.redhat.com/show_bug.cgi?id=1623636 content/automate/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job.class/__methods__/launch_ansible_job.rb | 20 +- spec/content/automate/ManageIQ/AutomationManagement/AnsibleTower/Operations/StateMachines/Job.class/__methods__/launch_ansible_job_spec.rb | 14 +- 2 files changed, 32 insertions(+), 2 deletions(-) Lucy, Thanks for Zone selection is only for catalog item and should not be available for catalog bundle. After remove the zone for catalog bundle, test went thru with two catalog item provisioning requests sent to different zones. [----] I, [2019-07-08T16:44:43.492188 #46697:2ac533e1c5bc] INFO -- : MIQ(MiqGenericWorker::Runner#get_message_via_drb) Message id: [99000000004544], MiqWorker id: [99000000000055], Zone: [], Role: [ems_operations], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [99000000000026], Task id: [], Command: [ServiceTemplateProvisionTask.execute], Timeout: [600], Priority: [100], State: [dequeue], Deliver On: [], Data: [], Args: [], Dequeued in: [5.914896029] seconds [----] I, [2019-07-08T16:44:43.492328 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(MiqQueue#deliver) Message id: [99000000004544], Delivering... [----] I, [2019-07-08T16:44:43.600044 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(ServiceTemplateProvisionTask#execute) Executing Service_Template_Provisioning request: [Provisioning [bundle] for Service [bundle]] [----] I, [2019-07-08T16:44:43.898296 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(ServiceTemplateProvisionTask#execute) Service_Template_Provisioning initiated [----] I, [2019-07-08T16:44:43.950055 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(ServiceTemplateProvisionTask#deliver_to_automate) Queuing Service_Template_Provisioning: [Provisioning [vsphere] for Service [vsphere]]... [----] I, [2019-07-08T16:44:44.112806 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(MiqQueue.put) Message id: [99000000004549], id: [], Zone: [default], Role: [automate], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [], Task id: [], Command: [MiqAeEngine.deliver], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: [{:object_type=>"ServiceTemplateProvisionTask", :object_id=>99000000000027, :namespace=>"Service/Provisioning/StateMachines", :class_name=>"ServiceProvision_Template", :instance_name=>"CatalogItemInitialization", :automate_message=>"create", :attrs=>{"request"=>"clone_to_service", :service_action=>"Provision", "Service::Service"=>99000000000017}, :user_id=>99000000000001, :miq_group_id=>99000000000002, :tenant_id=>99000000000001}] [----] I, [2019-07-08T16:44:44.146298 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(ServiceTemplateProvisionTask#deliver_to_automate) Queuing Service_Template_Provisioning: [Provisioning [ansible-job] for Service [ansible-job]]... [----] I, [2019-07-08T16:44:44.424360 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(MiqQueue.put) Message id: [99000000004550], id: [], Zone: [zone1], Role: [automate], Server: [], MiqTask id: [], Ident: [generic], Target id: [], Instance id: [], Task id: [], Command: [MiqAeEngine.deliver], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: [{:object_type=>"ServiceTemplateProvisionTask", :object_id=>99000000000030, :namespace=>"AutomationManagement/AnsibleTower/Service/Provisioning/StateMachines", :class_name=>"Provision", :instance_name=>"CatalogItemInitialization", :automate_message=>"create", :attrs=>{"request"=>"clone_to_service", :service_action=>"Provision", "Service::Service"=>99000000000018}, :user_id=>99000000000001, :miq_group_id=>99000000000002, :tenant_id=>99000000000001}] [----] I, [2019-07-08T16:44:44.452755 #46697:2ac533e1c5bc] INFO -- : Q-task_id([r99000000000009_service_template_provision_task_99000000000026]) MIQ(ServiceTemplateProvisionTask#do_request) Service Provision started Reported the following BZ so that the zone selection option can be removed for catalog bundles. https://bugzilla.redhat.com/show_bug.cgi?id=1728309 Zone selection shouldn't be available for catalog bundles Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:4199 |