Remove instances from a Vultr cluster in bulk or individually. Detached instances remain on your account as standalone servers with fabric removed.
Removing instances from a cluster detaches them from the cluster and removes their fabric networking associations. The instances are not destroyed, they remain on your account as standalone servers.
This guide explains how to remove instances from a cluster using the Vultr API.
Send a GET request to the List Clusters endpoint to retrieve all clusters.
$ curl "https://api.vultr.com/v2/clusters" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id of the cluster from which you want to remove instances.
Send a GET request to the Get Cluster endpoint to retrieve the cluster details. Replace {cluster-id} with the cluster id.
$ curl "https://api.vultr.com/v2/clusters/{cluster-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id of the instance(s) you want to remove from the cluster.
Send a POST request to the Bulk Remove Instances endpoint to remove multiple instances from the cluster. Replace {cluster-id} with the cluster id and provide the instance IDs in the instances array. Set action to remove.
$ curl "https://api.vultr.com/v2/clusters/{cluster-id}" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"action": "remove",
"instances": [
"INSTANCE-ID-1",
"INSTANCE-ID-2"
]
}'
A successful request returns an HTTP 202 Accepted response.
Send a GET request to the Get Cluster endpoint to retrieve the cluster details.
$ curl "https://api.vultr.com/v2/clusters/{cluster-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the removed instances no longer appear in the cluster's instance list.
Send a POST request to the Remove Single Instance endpoint to remove a single instance from the cluster. Replace {cluster-id} with the cluster id and {instance-id} with the instance id.
$ curl "https://api.vultr.com/v2/clusters/{cluster-id}/remove/{instance-id}" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}"
A successful request returns an HTTP 202 Accepted response.
Send a GET request to the Get Cluster endpoint to retrieve the cluster details.
$ curl "https://api.vultr.com/v2/clusters/{cluster-id}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the instance no longer appears in the cluster's instance list.