Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Script to Copy ESXi VM from datastore1 to datastore2

Posted on 2009-05-12
2
Medium Priority
?
953 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 2000 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

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

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

In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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