Force Remove the Host Role From DB

Problem

Unable to remove a host role from a specific host via the Platform9 UI, pcdctl and curl command. The UI shows an RoleUpdateConflict error when attempting to deauthorize and decommission the host.

$  curl -s -X DELETE -H "X-Auth-Token: $token" https://<PCD_FQDN>/resmgr/v2/hosts/<HOST-UUID>/roles/<ROLE_NAME> -vvv
...
"message":"RoleUpdateConflict: Role cannot be updated in the current state: Cannot remove role [ROLE_NAME] from host [HOST_UUID] in the current state".

Environment

  • Self-Hosted Private Cloud Director Virtualization

  • Component: ResMgr

Cause

The host role remained in a not-applied state in the backend database, which blocked further updates or role removal actions through the UI. This inconsistency prevented the host from being deauthorized or decommissioned.

Diagnostics

These steps are applicable only for Self-hosted Private Cloud Director product

To check the role state:

  1. Login to the resmgr DB:

  1. Check the role state:

The not-applied state indicates that the role was not fully or correctly applied, resulting in a conflict when attempting UI-based role changes.

Resolution

  1. Delete the role from the backend database:

  1. Verify that the role mapping has been removed:

  1. Optionally, delete the host from the database if needed:

  1. Purge PF9 packages (if host is being decommissioned):

  1. Clean up PF9 services and directories:

Validation

  • Confirm that the role mapping associated with the host has been removed

  • The host is no longer listed in the UI under Infrastructure > Hosts.

  • If re-onboarding, reauthorize the host and apply roles cleanly.

  • Review logs (/var/log/pf9/hostagent.log, /var/log/pf9/comms/) to ensure role application is successful.

Last updated