VMware

LibraryItem Namespace

The LibraryItem namespace provides commands to deploy virtual machines and virtual appliances from library items containing Open Virtualization Format (OVF) packages in content library, as well as commands to create library items in content library from virtual machines and virtual appliances. To deploy a virtual machine or a virtual appliance from a library item:

  1. Create a LibraryItem.DeploymentTarget to specify the target deployment type and target deployment designation.
  2. Create a LibraryItem.ResourcePoolDeploymentSpec to specify the parameters for the target deployment.
  3. Use the deploy command with the created target and parameter specifications, along with the identifier of the specified source content library item. See LibraryItem.deploy.
To create a library item in content library from a virtual machine or virtual appliance:
  1. Create a LibraryItem.DeployableIdentity to specify the source virtual machine or virtual appliance to be used as the OVF template source.
  2. Create a LibraryItem.CreateTarget to specify the target library and library item.
  3. Create a LibraryItem.CreateSpec to specify the settings for the OVF package to be created.
  4. Use the create command with the created target and parameter specifications, along with the specified source entity. See LibraryItem.create.

List of commands:



Deploy Command

dcli com vmware vcenter ovf libraryitem deploy

Description

Deploys an OVF package stored in content library to a newly created virtual machine or virtual appliance. This command deploys an OVF package which is stored in the library item specified by ovf-library-item-id. It uses the deployment specification in deployment-spec to deploy the OVF package to the location specified by target.

Options

Option Name Type Required Description
client‑token string No Client-generated token used to retry a request if the client fails to get a response from the server. If the original request succeeded, the result of that request will be returned, otherwise the operation will be retried. If unset, the server will create a token.
ovf‑library‑item‑id string Yes Identifier of the content library item containing the OVF package to be deployed. The parameter must be an identifier for the resource type: com.vmware.content.library.Item.
resource‑pool‑id string Yes Identifier of the resource pool to which the virtual machine or virtual appliance should be attached. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: ResourcePool. When commands return a value of this class as a output, the option will be an identifier for the resource type: ResourcePool.
host‑id string No Identifier of the target host on which the virtual machine or virtual appliance will run. The target host must be a member of the cluster that contains the resource pool identified by LibraryItem.DeploymentTarget.resource-pool-id. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: HostSystem. When commands return a value of this class as a output, the option will be an identifier for the resource type: HostSystem. If unset, the server will automatically select a target host from the resource pool if LibraryItem.DeploymentTarget.resource-pool-id is a stand-alone host or a cluster with Distributed Resource Scheduling (DRS) enabled.
folder‑id string No Identifier of the vCenter folder that should contain the virtual machine or virtual appliance. The folder must be virtual machine folder. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: Folder. When commands return a value of this class as a output, the option will be an identifier for the resource type: Folder. If unset, the server will choose the deployment folder.
name string No Name assigned to the deployed target virtual machine or virtual appliance. If unset, the server will use the name from the OVF package.
annotation string No Annotation assigned to the deployed target virtual machine or virtual appliance. If unset, the server will use the annotation from the OVF package.
accept‑all‑eula bool Yes Whether to accept all End User License Agreements. See LibraryItem.OvfSummary.eulas.
network‑mappings string No Specification of the target network to use for sections of type ovf:NetworkSection in the OVF descriptor. The key in the map is the section identifier of the ovf:NetworkSection section in the OVF descriptor and the value is the target network to be used for deployment. When clients pass a value of this class as a parameter, the value in the option map must be an identifier for the resource type: Network. When commands return a value of this class as a output, the value in the option map will be an identifier for the resource type: Network. If unset, the server will choose a network mapping.
storage‑mappings string No Specification of the target storage to use for sections of type vmw:StorageGroupSection in the OVF descriptor. The key in the map is the section identifier of the ovf:StorageGroupSection section in the OVF descriptor and the value is the target storage specification to be used for deployment. See LibraryItem.StorageGroupMapping. If unset, the server will choose a storage mapping.
storage‑provisioning string No Default storage provisioning type to use for all sections of type vmw:StorageSection in the OVF descriptor. If unset, the server will choose the provisioning type. Valid values are: {thin, thick, eagerZeroedThick}
storage‑profile‑id string No Default storage profile to use for all sections of type vmw:StorageSection in the OVF descriptor. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: StorageProfile. When commands return a value of this class as a output, the option will be an identifier for the resource type: StorageProfile. If unset, the server will choose the default profile.
locale string No The locale to use for parsing the OVF descriptor. If unset, the server locale will be used.
flags string No Flags to be use for deployment. The supported flag values can be obtained using ImportFlag.list. If unset, no flags will be used.
additional‑parameters DynamicStructure No Additional OVF parameters that may be needed for the deployment. Additional OVF parameters may be required by the OVF descriptor of the OVF package in the library item. Examples of OVF parameters that can be specified through this option include, but are not limited to:
  • DeploymentOptionParams
  • ExtraConfigParams
  • IpAllocationParams
  • PropertyParams
  • ScaleOutParams
  • VcenterExtensionParams
