Command-line OVF Deployments
In the previous blog post, I showed how to deploy a multi-tiered OVF package using the Deploy OVF Template Wizard in the vSphere Client. The interactive workflow provided by the vSphere Client is hard to beat in terms of ease of use and simplicity. However, the graphical user interface also has it drawbacks. In particular, it can be fairly cumbersome to use if you have a large set of similar OVFs that needs to be deployed, or you want to automate a deployment. In those cases, a command-line utility is often preferred. Well, we have exactly the solution for that: OVF Tool 1.0.
OVF Tool provides a slew of different features, such as converting between OVF and .vmx formats and import/export of OVF 1.0 to vSphere 4.0, VirtualCenter 2.5/ESX 3.5 and earlier releases.
In the following I will show how to deploy the SugarCRM solution from the command-line and get exactly the same result as I got from the vSphere Client last week.
First, I probe the SugarCRM.ova to figure out what it contains and particular what parameters can be customized.
f:\>ovftool --hideEula http://aar-ovfrepo/ovf/SugarCRM.ova
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
OVF version: 1.0
Name: SugarCRM
Version: 4.5.1e
Full Version: 4.5.1e-build 131
Vendor: SugarCRM Inc
Product URL: http://www.sugarcrm.com/crm/products/crm-products.html
Vendor URL: http://www.sugarcrm.com/crm/
Annotation: The sweet way to manage customer relationships.
End-user License Agreements:
Present: Yes (1)
Download Size: 764.49 MB
Deployment Sizes:
Flat disks: 20.00 GB
Sparse disks: 1.55 GB
Networks:
Name: Network
Description: The network that the SugarCRM application will be available on
Virtual Hardware:
Family: vmx-04
Disk Types: SCSI-lsilogic
Properties:
Key: emailAdmin
Category: Application
Label: Administrator Email Address
Type: string
Description: Enter email address for administrator. This is displayed on the help page.
Key: theme
Category: Application
Label: Theme
Type: string["Sugar", "RipCurl", "Retro", "Paradise", "Love",
"Sunset"]
Description: Select the default color/graphic scheme
Key: concurrentSessions
Category: Performance
Label: Concurrent Sessions
Type: int(10..1000)
Description: The maximum allowed concurrent sessions.
Key: dbIp
Category: Network
Label: Database instance IP address
Type: ip:Network
Description: IP address for the database instance (in dot-notation).
Key: webIp
Category: Network
Label: SugarCRM IP Address
Type: ip:Network
Description: IP address on the SugarCRM application server. The service is made accessible at this IP address.
Deployment Options:
Id: small
Label: Evaluation
Description: Use this configuration for evaluation purposes only. The number of CPUs required and amount of memory used is minimized, making it possible to run the system on a desktop system.
Id: medium
Label: Production
Description: Standard settings for a typical product environment. This deployment option is suitable for a SMB production environment with less than 500 users.
Id: large
Label: Enterprise
Description: Settings for large enterprise production environments. This deployment option is suitable for a large enterprise production environment with more than 500 users.
IP Allocation Policy:
Schemes: ovfenv dhcp
Protocols: IPv4
Completed successfully
By examining this output, I can gather the same information as was shown in the vSphere Client, such as product information, download sizes, end-user license agreements, deployment options, properties that can be customized, and supported IP policy schemes.
The next step is to deploy this to my vSphere 4.0 server. OVF Tool provides a handy pseudo-interactive mode for probing the vSphere inventory, so I do not have to open the vSphere client to look up the inventory organization or names of networks and datastores. To get started, I simply try and deploy it:
f:\>ovftool http://aar-ovfrepo/ovf/SugarCRM.ova vi://aar-dev-cluster-vc1
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
Please enter login information for target vi://aar-dev-cluster-vc1/
Username: VMWAREM\renes
Password: *********
Error: Found wrong kind of object (Folder)
Possible completions are:
aar-dev-datacenter/
Jan's Test Datacenter/
Ok, so the first completion is: vi://aar-dev-cluster-vc1/aar-dev-datacenter/. After a few more iterations, I get to this:
f:\>ovftool --acceptAllEulas http://aar-ovfrepo/ovf/SugarCRM.ova vi://VMWAREM%5Crenes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
Please enter login information for target vi://aar-dev-cluster-vc1/
Username: VMWAREM\renes
Password: *********
Opening VI target: vi://VMWAREM\renes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster
Error: No target datastore specified
Datastores found on target:
Cluster VMFS
Storage1
It now provides completions for datastores. Simlilarly, OVF Tool will provide completions for networks (if there are multiple choices). The final command to deploy, customize, and power-on the SugarCRM OVF package is:
f:\>ovftool "--datastore=Cluster VMFS"
"--network=VM Network"
--acceptAllEulas
-ipAllocationPolicy=transient
--prop:emailAdmin=admin@vmware.com
--prop:theme=Retro
--powerOn
http://aar-ovfrepo/ovf/SugarCRM.ova
vi://VMWAREM%5Crenes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Opening OVA source: http://aar-ovfrepo/ovf/SugarCRM.ova
Please enter login information for target vi://aar-dev-cluster-vc1/
Username: VMWAREM\renes
Password: *********
Opening VI target: vi://VMWAREM\renes@aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Target: vi://aar-dev-cluster-vc1/aar-dev-datacenter/host/Cluster/Resources/DemoPool
Disk Transfer Completed
Powering on vApp: SugarCRM
Completed successfully
Voila! (Standard disclaimer: I inserted a few line breaks to make it more readable. How to escape spaces in parameters varies whether you are on Linux or Windows).
This was just a very quick preview of the features of OVF Tool. Consult the documentation for more examples, and download the tool today to try it out for yourself. Next time, I will dive into the internal structure of the SugarCRM OVF package.