Cns Volume Manager Cns Relocate Volume

Cns Volume Manager Cns Relocate Volume

Relocate container volume from the current source datastore to another destination datastore.

Currently, it supports for a single block volume only.

This API comes with the following limitations:

  • Any CNS control operations like attach, detach, update, expand, etc on a volume being relocated or any other volume attached to the same VM as the volume being relocated will fail with CnsFault, see CnsFault.
  • VMC is not fully supported for this API.
  • Please see guidelines and limitations of CNS relocate on vSphere.

If an array of empty spec is passed or the size of the input spec is not equal to 1, the operation will fail.

Following privileges will be required on specified entities, to perform this operation.

  • Datastore.FileManagement on both the source datastore, and the destination datastore specified in input, which is required for block volume only
  • Resource.ColdMigrate on the virtual machine that volume is attached to, which is required for attached block volume only.
  • Datastore.AllocateSpace on the target datastore
  • Resource.HotMigrate on the virtual machine that volume is attached to, if the vm is powered on, which is required for attached block volume only

Faults that can be set in individual result entry, corresponding to each VolumeRelocateSpec instance in input:

  • vmodl.fault.InvalidArgument set in case of invalid input arguments, invalid formats.
  • vim.fault.NotFound set in case the volume or datastore in the spec can not be found.
  • vim.fault.CnsFault set in case of any other failure scenarios.
Request
URI
POST
https://{api_host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsRelocateVolume
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case CnsVolumeManager/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 9.0.0.0 APIs.


Request Body
CnsRelocateVolumeRequestType of type(s) application/json
Required
"CnsRelocateVolumeRequestType Object"
array of object
relocateSpecs
Required

Specifications for volumes to be relocated. Block volume relocation should use the child class spec, see CnsBlockVolumeRelocateSpec.

Authentication
This operation uses the following authentication methods.
Responses
200

Task to track the progress and overall state of this operation.

Returns MoRefTask of type(s) application/json
"MoRefTask Object"

500

AlreadyExists: Thrown in case volume is already migrated to the specified destination datastore.

InvalidArgument: Thrown in case of invalid input arguments, such as invalid volume or datastore format, or empty volume IDs

NotFound: if the volume or datastore can not be found.

CnsFault: Thrown for all other failure scenario.

Returns MethodFault of type(s) application/json
This response body class contains all of the following: InlineMethodFault0
"MethodFault Object"
faultCause
Optional

Fault which is the cause of this fault.

array of object
faultMessage
Optional

Message which has details about the error Message can also contain a key to message catalog which can be used to generate better localized messages.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsRelocateVolume