vcenter VM: instant clone
Create an instant clone of an existing virtual machine. This operation was added in vSphere API 6.7.1.
Request:
HTTP request
POST https://{server}/rest/vcenter/vm?action=instant-clone
Request Body Structure:
{
"spec" : {
"disconnect_all_nics" : true,
"nics_to_update" : [
{
"value" : {
"start_connected" : true,
"backing" : {
"distributed_port" : "string",
"type" : "STANDARD_PORTGROUP",
"network" : "obj-103"
},
"mac_address" : "string",
"mac_type" : "MANUAL",
"allow_guest_control" : true,
"wake_on_lan_enabled" : true,
"upt_compatibility_enabled" : true
},
"key" : "obj-103"
}
],
"serial_ports_to_update" : [
{
"value" : {
"start_connected" : true,
"backing" : {
"proxy" : "http://myurl.com",
"file" : "string",
"pipe" : "string",
"type" : "FILE",
"host_device" : "string",
"no_rx_loss" : true,
"network_location" : "http://myurl.com"
},
"allow_guest_control" : true,
"yield_on_poll" : true
},
"key" : "obj-103"
}
],
"parallel_ports_to_update" : [
{
"value" : {
"start_connected" : true,
"backing" : {
"file" : "string",
"type" : "FILE",
"host_device" : "string"
},
"allow_guest_control" : true
},
"key" : "obj-103"
}
],
"name" : "string",
"source" : "obj-103",
"placement" : {
"folder" : "obj-103",
"datastore" : "obj-103",
"resource_pool" : "obj-103"
},
"bios_uuid" : "string"
}
}
"spec" : {
"disconnect_all_nics" : true,
"nics_to_update" : [
{
"value" : {
"start_connected" : true,
"backing" : {
"distributed_port" : "string",
"type" : "STANDARD_PORTGROUP",
"network" : "obj-103"
},
"mac_address" : "string",
"mac_type" : "MANUAL",
"allow_guest_control" : true,
"wake_on_lan_enabled" : true,
"upt_compatibility_enabled" : true
},
"key" : "obj-103"
}
],
"serial_ports_to_update" : [
{
"value" : {
"start_connected" : true,
"backing" : {
"proxy" : "http://myurl.com",
"file" : "string",
"pipe" : "string",
"type" : "FILE",
"host_device" : "string",
"no_rx_loss" : true,
"network_location" : "http://myurl.com"
},
"allow_guest_control" : true,
"yield_on_poll" : true
},
"key" : "obj-103"
}
],
"parallel_ports_to_update" : [
{
"value" : {
"start_connected" : true,
"backing" : {
"file" : "string",
"type" : "FILE",
"host_device" : "string"
},
"allow_guest_control" : true
},
"key" : "obj-103"
}
],
"name" : "string",
"source" : "obj-103",
"placement" : {
"folder" : "obj-103",
"datastore" : "obj-103",
"resource_pool" : "obj-103"
},
"bios_uuid" : "string"
}
}
Request Body Parameters:
Name | Type | Description |
---|---|---|
bold = required | ||
spec | instant_clone_spec | Virtual machine InstantCloneSpec. |
spec.source | string | Virtual machine to InstantClone from. This attribute was added in vSphere API 6.7.1. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: VirtualMachine . When operations return a value of this structure as a result, the field will be an identifier for the resource type: VirtualMachine . |
spec.name | string | Name of the new virtual machine. This attribute was added in vSphere API 6.7.1. |
spec.placement | instant_clone_placement_spec | Virtual machine placement information. This attribute was added in vSphere API 6.7.1. Optional. If this field is unset, the system will use the values from the source virtual machine. If specified, each field will be used for placement. If the fields result in disjoint placement the operation will fail. If the fields along with the placement values of the source virtual machine result in disjoint placement the operation will fail. |
spec.placement.folder | string | Virtual machine folder into which the InstantCloned virtual machine should be placed. This attribute was added in vSphere API 6.7.1. Optional. If field is unset, the system will use the virtual machine folder of the source virtual machine.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Folder . When operations return a value of this structure as a result, the field will be an identifier for the resource type: Folder . |
spec.placement.resource_pool | string | Resource pool into which the InstantCloned virtual machine should be placed. This attribute was added in vSphere API 6.7.1. Optional. If field is unset, the system will use the resource pool of the source virtual machine.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: ResourcePool . When operations return a value of this structure as a result, the field will be an identifier for the resource type: ResourcePool . |
spec.placement.datastore | string | Datastore on which the InstantCloned virtual machine's configuration state should be stored. This datastore will also be used for any virtual disks that are created as part of the virtual machine InstantClone operation. This attribute was added in vSphere API 6.7.1. Optional. If field is unset, the system will use the datastore of the source virtual machine.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 . |
spec.nics_to_update | list | Map of NICs to update. This attribute was added in vSphere API 6.7.1. Optional. If unset, no NICs will be updated.When clients pass a value of this structure as a parameter, the key in the field key/value pairs must be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Ethernet . When operations return a value of this structure as a result, the key in the field key/value pairs will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Ethernet . |
spec.disconnect_all_nics | boolean | Indicates whether all NICs on the destination virtual machine should be disconnected from the newtwork. This attribute was added in vSphere API 6.7.1. Optional. If unset, connection status of all NICs on the destination virtual machine will be the same as on the source virtual machine. |
spec.parallel_ports_to_update | list | Map of parallel ports to Update. This attribute was added in vSphere API 6.7.1. Optional. If unset, no parallel ports will be updated.When clients pass a value of this structure as a parameter, the key in the field key/value pairs must be an identifier for the resource type: com.vmware.vcenter.vm.hardware.ParallelPort . When operations return a value of this structure as a result, the key in the field key/value pairs will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.ParallelPort . |
spec.serial_ports_to_update | list | Map of serial ports to Update. This attribute was added in vSphere API 6.7.1. Optional. If unset, no serial ports will be updated.When clients pass a value of this structure as a parameter, the key in the field key/value pairs must be an identifier for the resource type: com.vmware.vcenter.vm.hardware.SerialPort . When operations return a value of this structure as a result, the key in the field key/value pairs will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.SerialPort . |
spec.bios_uuid | string | 128-bit SMBIOS UUID of a virtual machine represented as a hexadecimal string in "12345678-abcd-1234-cdef-123456789abc" format. This attribute was added in vSphere API 6.7.1. Optional. If unset, will be generated. |
Response:
HTTP Status Code: 200
Representation:
{
"value" : "obj-103"
}
"value" : "obj-103"
}
Response Type:
Name | Type | Description |
---|---|---|
bold = required | ||
value | string | ID of newly-created virtual machine. |
Errors:
HTTP Status Code | Type | Description |
---|---|---|
400 | already_exists | if a virtual machine with the specified name already exists. |
500 | error | if the system reports an error while responding to the request. |
400 | invalid_argument | if any of the specified parameters are invalid. |
404 | not_found | if any of the resources specified in spec could not be found |
500 | resource_inaccessible | if a specified resource (eg. host) is not accessible. |
503 | service_unavailable | if the system is unable to communicate with a service to complete the request. |
500 | unable_to_allocate_resource | if any of the resources needed to create an instant clone could not be allocated. |
401 | unauthenticated | if the user can not be authenticated. |
403 | unauthorized | if the user doesn't have the required privileges. |