---
title: "Detach VMs"
method: PUT
path: "/azure/compute/group/{groupId}/detachVms"
tags: ["Elastigroup Azure Spot VMs"]
---

# Detach VMs

`PUT /azure/compute/group/{groupId}/detachVms`

Scale down specific virtual machines in Elastigroup cluster.

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref
- `#/paths/~1aws~1ec2~1group~1%7BgroupId%7D/put/parameters/0` — unresolved $ref

## Request body

- object
  - `vmsToDetach` string[], required — Array of virtual machine names to detach.
  - `shouldTerminateVms` boolean, required — Whether to terminate the VMs or not.
  - `shouldDecrementTargetCapacity` boolean, required — Prevent Elastigroup from scaling back to target capacity when virtual machines are detached.
  - `shouldDeregisterVmFromLb` boolean — Indicates whether to deregister the stateful node's VM from any type of load balancer. Will only be applied if the shouldTerminateVms is 'false'
  - `drainingTimeout` string — The time in seconds to allow the virtual machine be be drained from incoming TCP connections and detached from MLB before terminating it.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
