Register VM
Creates a virtual machine from existing virtual machine files on storage. if you do not have all of the privileges described as follows: - The resource Datastore referenced by the attribute VM.RegisterSpec.datastore requires System.Read. - The resource Folder referenced by the attribute VM.InventoryPlacementSpec.folder requires VirtualMachine.Inventory.Register. - The resource ResourcePool referenced by the attribute VM.ComputePlacementSpec.resource-pool requires Resource.AssignVMToPool.
Request
URLURL
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
Specification of the location of the virtual machine files and the placement of the new virtual machine.
{
"placement": {
"folder": "string"
}
}
Virtual machine placement information. This field is currently required. In the future, if this field is unset, the system will attempt to choose suitable resources on which to place the virtual machine.
Identifier of the datastore on which the virtual machine’s configuration state is stored. If unset, VM.RegisterSpec.path must also be unset and VM.RegisterSpec.datastore-path must be set. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Datastore. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Datastore.
Datastore path for the virtual machine’s configuration file in the format “[datastore name] path”. For example “[storage1] Test-VM/Test-VM.vmx”. If unset, both VM.RegisterSpec.datastore and VM.RegisterSpec.path must be set.
Virtual machine name. If unset, the display name from the virtual machine’s configuration file will be used.
Path to the virtual machine’s configuration file on the datastore corresponding to {@link #datastore). If unset, VM.RegisterSpec.datastore must also be unset and VM.RegisterSpec.datastore-path must be set.
Authentication
Response
Response BodyResponse Body
Identifier of the newly-created virtual machine. The result will be an identifier for the resource type: VirtualMachine.
Errors
com.vmware.vapi.std.errors.already_exists : if a virtual machine with the specified name already exists or if a virtual machine using the specified virtual machine files already exists. | com.vmware.vapi.std.errors.invalid_argument : if any of the specified parameters are invalid.
com.vmware.vapi.std.errors.unauthorized : if the user doesn’t have the required privileges.
com.vmware.vapi.std.errors.not_found : if any of the resources specified in spec could not be found.
com.vmware.vapi.std.errors.error : if the system reports an error while responding to the request. | com.vmware.vapi.std.errors.resource_inaccessible : if a specified resource (eg. host) is not accessible. | com.vmware.vapi.std.errors.unable_to_allocate_resource : if any of the resources needed to register the virtual machine could not be allocated.
com.vmware.vapi.std.errors.service_unavailable : if the system is unable to communicate with a service to complete the request.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
PowerCLI Client SDK All Parameters Example
cURL Command
Vendor Extensions
x-vmw-doc-deprecated-method: post
x-vmw-doc-deprecated-path: /rest/vcenter/vm?action=register
x-vmw-doc-operation: register