ovftool

来源:互联网 发布:网络政治参与缺陷 编辑:程序博客网 时间:2024/06/07 08:14

OVFTOOL

convert local vmx to vsphere:
$ ovftool -ds=ntnx1 -n=vm1 -nw="VM Network" CentOS.vmx vi://root:vmware@192.168.0.200/Datacenter/host/Cluster/Opening VMX source: CentOS.vmxOpening VI target: vi://root@192.168.0.200:443/Datacenter/host/Cluster/Deploying to VI: vi://root@192.168.0.200:443/Datacenter/host/Cluster/Transfer Completed                    Completed successfully

convert ova to vmx
$ ovftool -tt=vmx xvm1.ova . 

convert vm from esx to local (VM Power off )
$ ovftool  vi://root:vmware@192.168.0.200/Datacenter/host/Cluster/Resources/vms/gw . 



refer:
http://fosshelp.blogspot.com/2013/06/how-to-use-ovftool-command-line-utility.html

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 .

0 0
原创粉丝点击