Description of problem:Customer is asking how to use automate to delete a host instance from the VMDB. Version-Release number of selected component (if applicable): 5.5 How reproducible: This is a question for which I can find no answer or example in any existing automation documentation Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: Use Case provided by customer: "We have a automated process to provision a host. So, before provisioning a new host we want to check if there is any host with that name in the VMDB. If it exists want to remove that automatically. This is required in a case where provisioning is failed and we had to rebuild the host."
John - I would like to clarify that this enhancement is only asking for the ability to delete the instance in the VMDB and that it does not include any provider level calls to delete a host defined in on a provider (ext_management_system).
https://github.com/ManageIQ/manageiq-automation_engine/pull/93
New commit detected on ManageIQ/manageiq-automation_engine/master: https://github.com/ManageIQ/manageiq-automation_engine/commit/2c9a55ddf3e273000025f295a4a972b8483bc406 commit 2c9a55ddf3e273000025f295a4a972b8483bc406 Author: Greg McCullough <gmccullo> AuthorDate: Tue Oct 24 15:42:11 2017 -0400 Commit: Greg McCullough <gmccullo> CommitDate: Wed Oct 25 10:54:47 2017 -0400 Add remove_from_vmdb method to Host object for Service models Create mixin to DRY-up existing methods from other models. https://bugzilla.redhat.com/show_bug.cgi?id=1334930 .../service_models/miq_ae_service_host.rb | 2 ++ .../service_models/miq_ae_service_load_balancer.rb | 9 ++------- .../service_models/miq_ae_service_orchestration_stack.rb | 9 ++------- .../service_models/miq_ae_service_service.rb | 9 ++------- .../service_models/miq_ae_service_vm_or_template.rb | 9 ++------- .../mixins/miq_ae_service_remove_from_vmdb_mixin.rb | 10 ++++++++++ 6 files changed, 20 insertions(+), 28 deletions(-) create mode 100644 lib/miq_automation_engine/service_models/mixins/miq_ae_service_remove_from_vmdb_mixin.rb
Verified in 5.9.0.5. $evm.vmdb(:Host).all.last.remove_from_vmdb works as expected.
Issue has been verified, clearing needinfo.
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/RHSA-2018:0380