vcenter vm hardware disk: update

Updates the configuration of a virtual disk. An update operation can be used to detach the existing VMDK file and attach another VMDK file to the virtual machine.

Request:

HTTP request

PATCH https://{server}/rest/vcenter/vm/{vm}/hardware/disk/{disk}

Path Parameters

Name Type Description
Required
vm string Virtual machine identifier.
disk string Virtual disk identifier.

Request Body Structure:

{
    "spec"{
        "backing"{
            "type""VMDK_FILE",
            "vmdk_file""string"
        }
    }
}

Request Body Parameters:

Name Type Description
bold = required
spec update_spec Specification for updating the virtual disk.
spec.backing backing_spec Physical resource backing for the virtual disk.

This field may only be modified if the virtual machine is not powered on.

Optional. If unset, the value is unchanged.

spec.backing.type string Backing type for the virtual disk.

Defines the valid backing types for a virtual disk. Value is one of:
VMDK_FILE: Virtual disk is backed by a VMDK file.

spec.backing.vmdk_file string Path of the VMDK file backing the virtual disk.

Optional. It is only relevant when type has value VMDK_FILE. This field is optional and it is only relevant when the value of type is VMDK_FILE.

Response:

HTTP Status Code: 200

None

Errors:

HTTP Status Code Type Description
500 error if the system reports an error while responding to the request.
404 not_found if the virtual machine or virtual disk is not found.
400 not_allowed_in_current_state if one or more of the fields specified in the spec parameter cannot be modified due to the current power state of the virtual machine or the connection state of the virtual disk.
400 resource_busy if the virtual machine is busy performing another operation.
400 resource_inaccessible if the virtual machine's configuration state cannot be accessed.
503 service_unavailable if the system is unable to communicate with a service to complete the request.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user doesn't have the required privileges.