vrandom yet another random IT blog

OVFTool Photon OS deployment


This article quickly demonstrates the automated deployment of PhotonOS using OVFTool.


Firstly you must ensure you have a working OVFTool installation. You can download OVFTool here.

Once you have OVFTool deployed you can test its working by calling with the --help or --version options:

$ /usr/bin/ovftool --version
VMware ovftool 4.2.0 (build-4586971)

Basic Command

Using OVFTool is very simple, for example deploying the PhotonOS OVA is as simple as:

# ls -l
-rw-r--r-- 1 root root 206274560 Dec  1 09:14 /root/photon/stage/ova/photon-custom-1.0-19fc0f6.ova
-rw-r--r-- 1 root root 206274560 Dec  1 09:14 /root/photon/stage/ova/photon-custom-hw10-1.0-19fc0f6.ova
# /usr/bin/ovftool --noSSLVerify --diskMode=[thin|thick] --powerOn --net:None=<portgroup name> --datastore=<datastore name> --name=<VM name> <path to ova file> vi://<username>:<password>@<vcenter>/?dns=<esxihost>
# /usr/bin/ovftool --noSSLVerify --diskMode=thin --powerOn --net:None=dpg-Network1 --datastore=local-ssd --name=photonvm.test /root/photon/stage/ova/photon-custom-1.0-19fc0f6.ova vi://alex:<password>@vcenter01.local/?dns=hyp01.local
Opening OVA source: /root/photon/stage/ova/photon-custom-1.0-19fc0f6.ova
The manifest validates
Opening VI target: vi://alex@vcenter01.local:443/
Deploying to VI: vi://vcenter01.local:443/
Transfer Completed                    
Powering on VM: photonvm.test
Task Completed                        
Completed successfully

OVFTool has a rich selection of options available, for example to address exactly where to place the deployed VM in the inventory. I tend to use the ‘search by dns’ option as its highly flexible, and makes scripts less vulnerable to errors when the structure of environments changes, use the --help option to explore the options available.

If you’re wondering why I’m using a custom PhotonOS build its due to some limitations fully automating the PhotonOS deployment in a specific vSphere environment - head over to this post for more information.


Just a quick post to start the New Year off. Hopefully this will help someone fast-track their deployment of multiple PhotonOS images.