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 checked out virtual machine template items.

class com.vmware.vcenter.vm_template.library_items_client.CheckOuts(config)

Bases: vmware.vapi.bindings.stub.VapiInterface

The CheckOuts class 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. Warning: This class is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Parameters:config (vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
class CheckInInfo

Bases: vmware.vapi.bindings.struct.VapiStruct

The CheckOuts.CheckInInfo class contains information about the result of the check in method. This class is currently empty. In the future, attributes will be added to summarize the check in result. Warning: This class is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Tip

The arguments are used to initialize data attributes with the same names.

class CheckOutSpec(name=None, placement=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The CheckOuts.CheckOutSpec class defines the information required to check out a library item containing a virtual machine template. Warning: This class is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • name (str or None) – Name of the virtual machine to check out of the library item. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. 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.PlacementSpec or None) –

    Information used to place the checked out virtual machine. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. 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.

class PlacementSpec(folder=None, resource_pool=None, host=None, cluster=None)

Bases: vmware.vapi.bindings.struct.VapiStruct

The CheckOuts.PlacementSpec class 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. Warning: This class is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Tip

The arguments are used to initialize data attributes with the same names.

Parameters:
  • folder (str or None) – Virtual machine folder into which the virtual machine should be placed. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. 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 (str or None) – Resource pool into which the virtual machine should be placed. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. 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 (str or None) – Host onto which the virtual machine should be placed. If host and resourcePool are both specified, resourcePool must belong to host. If host and cluster are both specified, host must be a member of cluster. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. 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 resourcePool or cluster is 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 (str or None) – Cluster onto which the virtual machine should be placed. If cluster and resourcePool are both specified, resourcePool must belong to cluster. If cluster and host are both specified, host must be a member of cluster. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented. 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 resourcePool or host is specified, it is recommended that this attribute be None.
check_in(template_library_item, vm)

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. The original source virtual machine template contained in the library item is no longer available. A virtual machine can only be checked into the item that it was previously checked out of. Warning: This method is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

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.
Return type:

CheckOuts.CheckInInfo

Returns:

Information about the result of the check in method.

Raise:

com.vmware.vapi.std.errors_client.InvalidArgument if any of the specified parameters are invalid.

Raise:

com.vmware.vapi.std.errors_client.InvalidArgument if the virtual machine identified by vm was not checked out of the item specified by template_library_item.

Raise:

com.vmware.vapi.std.errors_client.NotAllowedInCurrentState if 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.NotFound if the item specified by template_library_item does not exist.

Raise:

com.vmware.vapi.std.errors_client.NotFound if the virtual machine specified by vm does not exist.

Raise:

com.vmware.vapi.std.errors_client.ResourceInaccessible if there is an error accessing a file from the virtual machine.

Raise:

com.vmware.vapi.std.errors_client.Unauthenticated if the user that requested the method cannot be authenticated.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if the user that requested the method is not authorized to perform the method.

Raise:

com.vmware.vapi.std.errors_client.Error if the system reports an error while responding to the request.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.
  • The resource com.vmware.content.library.Item referenced by the parameter template_library_item requires System.Read.
  • The resource VirtualMachine referenced by the parameter vm requires 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, delete the virtual machine. Warning: This method is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

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.CheckOutSpec or 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.AlreadyExists if a virtual machine with the name specified by CheckOuts.CheckOutSpec.name already exists in the folder specified by CheckOuts.PlacementSpec.folder.

Raise:

com.vmware.vapi.std.errors_client.InvalidArgument if spec contains invalid arguments.

Raise:

com.vmware.vapi.std.errors_client.NotFound if the library item specified by template_library_item cannot be found.

Raise:

com.vmware.vapi.std.errors_client.ResourceInaccessible if 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.UnableToAllocateResource if 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.Unauthenticated if the user that requested the method cannot be authenticated.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if the user that requested the method is not authorized to perform the method.

Raise:

com.vmware.vapi.std.errors_client.Error if the system reports an error while responding to the request.

Raise:

com.vmware.vapi.std.errors_client.Unauthorized if you do not have all of the privileges described as follows:

  • Method execution requires System.Read.
  • The resource com.vmware.content.library.Item referenced by the parameter template_library_item requires System.Read.
  • The resource Folder referenced by the attribute CheckOuts.PlacementSpec.folder requires System.Read.
  • The resource ResourcePool referenced by the attribute CheckOuts.PlacementSpec.resource_pool requires System.Read.
  • The resource HostSystem referenced by the attribute CheckOuts.PlacementSpec.host requires System.Read.
  • The resource ClusterComputeResource referenced by the attribute CheckOuts.PlacementSpec.cluster requires 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