VMware Cloud Community
RalfT74
Contributor
Contributor

How can i copy vm to local PC with cli?

Hi all,

i use ESXi 4 and cli (Windows-PC) to stop and start some vm for automation.

Now i need a copy one vm to my local PC.

I try with:

vifs.pl --server myVMServer --username root --password xxxxxxx --get "[SQLLog] SRV-Reports/SRV-Reports_1.vmdk" .

But in this case i can copy only single Files and the target directory is the "actual" folder.

How can i make a complete copy of my VirtualMachine to my local PC (example: d:\VMBackup\SRV-Reports) ?

Second Question:

Is possible to convert an ESXi 4.0 Image to VMWare Workstation 6.5 with CLI ?

thanx,

Ralf

0 Kudos
1 Reply
lamw
Community Manager
Community Manager

As you know you can export a VM using the vSphere Client, if you're trying to use vifs, then you'll wan to query all files under the VM you're trying to export which can be done using one of the vSphere SDK for Perl Utilities and then just download each file to your local system, there is no 'copy all' function. You probably also know that your VM must either be offline or have a snapshot so you can backup the disks.

Regarding converting, you can accomplish this using the free VMware Converter which can convert from various formats including from WS->ESX and ESX->WS (Converter has a CLI but not sure how well it works and not sure if its part of the free version)

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

Twitter: @lamw

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos