Solved

Script to Copy ESXi VM from datastore1 to datastore2

Posted on 2009-05-12
2
949 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

Question has a verified solution.

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

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Teach the user how to delpoy the vCenter Server Appliance and how to configure its network settings Deploy OVF: Open VM console and configure networking:
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:

617 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