Vcenter Namespaces Mobility Virtualmachines Imports create
Creates a new Import based on the specifications.
This API supports importing a single VM specified in the Vcenter Namespaces Mobility Virtualmachines Imports CreateSpec into the target namespace. This will result in the VM becoming a VM Service managed VM. If the VM has First Class Disks attached, those First Class Disks will be registered to the Supervisor as PersistentVolumeClaim resources attached to the VM.
This API triggers a cancellable task and returns its identifier. Use this identifier to query basic task information by calling the Tasks.get operation, or to query import operation-specific information through the GET /vcenter/namespaces/{namespace}/mobility/virtualmachines/imports/{task} task. 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, manually address them before attempting import again.
After the import to the Supervisor, power cycles are required to perform guest customization to update the network configuration to restore network connectivity.
This operation was added in vSphere API 9.0.0.0.
Returns an authorization error if you do not have all of the privileges described as follows:
- The resource
com.vmware.vcenter.namespaces.Instance
referenced by the parameter namespace requiresNamespaces.Edit
. - The resource
VirtualMachine
referenced by the property Vcenter Namespaces Mobility Virtualmachines Imports CreateSpec.vm requiresVirtualMachine.Supervisor.Transfer
.
Identifier for the namespace.
The parameter must be an identifier for the resource type: com.vmware.vcenter.namespaces.Instance
.
Specification for the Import.
Show optional properties
{
"vm": "string"
}
{
"vm": "string",
"storage_policy": "string",
"subnet_mappings": {
"subnet_mappings": {
"name": "string",
"type": "string"
}
},
"network_customization": {
"customization_sysprep_user_data": {
"computer_name": "string",
"full_name": "string",
"org_name": "string",
"product_id": "string"
}
}
}
The VM to be imported.
This property was added in vSphere API 9.0.0.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
.
Storage policy to be used for the importing VM. A storage policy different from the VM's current storage policy might result in the associated storage resources being relocated to a datastore that conforms with the selected storage policy.
This property was added in vSphere API 9.0.0.0.
If missing or null
, and the target namespace has only a single storage policy, that storage policy will be used.
When clients pass a value of this schema as a parameter, the property must be an identifier for the resource type: SpsStorageProfile
. When operations return a value of this schema as a response, the property will be an identifier for the resource type: SpsStorageProfile
.
Map of network device keys to Subnet information specifying the Subnets to which the VM's network devices should be connected.
The key of the map is the device key of the network device on the VM, and the value is the Subnet information. Each device key must be unique within the map; overlapping or duplicate device keys are not allowed.
This property was added in vSphere API 9.0.0.0.
If missing or null
, or any ethernet card is not specified, the default network configuration for the VM's target namespace will be used.
When clients pass a value of this schema as a parameter, the key in the property map must be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Ethernet
. When operations return a value of this schema as a response, the key in the property map will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Ethernet
.
Network customization settings for Windows VM.
This property was added in vSphere API 9.0.0.0.
If missing or null
, Windows VM will not be able to receive new network identity assigned from the Supervisor workload network. This may result in a loss of network connectivity for VM that requires automated network identity configuration post import, such as systems not using DHCP. This field is not used for non-Windows VM.
The task identifier for the import operation.
The response will be an identifier for the resource type: com.vmware.cis.task
.
Vapi Std Errors InvalidArgument if the arguments are invalid. For example:
- If Vcenter Namespaces Mobility Virtualmachines Imports CustomizationSysprepUserData.computer_name does not conform to requirements.
- If Vcenter Namespaces Mobility Virtualmachines Imports CreateSpec.storage_policy needs to be specified.
Vapi Std Errors Unsupported if the Supervisor does not support importing VM.
"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.
if the user is not 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 does not have Namespaces.Edit privilege on the target Namespace and VirtualMachine.Namespaces.Transfer privilege on the VM.
"Vapi Std Errors Unauthorized Object"
if any of the specified resources (such as importing VM, target namespace, target storage, or target network) cannot be found.
"Vapi Std Errors NotFound Object"
Vapi Std Errors Error if the system reports an error while responding to the request.
Vapi Std Errors UnableToAllocateResource if the target namespace does not have sufficient resources for the importing VM.
"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.
if the system is unable to communicate with the Supervisor.
"Vapi Std Errors ServiceUnavailable Object"
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"vm:"string"}' https://{api_host}/api/vcenter/namespaces/{namespace}/mobility/virtualmachines/imports