When clients pass a value of this class as a parameter, the option must contain all the attributes defined in OvfParams. When commands return a value of this class as a output, the option will contain all the attributes defined in OvfParams. If unset, the server will choose default settings for all parameters necessary for the deploy command. See LibraryItem.deploy.
default‑datastore‑id string No Default datastore to use for all sections of type vmw:StorageSection in the OVF descriptor. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: Datastore. When commands return a value of this class as a output, the option will be an identifier for the resource type: Datastore. If unset, the server will choose the default datastore.

Example

dcli com vmware vcenter ovf libraryitem deploy --ovf-library-item-id testId --resource-pool-id testId --accept-all-eula test


Filter Command

dcli com vmware vcenter ovf libraryitem filter

Description

Queries an OVF package stored in content library to retrieve information to use when deploying the package. See LibraryItem.deploy. This command retrieves information from the descriptor of the OVF package stored in the library item specified by ovf-library-item-id. The information returned by the command can be used to populate the deployment specification (see LibraryItem.ResourcePoolDeploymentSpec when deploying the OVF package to the deployment target specified by target.

Options

Option Name Type Required Description
ovf‑library‑item‑id string Yes Identifier of the content library item containing the OVF package to query. The parameter must be an identifier for the resource type: com.vmware.content.library.Item.
resource‑pool‑id string Yes Identifier of the resource pool to which the virtual machine or virtual appliance should be attached. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: ResourcePool. When commands return a value of this class as a output, the option will be an identifier for the resource type: ResourcePool.
host‑id string No Identifier of the target host on which the virtual machine or virtual appliance will run. The target host must be a member of the cluster that contains the resource pool identified by LibraryItem.DeploymentTarget.resource-pool-id. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: HostSystem. When commands return a value of this class as a output, the option will be an identifier for the resource type: HostSystem. If unset, the server will automatically select a target host from the resource pool if LibraryItem.DeploymentTarget.resource-pool-id is a stand-alone host or a cluster with Distributed Resource Scheduling (DRS) enabled.
folder‑id string No Identifier of the vCenter folder that should contain the virtual machine or virtual appliance. The folder must be virtual machine folder. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: Folder. When commands return a value of this class as a output, the option will be an identifier for the resource type: Folder. If unset, the server will choose the deployment folder.

Example

dcli com vmware vcenter ovf libraryitem filter --ovf-library-item-id testId --resource-pool-id testId


Create Command

dcli com vmware vcenter ovf libraryitem create

Description

Creates a library item in content library from a virtual machine or virtual appliance. This command creates a library item in content library whose content is an OVF package derived from a source virtual machine or virtual appliance, using the supplied create specification. The OVF package may be stored as in a newly created library item or in an in an existing library item. For an existing library item whose content is updated by this command, the original content is overwritten.

Options

Option Name Type Required Description
client‑token string No Client-generated token used to retry a request if the client fails to get a response from the server. If the original request succeeded, the result of that request will be returned, otherwise the operation will be retried. If unset, the server will create a token.
type string Yes Type of the deployable resource. When clients pass a value of this class as a parameter, the option must be one of VirtualMachine or VirtualApp. When commands return a value of this class as a output, the option will be one of VirtualMachine or VirtualApp.
id string Yes Identifier of the deployable resource. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.
library‑id string No Identifier of the library in which a new library item should be created. This option is not used if the libraryItemId option is specified. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: com.vmware.content.Library. When commands return a value of this class as a output, the option will be an identifier for the resource type: com.vmware.content.Library. If unset, the libraryItemId option must be specified.
library‑item‑id string No Identifier of the library item that should be should be updated. When clients pass a value of this class as a parameter, the option must be an identifier for the resource type: com.vmware.content.library.Item. When commands return a value of this class as a output, the option will be an identifier for the resource type: com.vmware.content.library.Item. If unset, a new library item will be created. The libraryId option must be specified if this option is unset.
name string No Name to use in the OVF descriptor stored in the library item. If unset, the server will use source's current name.
description string No Description to use in the OVF descriptor stored in the library item. If unset, the server will use source's current annotation.
flags string No Flags to use for OVF package creation. The supported flags can be obtained using ExportFlag.list. If unset, no flags will be used.

Example

dcli com vmware vcenter ovf libraryitem create --type testString --id testId