Bug 1356126

Summary: [RFE] Implement host disassociation command
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: HammerAssignee: Shira Maximov <mshira>
Status: CLOSED ERRATA QA Contact: Jan Hutař <jhutar>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: fgarciad, jhutar, jsherril, lhellebr, mshira, pcreech
Target Milestone: 6.5.0Keywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:36:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bryan Kearney 2016-07-13 12:58:30 UTC
We are missing this bit completely from CLI.

From our mailing list:

Anyone know of a command line option in hammer to disassociate a host from
its compute resource?  It's easily done through the GUI however I am
attempting to do this as a part of a larger workflow built in something
like Ansible and need to be able to disassociate via CLI.

Comment 1 Bryan Kearney 2016-07-13 12:58:33 UTC
Created from redmine issue http://projects.theforeman.org/issues/15674

Comment 2 Ivan Necas 2018-06-19 11:38:52 UTC
*** Bug 1592550 has been marked as a duplicate of this bug. ***

Comment 3 Satellite Program 2018-07-09 08:14:00 UTC
Upstream bug assigned to mshira

Comment 4 Satellite Program 2018-07-09 08:14:04 UTC
Upstream bug assigned to mshira

Comment 5 Satellite Program 2018-07-27 12:12:47 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/15674 has been resolved.

Comment 9 Shira Maximov 2018-11-25 08:27:22 UTC
When you create a host that is connected to a compute resource it's automatically associate to the compute resource. 
In order to find out if the host is associate, you should go the the edit host screen, and then in the upper right corner you have a button "Disassociate host", which means the host is associate.

Comment 10 Jan Hutař 2018-11-27 06:46:14 UTC
Thank you Shira!

Looks good (host in question was not installed because of bug 1653558, but created in libvirt compute resource):

[root@satellite ~]# hammer host info --name ken-tenore.nodhcp.local | grep "Compute Resource"
Compute Resource:         laptop
[root@satellite ~]# hammer host disassociate --name ken-tenore.nodhcp.local
The host has been disassociated from VM
[root@satellite ~]# hammer host info --name ken-tenore.nodhcp.local | grep "Compute Resource"
[root@satellite ~]# hammer host disassociate --name ken-tenore.nodhcp.local
The host has been disassociated from VM
[root@satellite ~]# hammer host info --name ken-tenore.nodhcp.local | grep "Compute Resource"
[root@satellite ~]#

satellite-6.5.0-5.beta.el7sat.noarch

=> VERIFIED

Comment 14 errata-xmlrpc 2019-05-14 12:36:19 UTC
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-2019:1222