[Satellite 6.0]De-Activate host from Satellite server via CLI/API call

Solution Unverified - Updated -

Environment

  • Red Hat Satellite

Issue

  • How to De-Activate Content Host on Satellite server,instead of deleting content host.

Resolution

  • Find the Host ID.
hammer shell
hammer> host list 
[Foreman] Password for admin: 
---|---------------------------------|------------------|------------|-------------|------------------
ID | NAME                            | OPERATING SYSTEM | HOST GROUP | IP          | MAC              
---|---------------------------------|------------------|------------|-------------|------------------
1  | satellite.example.com           | RedHat 7.3       |            | 10.65.10.13 | 00:16:3e:74:02:91
2  | client.example.com              | RedHat 6.6       |            | 10.65.5.92  | 00:16:3e:74:01:d7
Here Host-ID=2.
  • Find the Subscriptions ID for the host.
hammer> subscription list --organization="Default Organization" --host-id='2'
---|----------------------------------|--------------|----------|---------|--------------|----------|----------|------------------------------|----------|---------
ID | UUID                             | NAME         | CONTRACT | ACCOUNT | SUPPORT      | QUANTITY | CONSUMED | END DATE                     | QUANTITY | ATTACHED
---|----------------------------------|--------------|----------|---------|--------------|----------|----------|------------------------------|----------|---------
1  | 8ac18a8d5b48d95b015b48f4aaf002a0 | XXX | 10169621 | 540155  | Self-Support | 1        | 1        | 2022-01-01T04:59:59.000+0000 | 1        | 1       
---|----------------------------------|--------------|----------|---------|--------------|----------|----------|------------------------------|----------|---------
Here Subscription-ID=1.
  • Remove subscriptions for Host.
hammer> host subscription remove --subscription-id='1' --host-id='2'
Subscription removed from the host successfully
  • Verify the status on content host.
[root@client1 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Invalid

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments