Vcenter Namespaces Instances registerVM
Register an existing virtual machine as VM Service managed VM.
This API reads data stored in a VM's ExtraConfig to create a Kubernetes resource that may be used to lifecycle manage the VM. This process may also result in the creation of a Secret or ConfigMap resource for the VM's bootstrap data. Finally, a PersistentVolumeClaim resource may be created for each of the first-class disks attached to the VM.
Additionally, after a restore operation by a VADP based data protection vendor, or a failover/failback by a disaster recovery solution, this API can be invoked to re-sync the state of the Kubernetes resources on Supervisor with the configuration of the restored VM. Typically, this involves a new volume (backed by a PersistentVolumeClaim) being created for each of the restored disks of a VM. Finally, the VirtualMachine custom resource on Supervisor is updated with the configuration from the restored virtual machine and the new volume references.
This API can also be invoked after a subset of a VM Service virtual machine's virtual disks are directly restored from a backup vendor. In which case, the API detects which disks have been restored and creates new volumes (backed by a PersistentVolumeClaim) for each restored disk. Finally, the VirtualMachine custom resource on Supervisor is updated with the new volume references.
This API triggers a non-cancellable task and returns its identifier which can be queried by calling the cis Tasks get operation. The task is retained as per the default retention rules configured in vCenter.
This is a non-idempotent API that creates custom resources on the Supervisor as a side effect. If the API returns an error VI admin might need to manually address them before attempting registration again.
This operation was added in vSphere API 8.0.3.0.
Returns an authorization error if you do not have all of the privileges described as follows:
- The resource
com.vmware.vcenter.namespaces.Instancereferenced by the parameter namespace requiresNamespaces.Configure.
Identifier for the namespace.
The parameter must be an identifier for the resource type: com.vmware.vcenter.namespaces.Instance.
Specification for registering the virtual machine.
{
"vm": "string"
}
Identifier for the virtual machine being registered with Supervisor.
This property was added in vSphere API 8.0.3.0.
When clients pass a value of this schema as a parameter, the property must be an identifier for the resource type: VirtualMachine. When operations return a value of this schema as a response, the property will be an identifier for the resource type: VirtualMachine.
The task identifier for the register operation.
The response will be an identifier for the resource type: com.vmware.cis.task.
Vapi Std Errors InvalidArgument if the specified virtual machine is invalid.
Vapi Std Errors Unsupported if the Supervisor does not support registering a virtual machine as VM Service managed VM.
Vapi Std Errors AlreadyInDesiredState if the Supervisor only supports registering new virtual machines and the requested virtual machine already exists on Supervisor.
{
"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"
}
Stack of one or more localizable messages for human error consumers.
The message at the top of the stack (first in the list) describes the error from the perspective of the operation the client invoked.
Each subsequent message in the stack describes the "cause" of the prior message.
Data to facilitate clients responding to the operation reporting a standard error to indicating that it was unable to complete successfully.
Operations may provide data that clients can use when responding to errors. Since the data that clients need may be specific to the context of the operation reporting the error, different operations that report the same error may provide different data in the error. The documentation for each each operation will describe what, if any, data it provides for each error it reports.
The Vapi Std Errors ArgumentLocations, Vapi Std Errors FileLocations, and Vapi Std Errors TransientIndication schemas are intended as possible values for this property. Vapi Std DynamicID may also be useful as a value for this property (although that is not its primary purpose). Some resources may provide their own specific schemas for use as the value of this property when reporting errors from their operations.
Some operations will not set this property when reporting errors.
Discriminator field to help API consumers identify the structure type.
For more information see: Vapi Std Errors Error Type.
This property was added in vSphere API 6.7.2.
Can be missing or null for compatibility with preceding implementations.
if the user can not be authenticated.
{
"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",
"challenge": "string"
}
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 does not have Namespaces.Configure privilege.
{
"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 namespace with the name namespace or virtual machine with the spec could not be located.
{
"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 system reports an error while responding to the request.
"Vapi Std Errors Error Object"
Stack of one or more localizable messages for human error consumers.
The message at the top of the stack (first in the list) describes the error from the perspective of the operation the client invoked.
Each subsequent message in the stack describes the "cause" of the prior message.
Data to facilitate clients responding to the operation reporting a standard error to indicating that it was unable to complete successfully.
Operations may provide data that clients can use when responding to errors. Since the data that clients need may be specific to the context of the operation reporting the error, different operations that report the same error may provide different data in the error. The documentation for each each operation will describe what, if any, data it provides for each error it reports.
The Vapi Std Errors ArgumentLocations, Vapi Std Errors FileLocations, and Vapi Std Errors TransientIndication schemas are intended as possible values for this property. Vapi Std DynamicID may also be useful as a value for this property (although that is not its primary purpose). Some resources may provide their own specific schemas for use as the value of this property when reporting errors from their operations.
Some operations will not set this property when reporting errors.
Discriminator field to help API consumers identify the structure type.
For more information see: Vapi Std Errors Error Type.
This property was added in vSphere API 6.7.2.
Can be missing or null for compatibility with preceding implementations.
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"vm:"string"}' https://{api_host}/api/vcenter/namespaces/instances/{namespace}/registervm