Storage Pod Unregister And Destroy Task

Storage Pod Unregister And Destroy Task

Recursively unregisters all virtual machines and vApps, and destroys all child virtual machine folders.

This is similar to the Destroy_Task method, but this method calls UnregisterAndDestroy_Task on each virtual machine object instead of calling Destroy_Task. This operation applies only to VirtualMachine folders.

UnregisterAndDestroy_Task is a recursive operation that destroys the specified virtual machine folder, unregisters all child virtual machine objects, and destroys all child virtual machine folders. When you call UnregisterAndDestroy_Task to destroy a virtual machine folder, the system uses the specified folder as a root and traverses its descendant hierarchy, calling UnregisterAndDestroy_Task on each virtual machine object and Destroy_Task on each virtual machine folder. UnregisterAndDestroy_Task is a single operation that treats each recursive call as a single transaction, committing each call to remove an object individually. If a failure occurs, the method terminates at that point with an exception, leaving some or all objects unaffected.

If you are removing virtual machines, you must hold the VirtualMachine.Delete privilege on all of the virtual machines to be unregistered, and on their parent folders. If you are removing virtual applications, you must hold the VApp.Delete privilege on all of the virtual applications to be unregistered, and on their parent folders.

Required privileges: Folder.Delete

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/StoragePod/{moId}/UnregisterAndDestroy_Task
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 StoragePod/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Authentication
This operation uses the following authentication methods.
Responses
200

This method returns a Task object with which to monitor the operation.

Returns MoRefTask of type(s) application/json
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

InvalidState: if a virtual machine is not powered off or suspended.

ConcurrentAccess: if another client modifies the folder contents before this operation completes.

NotSupported: if the childType property of the folder is not set to "VirtualMachine".

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}