Cns Volume Manager Cns Unregister Volume

Cns Volume Manager Cns Unregister Volume
Initiates an asynchronous operation to unregister volume.

Initiates an asynchronous operation to unregister volume.

Unregistration removes the CNS metadata associated with the specified volumes, it also optionally converts to a targer volume type as specified in the targetVolumeType. This API is only supported for the block volume.

This is an asynchronous operation, it returns a Task object which can be used to monitor the progress and completion status of the unregistration process.

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsUnregisterVolume
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.1.0.0 APIs.


Request Body
CnsUnregisterVolumeRequestType of type(s) application/json
Optional
{
    "unregisterSpec": [
        {
            "_typeName": "string",
            "volumeId": {
                "_typeName": "string",
                "id": "string"
            },
            "targetVolumeType": "string"
        }
    ]
}
array of object
unregisterSpec
Optional

An array of CnsUnregisterVolumeSpec objects, each specifying a unique volume or PVC to be unregistered along with optional parameters for its post-unregistration state. At most one specification is supported for this operation.

Authentication
This operation uses the following authentication methods.
Responses
200

Task to track the progress and result of this operation. The task's result will indicate the success of the unregistration for all specified 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
Returns MoRefTask of type(s) application/json
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

NotFound: Thrown if any of the volumeIds specified in the unregisterSpec do not correspond to an existing PVC in the CNS inventory.

InvalidState: Thrown if a volume specified is in a state that prevents unregistration.

InvalidDatastore: Thrown if the operation cannot be performed on the datastore.

TaskInProgress: Thrown if the virtual storage object is busy.

InvalidArgument: if:

  • This API supports input size of 1 only. If more or less than one entries are passed as input, this exception will be thrown.
  • This exception will be thrown when invalid format for VolumeId id is passed, or volume IDs are empty.
  • This exception will be thrown when volume Id does not belong to block volume.

CnsFault: Thrown if a general CNS-specific error occurs during the unregistration process that is not covered by more specific faults.

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

Returns MethodFault of type(s) application/json
This response body class contains all of the following: Any
{
    "_typeName": "string",
    "faultCause": {
        "_typeName": "string",
        "faultCause": "MethodFault Object",
        "faultMessage": [
            {
                "_typeName": "string",
                "key": "string",
                "arg": [
                    {
                        "_typeName": "string",
                        "key": "string",
                        "value": {
                            "_typeName": "string"
                        }
                    }
                ],
                "message": "string"
            }
        ]
    },
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}
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}/CnsUnregisterVolume