Solved

Script to Copy ESXi VM from datastore1 to datastore2

Posted on 2009-05-12
2
945 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:msCCare
2 Comments
 
LVL 19

Accepted Solution

by:
vmwarun - Arun earned 500 total points
ID: 24372269
I am not sure about scripts.

The alternative is to use VMware vConverter to copy/move the VM from one source to another.

Steps

1.Shutdown the VM
2.Use VMware vConverter to select the Host on which the VM is located.
3.Move the VM to the desired location.

Another alternative is to just shutdown the VM and use Veeam FastSCP or WinSCP to copy the VMX and VMDK File from the source location to the destination.
0
 
LVL 1

Author Comment

by:msCCare
ID: 24379688
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
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VMware 6.0 second VCenter question 3 55
Veeam Synthetic Full Backup 6 71
Punctured RAID5 Array on Cisco UCS server. 6 59
Issues installing VSphere VCenter Server Appliance 13 50
When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question