Cns Volume Manager Cns Update Volume Metadata

Cns Volume Manager Cns Update Volume Metadata

Updates volume metadata, namely labels and container cluster information for the container volumes.

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

  • Datastore.FileManagement on datastores specified in input, required for block volume only
  • Host.Config.Storage on vSAN file service enabled vSAN cluster, required for file volume only

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

  • vmodl.fault.InvalidArgument set in case of invalid but non-empty volume id.
  • vim.fault.NotFound set in case of the volume can not be found.
  • vim.fault.CnsFault set in case of any other failure scenario.
Request
URI
POST
https://{api_host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsUpdateVolumeMetadata
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
CnsUpdateVolumeMetadataRequestType of type(s) application/json
Required
"CnsUpdateVolumeMetadataRequestType Object"
array of object
updateSpecs
Required

Specifications for volumes to be updated.

Authentication
This operation uses the following authentication methods.
Responses
200

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

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

500

InvalidArgument: if:

  • Input size is not equal to 1
  • Volume id in input spec is empty.
  • Volume metadata in input spec has empty cluster info.
  • Entity objects in volume metadata has empty or invalid attributes.
  • EntityMetadata in volume metadata contains duplicate entity types.

NotFound: if the volume can not be found.

CnsNotRegisteredFault: if the volume exists in VC but not registered as CNS volume.

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}/CnsUpdateVolumeMetadata