i want to download vmx file locally, for example, down vmx file from ESXi to loacl path /home/vmfoler/
You can directly download the .vmx file from datastore browser using vsphere client (or) you can use tools like winscp to navigate to the VM folder path and copy it.
But why are you downloading the .vmx file, what is the reason behind it.
my program run like this:
1、the program use vSphere Web Services SDK to connect vsphere server.
2、 take snapshot form a vm , the vm will be bakcup.
3、in the server that my program running, there has some *.vmdk files in the locally path;
4、the program use VDDK connet to the snapshot disks, and copy the snap shot disk data to the locally disk vmdk file;
5、 delete the sanoshot;
when the vm in the vsphere server can not use, we should use nfs to mount the locally vmdk file to the vsphere server, but we dont have the vmx file to register the a new vm to the vsphere server.
the new vm must have the same configure as the snapshot vm take before, and vm disk is the diskes we backup before.
You may create new VM with same configuration and map the backup local .vmdk files to it. SvMotion after that will help you in bringing all the files (vmx, vmdk , nvram etc) in single folder with required name. But in this case, UUID and MAC will get change.
hi, GPVenkatesh, thank you very much for give me some advise.
but in this case, the vm in the vsphere sever is can not used or the vm is delete from the vsphere server, so the vm configuration can not kown.
we must record the vm configuration every bakcups.
Then you may consider using backup solution for your virtual infrastructure which will help you with image level, file level, application level backup and restore.
For example - Veeam Backup, Veritas Netbackup, VMware VDP etc.
Hi, I use the same approach - utilize curl to get / put files to a datastore via HTTPS. It's the simplest way imho. Don't forget to urlencode the path to deal with special characters.
Works both for vCenter and standalone ESXi.
thank you so much