Solved

Script to Copy ESXi VM from datastore1 to datastore2

Posted on 2009-05-12
2
947 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need To Expand VMware Disk Size 50 110
Converting a certificate into a PEM 2 54
DC freezes when running VMTools 15 57
Keeping 2  Windows 2012 R2 servers  in Sync 4 26
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…
Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
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…

685 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