Custom Search

Friday, June 7, 2013

How to use ovftool command line utility

How to use ovftool command line utility

1)
To see all VMs in the ESXi Server 192.168.1.26
#ovftool vi://192.168.1.26

2)
To get the ovf of VM demovm1
#ovftool vi://192.168.1.26/demovm1 ~/Desktop/ovfs/
#ovftool vi://root:xxxxxx@192.168.1.26/demovm1 ~/Desktop/ovfs/



3)
To get the ovf of VM vcenter2, poweroff VM before taking ovf
#ovftool --powerOffSource vi://root:xxxxxx@192.168.1.26/vcenter2 ~/Desktop/ovfs/

4)
To get the ovf of VM using moref "238"
#ovftool vi://root:xxxxxx@192.168.1.26?moref=vim.VirtualMachine:238 ~/Desktop/ovfs/

5)
Download ovf file with progress tracking (Working)
#ovftool --machineOutput vi://root:xxxxxx@192.168.1.26?moref=vim.VirtualMachine:238 ~/Desktop/ovfs/

6)
Convert an OVF to a VMX
#ovftool -tt=vmx a2.ovf ~/Desktop/
#ovftool vm1.ovf ~/Desktop/vm2.vmx

7)
Create a new VM "p1" on ESXI node 192.168.1.26 using *.vmx file
#ovftool -ds=datastore2 -n=p1 demovm2.vmx vi://root:xxxxxx@192.168.1.26/
-ds --> Datastore
-n --> Name of new VM

8)
Create a new VM "k1" on ESXI node 192.168.1.126 using *.ovf file
#ovftool -ds=datastore2 -n=p2 demovm2.ovf vi://root:xxxxxx@192.168.1.26/

9)
Convert a VMX to an OVF
#ovftool -tt=ovf a2.vmx ~/Desktop/
#ovftool -tt=ovf demovm2.vmx .

10)
Convert a VMX to an OVA
#ovftool -tt=ova a2.vmx ~/Desktop/
#ovftool -tt=ova demovm2.vmx .

11)
How to convert ova to ovf to vmx
a)
ova to ovf
#ovftool -tt=ovf xvm1.ova .

b)
ova to vmx
#ovftool -tt=vmx xvm1.ova .

3 comments:

  1. Hi Saju,

    Can you please let me know how to use --nic option in the ovftool command line. I need to configure IP address to the vm i created in the ESXI from the command line.!! Please help me regarding this..

    ReplyDelete
  2. Hi Nagu,
    Were you able to find any example with --nic option?
    If yes, could you please share it with me...?

    ReplyDelete
  3. Hi

    Can you please let me know if we have any option to boot up server in single user mode using ovftool?

    ReplyDelete