How to Force Remove offline host from PCD Using API call?

Problem

API-driven forced removal of an offline host in PCD.

Environment

  • Private Cloud Director Virtualization

  • Self-Hosted Private Cloud Director Virtualization

Procedure

  1. Obtain an API token using the OpenStack CLI:

$ openstack token issue -f value -c id
  1. Identify the Host ID of the offline host from the UI or using below api call:

$ curl -X GET \\
  -H "X-Auth-Token: <TOKEN_ID>" \\
  "https://<PCD_FQDN>/resmgr/v2/hosts" \\
  | jq '[.[] | {id, hostname: .info.hostname, responding: .info.responding}]'
Sample Output
$ curl -s -X GET \\
  -H "X-Auth-Token: <TOKEN_ID>" \\
  "https://[example-region1.app.pcd.platform9.com]/resmgr/v2/hosts" \\
  | jq '[.[] | {id, hostname: .info.hostname, responding: .info.responding}]'
[
  {
    "id": "[HOST_ID_1]",
    "hostname": "[HOST_NAME_1]",
    "responding": true
  },
  {
    "id": "[HOST_ID_2]",
    "hostname": "[HOST_NAME_2]",
    "responding": false
  },
]
  1. Force Remove the Host:

  1. Once the Host is removed, the associated compute service and network agents must be deleted.

    1. Note the ID of compute service and network agents.

    2. Delete the compute service and network agents associated to Host.

Delete all the network agents configured for the affected host in this case <HOST_ID_2> , listed in the output of command openstack network agent list -c ID -c Agent_Type -c Host | grep <HOST_ID_2>

Last updated