Bug 1552671
Summary: | [RFE][XS-2] Add possibility to unregister a VM in RHV provider | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Satoe Imaishi <simaishi> | ||||||||
Component: | Providers | Assignee: | Moti Asayag <masayag> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | Ilanit Stein <istein> | ||||||||
Severity: | high | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 5.8.0 | CC: | cpelland, gblomqui, greartes, jfrey, jhardy, jocarter, masayag, mfeifer, mperina, myoder, nzunigaf, obarenbo, simaishi, tfitzger | ||||||||
Target Milestone: | GA | Keywords: | FutureFeature, RFE, ZStream | ||||||||
Target Release: | 5.9.2 | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | 5.9.2.0 | Doc Type: | Enhancement | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | 1536628 | Environment: | |||||||||
Last Closed: | 2018-05-07 20:43:22 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | RHEVM | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | 1536628 | ||||||||||
Bug Blocks: | 1554897 | ||||||||||
Attachments: |
|
Comment 2
CFME Bot
2018-03-07 14:12:50 UTC
Verified on CFME-5.9.2.1/RHV-4.2.2-5: 1) In Automate->Explorer added a new domain and a namespace. (As a reference, this link can be used to create the domain/namespace: https://pemcg.gitbooks.io/introduction-to-cloudforms-automation/content/chapter1/methods.html See the "hello world" method creation flow. Copy instance Redhat-> Infrastructure->VMware->VimApi->"VMware_HotAdd_Disk" to the created namespace path. (See 'unregister_vm_copy_instance.png' attached). 2) Edit the Instance name into "Unregister_vm", and the method name into "unregister_vm". (See 'add_method_for_unregister.png' attached) Set the method type as inline, and add this content: # # Description: This method is used to unregister a vm # # Inputs: vm_name # # Get vm object vm_name = $evm.root['vm_name'] $evm.log("info", "-------->>>> Trying to unregister VM: <#{vm_name}>") $evm.root['vm'] = $evm.vmdb('vm').find_by_name(vm_name) vm = $evm.root['vm'] raise "Missing $evm.root['vm'] object" unless vm vm.unregister 3) Then run Automate->Simulation, with vm_name of VM that we want to unregister. This VM should have a disk that is not of an existing template, and should be in state down for the unregister succeed. (See automate_simulation.png) Once the simulation operation is complete, the VM should be removed, and it's disks should remain (not removed). In case of there is a problem, check CFME automation/evm.log Created attachment 1422569 [details]
automate_simulation.png
Created attachment 1422570 [details]
add_method_for_unregister.png
Created attachment 1422572 [details]
unregister_vm_copy_instance.png
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:1328 |