2

I want to automate deploying OVA image on VSphere with python. I looked up at some packages viz. Pysphere, psphere but didn't find direct method to do so. is there any Library I'm missing or is there any other way to deploy OVA/OVF files/templates on VSphere with Python. Pls help!!!

Uday Swami
  • 395
  • 8
  • 22

2 Answers2

1

I have the same situation here and found that there is vSphere automation API here made in Python. Github clone here.

All you need to do is extract SDK and download deploy_ovf_template.py for usage here or from github clone here. This template will work with OVF, but since you want to work with OVA you'll need to do extra work and extract OVA (you'll get OVF and vmdk files).

For other scenarios, check PDF documentation here.

Be aware that this is supported 6.5>= vSphere

petersohn
  • 11,292
  • 13
  • 61
  • 98
ljubon
  • 21
  • 4
-1

As far I know there are no appropriate api for deploying ovf template using python package. You can use ovftool, VMware OVF Tool is a command-line utility that allows you to import and export OVF packages to and from many VMware products. download ovftool from vmware site https://my.vmware.com/web/vmware/details?productId=352&downloadGroup=OVFTOOL350

to install ovftool:- sudo /bin/sh VMware-ovftool-3.5.0-1274719-lin.x86_64.bundle

to deploy ova image as template. syntax:- ovftool -dm=thick -ds=3par1 -n=abhi_vm /root/lab/extract/overcloud-esx-ovsvapp.ova vi://root:pwd@10.1.2**.**/datacenter/host/cluster

use os.system(ovftool_syntax) to use in your python script.