Unsupported content

 

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Creating the input file

This topic provides instructions for creating the input file for Open Virtualization Format (OVF) provisioning:

Sample input file

SourceURL=/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/Virtual Machines/vm-99
Target=/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/domain-c23,/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/82000000/BMC_VMware_datastores/datastore1(1),cluster
ProvisionDataStore=Class://SystemObject/Datastore/Provisioning Datastore/datastore
CleanupOption=2
VGPFolderPath=/VGP
VGPandTemplateName=myGentoo32

Input file element

Description

SourceURL

(Required) The virtual machine (VM) that you want to capture. This is expressed as a web services URI. For information on how to build this, see Building the SourceURL.

Target

(Required) List of comma-separated statements about the target Virtual Center server. For information on how to build the Target statement, see Building the target.
You can have multiple Target statements.

ProvisionDataStore

(Required) The VM Capture Job captures the source VM as an .ovf file. The ProvisionDataStore statement specifies the BMC Server Automation datastore where you want to store the .ovf file.
Use this syntax:
Class://SystemObject/DataStore/Provisioning Datastore/<hostname_of_datastore>
Example:
Class://SystemObject/DataStore/Provisioning Datastore/ProvisioningStore

CleanupOption

(Optional). Whether or not to delete the .ovf file and .vmdk payload file(s) from the provisioning datastore. Set this to one of the following integers:

  • 1 — Always delete.
  • 2 — Never delete.
  • 0 — Delete either when the VM Capture Job has successfully completed, or when the capture operation has failed. In the case of failure, any partial payload or .ovf that was copied is cleared. This is the default. If you do not specify a value for CleanupOption, 0 is assumed.

VGPFolderPath

(Required) The Depot folder where you want to store the VGP that this job creates. For example:
VGPFolderPath=/VGP indicates a folder called VGP, located right under the top-level Depot folder.
After the job successfully creates a template on the Virtual Center server, it creates a VGP in the folder specified here.

VGPandTemplateName

(Required) The name to use for both the VGP and the template(s).

Building the SourceURL

SourceURL is the web services REST URI of the source VM that you want to capture. It starts with the /id prefix. Here is an example of how to get this URI. For more information, see Working with Web Services.

Suppose the machine you want to capture is a VM called Gentoo32, located on a Virtual Center server called 10.0.3.35.

The following line specifies the machine in the input file:

SourceURL=/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/Virtual Machines/vm-99

To build this line, you append three parts:

  • /id uri of the Virtual Center server
    In this example the /id uri is: /id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/
    For information on how to get this /id uri, see Getting the REST /id uri.
  • The following keyword string:
    Assets/BMC_VMware_VirtualInfrastructureManager/<version_number>/Virtual Machines/
    In this example, the keyword string is:
    Assets/BMC_VMware_VirtualInfrastructureManager/82000000/Virtual Machines/
    For information on how to get the version number, see Getting the version number
  • Internal name of the VM that you want to capture.
    In this example, the display name is Gentoo32, but the internal name is:
    vm-99
    For information on how to get the internal name of the virtual machine, see Getting the internal name of the VM.

Getting the REST /id uri

List the servers in the smart group that contains the Virtual Center server 10.0.3.35. In this case, the smart group is called VC.

Make sure web services in enabled on your Application Server, and then type a line like this in a browser:

https://myAppServer:9843/group/Servers/VC/?username=BLAdmin&password=password&role=BLAdmins

Substitute correct names, roles, and passwords for your environment.

The result looks something like this:

Look for the server with name=10.0.3.35 and you see that its uri is:
/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4

Getting the version number

The next part of the line you are building is a keyword string which includes a version number:

Assets/BMC_VMware_VirtualInfrastructureManager/<version_number>/Virtual Machines/

The version number is an attribute of the asset BMC_VMware_VirtualInfrastructureManager. Display the version number of this asset by taking the /id uri you just got and typing a line like this in a browser:

https://myAppServer:9843/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager?username=BLAdmin&password=password&role=BLAdmins

The result looks something like this:

In this example, the version number is 82000000.

So the keyword string looks like this:

Assets/BMC_VMware_VirtualInfrastructureManager/82000000/Virtual Machines/

Getting the internal name of the VM

Next, append the keyword Assets to the SourceURL string you are building:
/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets

Now append the asset class and the version. To list all the available asset classes, type the following:

https://myAppServer:9843/type/AssetClasses/?username=BLAdmin&password=""&role=BLAdmins

Among the asset classes, you will see:

<AssetClass name="BMC_VMware_VirtualInfrastructureManager" type="6032" version="802000" uri="/type/AssetClasses/BMC_VMware_VirtualInfrastructureManager/802000"/>

In this case, you want BMC_VMware_VirtualInfrastructureManager, version 802000, so add this to the SourceURL string by using this syntax:

/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/802000

Now list the assets belonging to BMC_VMware_VirtualInfrastructureManager/802000:

https://myAppServer:9843/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/802000/?username=BLAdmin&password=%22%22&role=BLAdmins

