Cns Volume Manager Cns Create Volume

Cns Volume Manager Cns Create Volume

Creates container volume with given specifications.

Following privileges will be required on specified entities, to perform this operation. For dynamic provisioning, the datastores that does not have the necessary privileges will be ignored and other datastores that have the necessary privileges will be considered for volume placement.

  • 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
  • StorageProfile.View on RootFolder to access storage policy specified in input

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

  • vmodl.fault.InvalidArgument set in case of invalid input arguments, invalid formats, invalid combination of inputs.
  • vim.fault.NotFound set in case the existing disk that should be used to back the container volume cannot be found.
  • vim.fault.CnsFault set in case of any other failure scenario.
  • vim.fault.CnsAlreadyRegisteredFault set in case where the backing disk (either specified with URL path for VMDK volume or disk id for FCD volume) is already registered as CNS volume.
Request
URI
POST
https://{api_host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsCreateVolume
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
CnsCreateVolumeRequestType of type(s) application/json
Required
"CnsCreateVolumeRequestType Object"
array of object
createSpecs
Required

Specifications for volumes to be created.

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

InvalidArgument: For block volume, if the input spec is invalid like createSpecs size is not equal to 1, backing disk ID in backing object details is empty and datastores is empty, volume metadata in input spec is invalid, backing disk ID in backing object details is not present, datastore is invalid, entityMetadata containing duplicate entity types, profile size is not equal to 1 etc.

For file volume, if the input spec is invalid like createSpecs size is not equal to 1, volume metadata in input spec is invalid, backing disk ID in backing object details is not present, entityMetadata containing duplicate entity types, profile size is not equal to 1 etc.

NotFound: if the volume 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}/CnsCreateVolume