Link to home
Start Free TrialLog in
Avatar of msCCare
msCCare

asked on

Script to Copy ESXi VM from datastore1 to datastore2

Hello,

We need to copy a virtual machine from one datastore to another.  i do not have much experience with linux commands nor do i know how to setup a scheduled task on linux.  Does anyone know how i can set up a script to

1) shutdown virtual server
2) copy folder and contents
3) turn on virtual server

I know how to do this with vmware server but no clue with esxi.  any help will be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of vmwarun - Arun
vmwarun - Arun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of msCCare
msCCare

ASKER

Thanks, I will test out the vConverter

what i did was install the RCLI and ran the following command:

C:\Program Files\VMware\VMware VI Remote CLI\bin>vmkfstools.pl --server esxiserver --username root --password ****** i /vmfs/volumes/4a0370bc-0bad878d-612b-00237def56e6/SERVER01/SERVER01.vmdk /vmfs/volumes/4a0370d7-8df714f7-5124-00237def56e6/vm-backup/SERVER01/SERVER01.vmdk -d thin -a lsilogic

I just had to do it for each hard drive.  also, using datastore1 and datastore2 did not work, it had to be the actual GUID folder name