How to remove stale hosts from VCF inventory by enabling force to decommission.
search cancel

How to remove stale hosts from VCF inventory by enabling force to decommission.

book

Article ID: 325780

calendar_today

Updated On:

Products

VMware Cloud Foundation

Issue/Introduction

The purpose is to support the GSS to remove stale hosts from VCF inventory, When users remove the dead hosts directly from Vcenter instead of using VCF remove domain workflows, later when they try to remove the host from VCF there may be some issues while removing the host from inventory.

Environment

Vmware Cloud Foundation 4.5
VMware Cloud Foundation 5.0
VMware Cloud Foundation 4.x

Resolution

Currently no resolution is available.

Workaround:
There is already a support (from VCF 4.5 release) in domain workflows (remove host from cluster) to remove of the stale hosts, if its removed from
un standardized procedures out of VCF workflows.

From VCF 5.0 release onwards in decommission workflow, there will be a flag(default disabled) which needs to be passed to decommission workflow API in-case the Domain-workflow (remove host from cluster) fails to remove the stale host.

Steps:
This is supported from only API,
1. Either SSH to sddc-manager or execute the API's from any rest client, provided the sample with curl command

2. Get the bearer auth token with following API,

Example: curl -X POST -H "Content-Type: application/json" -d '{"username": "<<SDDC SSO username>>","password": "<<SDDC SSO password>>"}' http://localhost/v1/tokens | json_pp

3. Copy the bearer token and provide same in bearer token section in the following decommission API by enabling force flag to remove only the stale hosts which are not required to be part of any workload domain, provide FQDNS of only dead hosts or stale hosts

Example: curl -k 'https://sddc-manager.vrack.vsphere.local/v1/hosts?force=true' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9....' \
    -d '[{
            "fqdn" : "esxi-4.vrack.vsphere.local"
         },
         {
           "fqdn" : "esxi-5.vrack.vsphere.local"
         }
       ]'

Note: Please be cautious while providing the FQDN, provide only those FQDN's(stale hosts FQDN's) which are actually to be removed from VCF inventory, force flag will not do any check whether the host is part of any cluster or not, it will just cleanup inventory and host related configurations in SDDC-Manger.