Vcenter VM unregister
Removes the virtual machine corresponding to vm from the vCenter inventory without removing any of the virtual machine's files from storage. All high-level information stored with the management server (ESXi or vCenter) is removed, including information such as statistics, resource pool association, permissions, and alarms.
This operation was added in vSphere API 6.8.7.
Returns an authorization error if you do not have all of the privileges described as follows:
- The resource
VirtualMachinereferenced by the parameter vm requiresVirtualMachine.Inventory.Unregister.
Identifier of the virtual machine to be unregistered.
The parameter must be an identifier for the resource type: VirtualMachine.
Success!
if the virtual machine is running (powered on).
{
"messages": [
{
"id": "string",
"default_message": "string",
"args": [
"string"
],
"params": {
"params": {
"s": "string",
"dt": "string",
"i": 0,
"d": "number",
"l": "Vapi Std NestedLocalizableMessage Object",
"format": "string",
"precision": 0
}
},
"localized": "string"
}
],
"data": {},
"error_type": "string"
}
if the user can not be authenticated.
"Vapi Std Errors Unauthenticated Object"
Indicates the authentication challenges applicable to the target API provider. It can be used by a client to discover the correct authentication scheme to use. The exact syntax of the value is defined by the specific provider, the protocol and authentication schemes used.
For example, a provider using REST may adhere to the WWW-Authenticate HTTP header specification, RFC7235, section 4.1. In this case an example challenge value may be: SIGN realm="27da1358-2ba4-11e9-b210-d663bd873d93",sts="http://vcenter/sso?vsphere.local", Basic realm="vCenter"
This property was added in vSphere API 7.0.0.0.
This property is optional because it was added in a newer version than its parent node.
if the user doesn't have the required privileges.
"Vapi Std Errors Unauthorized Object"
if there is no virtual machine associated with vm in the system.
"Vapi Std Errors NotFound Object"
if the virtual machine is busy performing another operation.
"Vapi Std Errors ResourceBusy Object"
if the system is unable to communicate with a service to complete the request.
"Vapi Std Errors ServiceUnavailable Object"
curl -X POST -H 'Authorization: <value>' https://{api_host}/api/vcenter/vm/{vm}?action=unregister