How To Manually Apply Roles On a Host Using API Calls
Problem
Environment
Procedure
1
$ export OS_TOKEN=<GENERATED_FROM_ABOVE>
$ export DU=<DU_FQDN>
$ export HOST_ID=<HOST_UUID>2
$ curl -sS -H "x-auth-token: $OS_TOKEN" '$DU/resmgr/v1/hosts/$HOST_ID' | jq '{hostconfig_id, roles, role_status}'
{
"hostconfig_id": "[HOSTCONFIG_UUID]",
"roles": [
"pf9-cindervolume-base",
"pf9-cindervolume-config",
"pf9-glance-role",
"pf9-ha-slave",
"pf9-neutron-base",
"pf9-ostackhost-neutron",
"pf9-support"
],
"role_status": "ok"
}3
$ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-ostackhost-neutron $ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-neutron-base $ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-neutron-ovn-controller $ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-neutron-ovn-metadata-agent $ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-ip-discovery$ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-cindervolume-base $ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-cindervolume-config$ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-glance-role$ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-support$ curl -X PUT -H "x-auth-token: $OS_TOKEN" -H 'content-type: application/json' '$DU/resmgr/v1/hosts/$HOST_ID/roles/pf9-ha-slave
4
$ tail -f /var/log/pf9/hostagent.log
Validation
$ dpkg -l | grep pf9$ curl -sS -H "x-auth-token: $OS_TOKEN" '$DU/resmgr/v1/hosts/$HOST_ID' | jq '{hostconfig_id, roles, role_status}'
PreviousVirsh Commands run Infinitely Without Output / VM Console InaccessibleNextMetalLB VIP Connectivity Issues When Accessing VIP Externally
Last updated