You will see that Virtual Machines is one of the assets, so append it to the SourceURL string you are building:

/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/802000/Virtual Machines

Now list the assets belonging to Virtual Machines:

https://myAppServer:9843/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/802000/Virtual%20Machines/?username=BLAdmin&password=%22%22&role=BLAdmins

You will see Gentoo32 listed as an asset. You cannot use the display string Gentoo32 in the SourceURL you are building. Instead, you must use the internal name of the Gentoo32 virtual machine.

To get the internal name, vm-99, take the /id uri you have been using, and list the virtual machines by typing a line like this:

https://myAppServer:9843/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/Virtual%20Machines/?username=BLAdmin&password=password&role=BLAdmins

The result looks something like this:

  1. Find the Asset with the name Gentoo32.
  2. In the AssetAttributeValues section, find the AssetAttributeValue with the name InternalName.
  3. InternalName has a value of vm-99.

Appending three parts together to create SourceURL

The following table summarizes how to obtain the three parts of the SourceURL and append them.

Part

Example

How to get it

REST /id uri of Virtual Center server

/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/

#Getting the REST /id uri

Keyword string:
Assets/BMC_VMware_VirtualInfrastructureManager/<version_number>/Virtual Machines/

Assets/BMC_VMware_VirtualInfrastructureManager/82000000/Virtual Machines/

#Getting the version number

Internal name of virtual machine

vm-99

#Getting the internal name of the VM


Completed SourceURL with three parts appended together:

SourceURL=/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/Virtual Machines/vm-99

Building the target

Before building the Target statement, familiarize yourself with the concepts in Building the SourceURL.
The Target statement is a comma-separated list of the following elements:

  • TargetURL (required)
  • DatastoreURL (required)
  • TargetType (required)
  • TargetNetwork (optional)

The general syntax is:

Target=<TargetURL>,<DatastoreURL>,<TargetType>,[TargetNetwork]

These elements describe various aspects of the target Virtual Center.

You can have multiple Target statements in the input file.

Example Target statement

Target=/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/domain-c23,/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/82000000/BMC_VMware_datastores/datastore1(1),cluster

The next sections describe how to build the TargetURL, DatastoreURL, TargetType, and TargetNetwork elements.

TargetURL

This is the location on the Virtual Center server where you want to store the templates the job generates.

Example TargetURL element

/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/domain-c23

To build this line, append three parts, much you like you did for SourceURL:

  • /id uri of the Virtual Center server
    Get this as described in Getting the REST /id uri.
  • The following keyword string:
    Assets/BMC_VMware_VirtualInfrastructureManager/<version_number>/
    Get the version number as described in Getting the version number.
  • Internal name of the container, which can be a cluster, resource pool, or host.
    In general, you can follow the instructions for getting the internal name of a virtual machine (Getting the internal name of the VM), replacing the Virtual Machinesstring with one of the following keywords:
    • BMC_VMware_Clusters
    • BMC_VMware_ResourcePools
    • BMC_VMware_VirtualSystemEnablers

The next section provides additional details.

Getting the internal name of the cluster, resource pool, or host

To get the internal name, list the clusters, resource pools, or hosts using the following keywords:


The following example shows you how to get the internal name of a cluster by listing the clusters:

https://myAppServer:9843/id/SystemObject/Server/c1dfbd73-3e01-4ffc-881b-4477a68ac49c/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/BMC_VMware_Clusters/?username=BLAdmin&password=password&role=BLAdmins

Result:

In this example, the internal name of the cluster is domain-c285.

DatastoreURL

This is the Virtual Center datastore where you want to store associated template files.

Example

/id/SystemObject/Server/21e41b60-760d-48f5-8c6b-c753e9f435a4/Assets/82000000/BMC_VMware_datastores/datastore1(1)

To build this line, append three parts, much like you did for SourceURL and Target URL:

  • /id uri of the Virtual Center server
    Get this as described in Getting the REST /id uri.
  • The following keyword string — This is a different keyword string than the one used for SourceURL and TargetURL:
    Assets/<version_number>/BMC_VMware_datastores/
    Get the version number as described in Getting the version number.
  • Internal name of the Virtual Center datastore.
    In general, you can follow the instructions for getting the internal name of a virtual machine (Getting the internal name of the VM), replacing the Virtual Machines string with the following keyword: BMC_VMware_datastores

The following example shows you how to get the internal name of a datastore by listing the datastores:

https://myAppServer:9843/id/SystemObject/Server/c1dfbd73-3e01-4ffc-881b-4477a68ac49c/Assets/BMC_VMware_VirtualInfrastructureManager/82000000/BMC_VMware_datastores/?username=BLAdmin&password=password&role=BLAdmins

Result:

In this example, the internal name of the datastore is datastore-2347.

TargetType

The Virtual Center entity that the templates are targeted to. Set this to one of the following values (case insensitive):

  • Cluster
  • Host
  • ResourcePool

TargetNetwork

Optional. The network for the target. Set this to any valid network name present on the target Virtual Center server.

Was this page helpful? Yes No Submitting... Thank you

Comments