QBoard » Advanced Visualizations » Viz - Python » How Can I deploy OVA file on Vsphere Client with python

How Can I deploy OVA file on Vsphere Client with python

  • 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!!!
      August 5, 2021 4:04 PM IST
    0
  • 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
      September 14, 2021 1:34 PM IST
    0
  • 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.

      October 4, 2021 1:32 PM IST
    0
  • Once you have downloaded the OVA file, please follow the steps below to deploy the virtual Appliance via VMware vSphere / vCenter Server: 

    1. Log in to the VMware vSphere Web Client and go to the VMs tab 
    2. Add the Deploy OVF Template action button via the Actions dropdown list  
    3. Then click the newly added Deploy OVF Template button
    4. A new window will open asking to select a template, click the Browse button then select the OVA file you received, then click Next
    5. Select the location where you want to deploy the virtual appliance, then click Next
    6. Now select the resource you want to use to run the virtual appliance, click Next
    7. Please review the package details, which contains advanced configuration options, then click Next to accept these options 
    8. Now select the desired storage location from the list of datastores, then click Next
      • Recommended virtual disk format: Thick provision lazy zeroed

    9. Then select a destination network from the dropdown list for each source network, click Next
    10. Please review the configuration data, then click the Finish button when ready
    11. The system will now import and deploy the file, once completed click the Refresh button to update the system
    12. The Login PI 3 Appliance will now be visible in the center windowpane, select the VM and click Power On
    13. Once the VM is powered on, click the Open Console icon to open the VM console in a new window 
      October 26, 2021 12:42 PM IST
    0