DEBUG [vcf_dm,68c8...................] [c.v.v.c.f.a.RemoveClusterGetInventoryAction,dm-exec-20] Validate not default cluster
ERROR [vcf_dm,68c8...................] [c.v.e.s.o.model.error.ErrorFactory,dm-exec-20] [#####] DEFAULT_CLUSTER Trying to remove default cluster <cluster-name_to_be_deleted>
com.vmware.evo.sddc.orchestrator.exceptions.OrchTaskException: Trying to remove default cluster <cluster-name_to_be_deleted>Note: This is a destructive operation. Please ensure that all necessary backups and snapshots are taken prior to proceeding with the steps below to avoid any issue.
To be able to delete the current default cluster of a Workload Domain, we have to set the cluster in the Workload Domain as not default, so that the cluster delete option is available in UI or API.
su root)curl 127.0.0.1/inventory/clusters | json_ppSample output
[
{
"datacenterSourceId" : "datacenter-3",
"domainId" : "<domain-id>",
"id" : "<cluster-id_to_be_deleted>",
"isDefault" : true, ==================> This shows cluster is marked as default
"isImageBased" : true,
"isImported" : false,
"isStretched" : false,
"primaryDatastoreSourceId" : "datastore-##",
"primaryDatastoreType" : "NFS",
"sourceId" : "domain-c##",
"status" : "ACTIVE",
"vcenterId" : "<vcenter-id>",
"vdsIds" : [
"<vds-id>"
]
},
]psql -h localhost -U postgres -d platform -c "select id,name,is_default from cluster"Sample output
id | name | is_default
--------------------------------------+---------------+------------
<cluster-id_to_be_deleted> | wld01cluster1 | t
<mgmt_cluster_id> | mgmtdom-cl01 | t
<cluster02_ID> | wld01cluster2 | fcurl 127.0.0.1/inventory/clusters?id=<cluster-id_to_be_deleted> | json_pp > wld01cluster1.jsonvi wld01cluster1.json{
"datacenterSourceId" : "datacenter-3",
"domainId" : "<domain-id>",
"id" : "<cluster-id_to_be_deleted>",
"isDefault" : false, ==================> Cluster default status is false
"isImageBased" : true,
"isImported" : false,
"isStretched" : false,
"primaryDatastoreSourceId" : "datastore-##",
"primaryDatastoreType" : "NFS",
"sourceId" : "domain-c##",
"status" : "ACTIVE",
"vcenterId" : "<vcenter-id>",
"vdsIds" : [
"<vds-id>"
]
},Esc > :wq!curl -s -X PUT "http://localhost/inventory/clusters/<cluster-id_to_be_deleted>" -H "Content-Type: application/json" -d @wld01cluster1.jsoncurl 127.0.0.1/inventory/clusters?id=<cluster02_ID> | json_pp > wld01cluster02.jsonvi wld01cluster02.json {
"datacenterSourceId" : "datacenter-3",
"domainId" : "<domain-id>",
"id" : "<cluster02_ID>",
"isDefault" : true, ==================> Cluster default status is true
"isImageBased" : true,
"isImported" : false,
"isStretched" : false,
"primaryDatastoreSourceId" : "datastore-##",
"primaryDatastoreType" : "NFS",
"sourceId" : "domain-c##",
"status" : "ACTIVE",
"vcenterId" : "<vcenter-id>",
"vdsIds" : [
"<vds-id>"
]
},Esc>:wq!Note: No other changes/updates to be done in the json
curl -s -X PUT "http://localhost/inventory/clusters/<cluster02_ID>" -H "Content-Type: application/json" -d @wld01cluster02.jsonsystemctl restart domainmanager