CnsVolumeCreateSpec

CnsVolumeCreateSpec
CnsVolumeCreateSpec

Specification for a container volume creation.

This structure may be used only with operations rendered under /vsan.

AllOf
This class requires all of the following:
JSON Example
{
    "_typeName": "string",
    "name": "string",
    "volumeType": "string",
    "datastores": [
        {
            "_typeName": "string",
            "type": "string",
            "value": "string"
        }
    ],
    "metadata": {
        "_typeName": "string",
        "containerCluster": {
            "_typeName": "string",
            "clusterType": "string",
            "clusterId": "string",
            "vSphereUser": "string",
            "clusterFlavor": "string",
            "clusterDistribution": "string",
            "delete": false
        },
        "entityMetadata": [
            {
                "_typeName": "string",
                "entityName": "string",
                "labels": [
                    {
                        "_typeName": "string",
                        "key": "string",
                        "value": "string"
                    }
                ],
                "delete": false,
                "clusterId": "string"
            }
        ],
        "containerClusterArray": [
            {
                "_typeName": "string",
                "clusterType": "string",
                "clusterId": "string",
                "vSphereUser": "string",
                "clusterFlavor": "string",
                "clusterDistribution": "string",
                "delete": false
            }
        ]
    },
    "backingObjectDetails": {
        "_typeName": "string",
        "capacityInMb": 0
    },
    "profile": [
        {
            "_typeName": "string"
        }
    ],
    "createSpec": {
        "_typeName": "string"
    },
    "volumeSource": {
        "_typeName": "string"
    }
}
string
name
Required

Name of the volume.

Name size is limited to 80 bytes. CNS will not try to enforce uniqueness for volume name. Different container orchestrator clusters can create volumes with the same name. Uniqueness within a container orchestrator cluster, if needed, should be enforced by the cluster orchestrator.

string
volumeType
Required

Type of the volume.

See CnsVolumeTypeEnum.

datastores
Optional

Datastores to be considered for volume placement.

For block volume type:

  • If backing disk is not specified in backingObjectDetails, then this is a mandatory field. In case of multiple placement candidate datastores, the server would select one datastore (subject to change) based on various factors like available free space.
  • If an existing backing disk has been specified in backingObjectDetails, then this datastores array should not be set.

For file volume type:

  • If backing file volume is not specified in backingObjectDetails, then this is a mandatory field. In case of multiple placement candidate datastores, the server would select one datastore (subject to change) based on various factors like available free space.
  • If an existing backing disk has been specified in backingObjectDetails, then this datastores array should not be set.
metadata
Optional

Metadata for the container volume.

backingObjectDetails
Required

Additional details for the backing object for this volume.

The details would be specific to the type of the volume. E.g. a block volume can have details like ID of existing disk that should back the volume. See CnsBackingObjectDetails and its child-classes, specific to volume type, for more.

profile
Optional

Storage Profile for the container volume.

ProfileSpec size is limited to 1. See VirtualMachineProfileSpec and its child-classes.

  • If DefinedProfileSpec is specified, then the volume is created on the most free datastore compatible with the given storage policy.
  • If DefaultProfileSpec or EmptyProfileSpec is specified, then the volume is created on the most free datastore with that profile spec.

While creating a block volume with an existing disk, the policy would be applied to the existing disk no matter the disk is attached to VM or detached. While creating a file volume with an existing file share, this field will be ignored.

createSpec
Optional

Volume type specific requirements for the volume.

volumeSource
Optional

Specification for the source of the volume creation.

If set to null, a new empty volume is created.