Volume Attachment

Detach volumes from virtual machine

Detaches one or more volumes currently attached to a virtual machine. Include the virtual machine ID in the path and the volume IDs in the request body to detach the specified volumes from the designated virtual machine.

State requirement: This operation requires the VM to be in the ACTIVE or SHUTOFF state.

post/core/virtual-machines/{vm_id}/detach-volumes

Request

  • Base URL: https://infrahub-api.nexgencloud.com/v1
  • URL: https://infrahub-api.nexgencloud.com/v1/core/virtual-machines/{vm_id}/detach-volumes
  • Auth: API key in header api_key

Path parameters

vm_idinteger required

ID of the vm.

Request body

volume_idsinteger[]

Specify one or more IDs of the volumes to be attached to the virtual machine.

Response

Volumes have been successfully detached from the virtual machine.

statusboolean

Whether the request succeeded.

messagestring

Human-readable description of the result.

Example response

{
  "message": "We can process with only in_use volumes.",
  "volume_attachments": [
    {
      "id": 9876,
      "instance_id": 1129,
      "volume_id": 1402,
      "device": "/dev/disk/by-id/virtio-a66fd1a8-e198-4eb4-a",
      "status": "ATTACHING",
      "created_at": "2026-05-07T09:21:55Z"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.