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.
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}
.
The vSphere release schema. The current specification covers vSphere 9.0.0.0 APIs.
"CnsRelocateVolumeRequestType Object"
Specifications for volumes to be relocated. Block volume relocation should use the child class spec, see CnsBlockVolumeRelocateSpec.
Task to track the progress and overall state of this operation.
"MoRefTask Object"
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.
"MethodFault Object"
Fault which is the cause of this fault.
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.
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsRelocateVolume