com.vmware.vcenter.vm_template package
Submodules
com.vmware.vcenter.vm_template.library_items_client module
The com.vmware.vcenter.vm_template.library_items_client module provides
classes and classes for managing virtual machine template library items. This
includes methods for checking out virtual machine template library items and
querying previous versions of checked in virtual machines.
- class com.vmware.vcenter.vm_template.library_items_client.CheckOuts(config)
- Bases: - vmware.vapi.bindings.stub.VapiInterface- The - CheckOutsclass provides methods for managing the checkouts of a library item containing a virtual machine template. This class provides operations to check out a library item to update the virtual machine template, and to check in the library item when the virtual machine changes are complete. This class was added in vSphere API 6.9.1.- Parameters
- config ( - vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
 - class CheckInSpec(message=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - CheckOuts.CheckInSpecclass defines the information required to check in a virtual machine into a library item. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- message ( - str) – Message describing the changes made to the virtual machine. This attribute was added in vSphere API 6.9.1.
 
 - class CheckOutSpec(name=None, placement=None, powered_on=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - CheckOuts.CheckOutSpecclass defines the information required to check out a library item containing a virtual machine template. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- name ( - stror- None) – Name of the virtual machine to check out of the library item. This attribute was added in vSphere API 6.9.1. This attribute is currently required. In the future, if this attribute is None, the system will choose a suitable name for the virtual machine.
- placement ( - CheckOuts.PlacementSpecor- None) –- Information used to place the checked out virtual machine. This attribute was added in vSphere API 6.9.1. This attribute is currently required. In the future, if this attribute is None, the system will place the virtual machine on a suitable resource. - If specified, each attribute will be used for placement. If the attributes result in disjoint placement, the operation will fail. If the attributes along with the placement values of the source virtual machine template result in disjoint placement, the operation will fail. 
- powered_on ( - boolor- None) – Specifies whether the virtual machine should be powered on after check out. This attribute was added in vSphere API 6.9.1. If None, the virtual machine will not be powered on after check out.
 
 
 - class Info(time=None, user=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - CheckOuts.Infoclass contains information about a checked out virtual machine. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- time ( - datetime.datetime) – Date and time when the virtual machine was checked out. This attribute was added in vSphere API 6.9.1.
- user ( - str) – Name of the user who checked out the virtual machine. This attribute was added in vSphere API 6.9.1.
 
 
 - class PlacementSpec(folder=None, resource_pool=None, host=None, cluster=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - CheckOuts.PlacementSpecclass contains information used to place a checked out virtual machine onto resources within the vCenter inventory. The specified compute resource should have access to the storage associated with the checked out virtual machine. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- folder ( - stror- None) – Virtual machine folder into which the virtual machine should be placed. This attribute was added in vSphere API 6.9.1. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:- Folder. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:- Folder. If None, the virtual machine will be placed in the same folder as the source virtual machine template.
- resource_pool ( - stror- None) – Resource pool into which the virtual machine should be placed. This attribute was added in vSphere API 6.9.1. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:- ResourcePool. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:- ResourcePool. If None, the system will attempt to choose a suitable resource pool for the virtual machine; if a resource pool cannot be chosen, the operation will fail.
- host ( - stror- None) – Host onto which the virtual machine should be placed. If- hostand- resourcePoolare both specified,- resourcePoolmust belong to- host. If- hostand- clusterare both specified,- hostmust be a member of- cluster. This attribute was added in vSphere API 6.9.1. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:- HostSystem. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:- HostSystem. This attribute may be None if- resourcePoolor- clusteris specified. If None, the system will attempt to choose a suitable host for the virtual machine; if a host cannot be chosen, the operation will fail.
- cluster ( - stror- None) – Cluster onto which the virtual machine should be placed. If- clusterand- resourcePoolare both specified,- resourcePoolmust belong to- cluster. If- clusterand- hostare both specified,- hostmust be a member of- cluster. This attribute was added in vSphere API 6.9.1. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:- ClusterComputeResource. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:- ClusterComputeResource. If- resourcePoolor- hostis specified, it is recommended that this attribute be None.
 
 
 - class Summary(vm=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - CheckOuts.Summaryclass contains commonly used information about a checked out virtual machine. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- vm ( - str) – Identifier of the checked out virtual machine. This attribute was added in vSphere API 6.9.1. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:- VirtualMachine. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:- VirtualMachine.
 
 - check_in(template_library_item, vm, spec=None)
- Checks in a virtual machine into the library item. This method updates the library item to contain the virtual machine being checked in as a template. This template becomes the latest version of the library item. The previous virtual machine template contained in the library item is available as a backup and its information can be queried using the - Versionsclass. At most one previous version of a virtual machine template is retained in the library item. This method was added in vSphere API 6.9.1.- Parameters
- template_library_item ( - str) – Identifier of the content library item in which the virtual machine is checked in. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- vm ( - str) – Identifier of the virtual machine to check into the library item. The parameter must be an identifier for the resource type:- VirtualMachine.
- spec ( - CheckOuts.CheckInSpecor- None) – Specification used to check in the virtual machine into the library item. This parameter is currently required. In the future, if this parameter is None, the system will apply suitable defaults.
 
- Return type
- str
- Returns
- The new version of the library item. The return value will be an identifier for the resource type: - com.vmware.content.library.item.Version.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif any of the specified parameters are invalid.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the virtual machine identified by- vmwas not checked out of the item specified by- template_library_item.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the method cannot be performed because of the virtual machine’s current state. For example, if the virtual machine is not powered off.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the item specified by- template_library_itemdoes not exist.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine specified by- vmdoes not exist.
- Raise
- com.vmware.vapi.std.errors_client.ResourceInaccessibleif there is an error accessing a file from the virtual machine.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- ContentLibrary.CheckInTemplate.
- The resource - VirtualMachinereferenced by the parameter- vmrequires- System.Read.
 
 
 - check_out(template_library_item, spec=None)
- Checks out a library item containing a virtual machine template. This method makes a copy of the source virtual machine template contained in the library item as a virtual machine. The virtual machine is copied with the same storage specification as the source virtual machine template. Changes to the checked out virtual machine do not affect the virtual machine template contained in the library item. To save these changes back into the library item, - CheckOuts.check_in()the virtual machine. To discard the changes,- CheckOuts.delete()the virtual machine. This method was added in vSphere API 6.9.1.- Parameters
- template_library_item ( - str) – Identifier of the content library item containing the source virtual machine template to be checked out. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- spec ( - CheckOuts.CheckOutSpecor- None) – Specification used to check out the source virtual machine template as a virtual machine. This parameter is currently required. In the future, if this parameter is None, the system will apply suitable defaults.
 
- Return type
- str
- Returns
- Identifier of the virtual machine that was checked out of the library item. The return value will be an identifier for the resource type: - VirtualMachine.
- Raise
- com.vmware.vapi.std.errors_client.AlreadyExistsif a virtual machine with the name specified by- CheckOuts.CheckOutSpec.namealready exists in the folder specified by- CheckOuts.PlacementSpec.folder.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- speccontains invalid arguments.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the library item is a member of a subscribed library.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item specified by- template_library_itemcannot be found.
- Raise
- com.vmware.vapi.std.errors_client.ResourceInaccessibleif there is an error accessing the files of the source virtual machine template contained in the library item specified by- template_library_item.
- Raise
- com.vmware.vapi.std.errors_client.UnableToAllocateResourceif the limit for the number of virtual machines checked out of a library item (currently 1) has been exceeded.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- ContentLibrary.CheckOutTemplate.
- The resource - Folderreferenced by the attribute- CheckOuts.PlacementSpec.folderrequires- System.Read.
- The resource - ResourcePoolreferenced by the attribute- CheckOuts.PlacementSpec.resource_poolrequires- System.Read.
- The resource - HostSystemreferenced by the attribute- CheckOuts.PlacementSpec.hostrequires- System.Read.
- The resource - ClusterComputeResourcereferenced by the attribute- CheckOuts.PlacementSpec.clusterrequires- System.Read.
 
 
 - delete(template_library_item, vm)
- Deletes the checked out virtual machine. This method was added in vSphere API 6.9.1. - Parameters
- template_library_item ( - str) – Identifier of the VM template library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- vm ( - str) – Identifier of the checked out virtual machine to delete. The parameter must be an identifier for the resource type:- VirtualMachine.
 
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item or virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the virtual machine is not checked out of the library item.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is running (powered on).
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy performing another operation.
- Raise
- com.vmware.vapi.std.errors_client.ResourceInaccessibleif the virtual machine’s configuration state cannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.Inventory.Delete.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- System.Read.
 
 
 - get(template_library_item, vm)
- Returns the information about a checked out virtual machine. This method was added in vSphere API 6.9.1. - Parameters
- template_library_item ( - str) – Identifier of the VM template library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- vm ( - str) – Identifier of the checked out virtual machine. The parameter must be an identifier for the resource type:- VirtualMachine.
 
- Return type
- Returns
- Information about a check out. 
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item or virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the virtual machine is not checked out of the library item.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the library item does not contain a virtual machine template.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- System.Read.
- The resource - VirtualMachinereferenced by the parameter- vmrequires- System.Read.
 
 
 - list(template_library_item)
- Returns commonly used information about the virtual machines that are checked out of the library item. This method was added in vSphere API 6.9.1. - Parameters
- template_library_item ( - str) – Identifier of the VM template library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- Return type
- Returns
- List of commonly used information about the check outs. 
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item is not found.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the library item does not contain a virtual machine template.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- System.Read.
 
 
 
- class com.vmware.vcenter.vm_template.library_items_client.StubFactory(stub_config)
- Bases: - vmware.vapi.bindings.stub.StubFactoryBase- Initialize StubFactoryBase - Parameters
- stub_config ( - vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance
 
- class com.vmware.vcenter.vm_template.library_items_client.Versions(config)
- Bases: - vmware.vapi.bindings.stub.VapiInterface- The - Versionsclass provides methods for managing the live versions of the virtual machine templates contained in a library item. Live versions include the latest and previous virtual machine templates that are available on disk. As new versions of virtual machine templates are checked in, old versions of virtual machine templates are automatically purged. Currently, at most one previous virtual machine template version is stored. This class was added in vSphere API 6.9.1.- Parameters
- config ( - vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
 - class Info(vm_template=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Versions.Infoclass contains information about a version of a library item containing a virtual machine template. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- vm_template ( - str) – Identifier of the virtual machine template associated with the library item version. This attribute is the managed object identifier used to identify the virtual machine template in the vSphere Management (SOAP) API. This attribute was added in vSphere API 6.9.1.
 
 - RESOURCE_TYPE = 'com.vmware.content.library.item.Version'
- Resource type for library item versions. This class attribute was added in vSphere API 6.9.1. 
 - class RollbackSpec(message=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Versions.RollbackSpecclass defines the information required to rollback a virtual machine template library item to a previous version. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- message ( - str) – Message describing the reason for the rollback. This attribute was added in vSphere API 6.9.1.
 
 - class Summary(version=None, vm_template=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Versions.Summaryclass contains commonly used information about a version of a library item containing a virtual machine template. This class was added in vSphere API 6.9.1.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- version ( - str) – The version of the library item. This attribute was added in vSphere API 6.9.1. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:- com.vmware.content.library.item.Version. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:- com.vmware.content.library.item.Version.
- vm_template ( - str) – Identifier of the virtual machine template associated with the library item version. This attribute is the managed object identifier used to identify the virtual machine template in the vSphere Management (SOAP) API. This attribute was added in vSphere API 6.9.1.
 
 
 - delete(template_library_item, version)
- Deletes the virtual machine template contained in the library item at the specified version. This method was added in vSphere API 6.9.1. - Parameters
- template_library_item ( - str) – Identifier of the VM template library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- version ( - str) – Version of the library item to delete. The parameter must be an identifier for the resource type:- com.vmware.content.library.item.Version.
 
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item or version is not found.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the specified version is the latest version of the library item.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the library item does not contain a virtual machine template.
- Raise
- com.vmware.vapi.std.errors_client.ResourceInaccessibleif the virtual machine template’s configuration state cannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- ContentLibrary.DeleteLibraryItem.
- The resource - com.vmware.content.library.item.Versionreferenced by the parameter- versionrequires- System.Read.
 
 
 - get(template_library_item, version)
- Returns information about the live version of a library item containing a virtual machine template. This method was added in vSphere API 6.9.1. - Parameters
- template_library_item ( - str) – Identifier of the VM template library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- version ( - str) – Version of the library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.item.Version.
 
- Return type
- Returns
- Information about the specified library item version. 
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item or version is not found.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the library item does not contain a virtual machine template.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- System.Read.
- The resource - com.vmware.content.library.item.Versionreferenced by the parameter- versionrequires- System.Read.
 
 
 - list(template_library_item)
- Returns commonly used information about the live versions of a virtual machine template library item. This method was added in vSphere API 6.9.1. - Parameters
- template_library_item ( - str) – Identifier of the VM template library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- Return type
- Returns
- List of commonly used information about the library item versions. 
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item is not found.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the library item does not contain a virtual machine template.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- System.Read.
 
 
 - rollback(template_library_item, version, spec=None)
- Rollbacks a library item containing a virtual machine template to a previous version. The virtual machine template at the specified version becomes the latest virtual machine template with a new version identifier. This method was added in vSphere API 6.9.1. - Parameters
- template_library_item ( - str) – Identifier of the VM template library item. The parameter must be an identifier for the resource type:- com.vmware.content.library.Item.
- version ( - str) – Version of the library item to rollback. The parameter must be an identifier for the resource type:- com.vmware.content.library.item.Version.
- spec ( - Versions.RollbackSpecor- None) – Specification to rollback the library item. This parameter is currently required. In the future, if this parameter is None, the system will apply suitable defaults.
 
- Return type
- str
- Returns
- The new version of the library item. The return value will be an identifier for the resource type: - com.vmware.content.library.item.Version.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the library item or version is not found.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the specified version is the latest version of the library item.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif the library item does not contain a virtual machine template.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif a virtual machine is checked out of the library item.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user that requested the method cannot be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif the user that requested the method is not authorized to perform the method.
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- Method execution requires - System.Read.
- The resource - com.vmware.content.library.Itemreferenced by the parameter- template_library_itemrequires- ContentLibrary.CheckInTemplate.
- The resource - com.vmware.content.library.item.Versionreferenced by the parameter- versionrequires- System.Read.