Deploy Library Items
Deploys a virtual machine as a copy of the source virtual machine template contained in the library item specified by templateLibraryItem. It uses the deployment specification in spec. If LibraryItems.DeploySpec.powered-on and/or LibraryItems.DeploySpec.guest-customization are specified, the server triggers the power on and/or guest customization operations, which are executed asynchronously. if you do not have all of the privileges described as follows: - Operation execution requires System.Read. - The resource com.vmware.content.library.Item referenced by the parameter templateLibraryItem requires VirtualMachine.Provisioning.DeployTemplate. - The resource Datastore referenced by the attribute LibraryItems.DeploySpecVmHomeStorage.datastore requires System.Read. - The resource com.vmware.spbm.StorageProfile referenced by the attribute LibraryItems.DeploySpecVmHomeStoragePolicy.policy requires System.Read. - The resource Datastore referenced by the attribute LibraryItems.DeploySpecDiskStorage.datastore requires System.Read. - The resource com.vmware.spbm.StorageProfile referenced by the attribute LibraryItems.DeploySpecDiskStoragePolicy.policy requires System.Read. - The resource com.vmware.vcenter.vm.hardware.Disk referenced by the map key of attribute LibraryItems.DeploySpec.disk-storage-overrides requires System.Read. - The resource Folder referenced by the attribute LibraryItems.DeployPlacementSpec.folder requires System.Read. - The resource ResourcePool referenced by the attribute LibraryItems.DeployPlacementSpec.resource-pool requires System.Read. - The resource HostSystem referenced by the attribute LibraryItems.DeployPlacementSpec.host requires System.Read. - The resource ClusterComputeResource referenced by the attribute LibraryItems.DeployPlacementSpec.cluster requires System.Read. - The resource com.vmware.vcenter.vm.hardware.Ethernet referenced by the map key of attribute LibraryItems.HardwareCustomizationSpec.nics requires System.Read. - The resource Network referenced by the attribute LibraryItems.EthernetUpdateSpec.network requires System.Read. - The resource com.vmware.vcenter.vm.hardware.Disk referenced by the attribute LibraryItems.HardwareCustomizationSpec.disks-to-remove requires System.Read. - The resource com.vmware.vcenter.vm.hardware.Disk referenced by the map key of attribute LibraryItems.HardwareCustomizationSpec.disks-to-update requires System.Read.
Request
URLURL
Path Parameters
Path Parameters
identifier of the content library item containing the source virtual machine template to be deployed. The parameter must be an identifier for the resource type: com.vmware.content.library.Item.
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 how the virtual machine should be deployed.
{
"name": "string",
"placement": {
"folder": "string"
}
}
Information used to place the deployed virtual machine. This field is currently required. In the future, if this field is unset, the system will use the values from the source virtual machine template contained in the library item. 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 template result in disjoint placement, the operation will fail.
Name of the deployed virtual machine.
Storage specification for the deployed virtual machine’s disks. If both LibraryItems.DeploySpec.disk-storage-overrides and LibraryItems.DeploySpec.disk-storage are unset, the deployed virtual machine’s disks are created with the same storage spec as the corresponding disks in the source virtual machine template contained in the library item. If LibraryItems.DeploySpec.disk-storage-overrides is unset and LibraryItems.DeploySpec.disk-storage is specified, all of the deployed virtual machine’s disks are created with the storage spec specified by LibraryItems.DeploySpec.disk-storage.
If LibraryItems.DeploySpec.disk-storage-overrides is specified and LibraryItems.DeploySpec.disk-storage is unset, disks with identifiers that are not in LibraryItems.DeploySpec.disk-storage-overrides are created with the same storage spec as the corresponding disks in the source virtual machine template contained in the library item.
If both LibraryItems.DeploySpec.disk-storage-overrides and LibraryItems.DeploySpec.disk-storage are specified, disks with identifiers that are not in LibraryItems.DeploySpec.disk-storage-overrides are created with the storage spec specified by LibraryItems.DeploySpec.disk-storage.
Storage specification for individual disks in the deployed virtual machine. This is specified as a mapping between disk identifiers in the source virtual machine template contained in the library item and their storage specifications. If both LibraryItems.DeploySpec.disk-storage-overrides and LibraryItems.DeploySpec.disk-storage are unset, the deployed virtual machine’s disks are created with the same storage spec as the corresponding disks in the source virtual machine template contained in the library item. If LibraryItems.DeploySpec.disk-storage-overrides is unset and LibraryItems.DeploySpec.disk-storage is specified, all of the deployed virtual machine’s disks are created with the storage spec specified by LibraryItems.DeploySpec.disk-storage.
If LibraryItems.DeploySpec.disk-storage-overrides is specified and LibraryItems.DeploySpec.disk-storage is unset, disks with identifiers that are not in LibraryItems.DeploySpec.disk-storage-overrides are created with the same storage spec as the corresponding disks in the source virtual machine template contained in the library item.
If both LibraryItems.DeploySpec.disk-storage-overrides and LibraryItems.DeploySpec.disk-storage are specified, disks with identifiers that are not in LibraryItems.DeploySpec.disk-storage-overrides are created with the storage spec specified by LibraryItems.DeploySpec.disk-storage.
When clients pass a value of this structure as a parameter, the key in the field map must be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Disk. When operations return a value of this structure as a result, the key in the field map will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Disk.
Guest customization spec to apply to the deployed virtual machine. If unset, the guest operating system is not customized after deployment.
Hardware customization spec which specifies updates to the deployed virtual machine. If unset, the deployed virtual machine has the same hardware configuration as the source virtual machine template contained in the library item.
Description of the deployed virtual machine. If unset, the deployed virtual machine has the same description as the source library item.
Specifies whether the deployed virtual machine should be powered on after deployment. If unset, the virtual machine will not be powered on after deployment.
Storage location for the deployed virtual machine’s configuration and log files. If unset, the deployed virtual machine’s configuration and log files are created with the same storage spec as the source virtual machine template’s configuration and log files.
Authentication
Response
Response BodyResponse Body
Identifier of the deployed 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 name specified by LibraryItems.DeploySpec.name already exists. | com.vmware.vapi.std.errors.invalid_argument : if spec contains invalid arguments. | com.vmware.vapi.std.errors.not_allowed_in_current_state : if either a specified host or a specified datastore is in an invalid state for the deployment, such as maintenance mode.
com.vmware.vapi.std.errors.unauthenticated : if the user that requested the operation cannot be authenticated.
com.vmware.vapi.std.errors.unauthorized : if the user that requested the operation is not authorized to perform the operation.
com.vmware.vapi.std.errors.not_found : if the library item specified by templateLibraryItem cannot be found. if any resource specified by a field of the LibraryItems.DeploySpec structure, specified by spec cannot 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 there was an error accessing the source virtual machine template contained in the library item specified by templateLibraryItem. if there an error accessing any of the resources specified in the spec. | com.vmware.vapi.std.errors.unable_to_allocate_resource : if there was an error in allocating any of the resources required by the operation.
com.vmware.vapi.std.errors.service_unavailable : if any of the services involved in the operation are unavailable.
‘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-template/library-items/{template_library_item}?action=deploy
x-vmw-doc-operation: deploy