VMware Cloud Community
ChanKaiShi
Enthusiast
Enthusiast

How do I move VMDK between datastores?

Hello,

I have virtual machine on ESXi with 3 VMDK files. In properties for virtual machine all virtual HDDs shown as located on same datastore while in actuality I can see one of the disks exists on another datastore. Names of HDDs are machine-000001.vmdk, machine_1-000001.vmdk, machine_2-00001.vmdk all located on Disk2. If I browse Disk 1 I can see file under machinename folder called machine_2.vmdk and machine_flat.vmdk.

I'm trying to figure out how can I move one of the VMDK between different stores and why even though properties of VM show all VMs are on DISK 2 some of files are actually on DISK 1?

Reply
0 Kudos
12 Replies
weinstein5
Immortal
Immortal

Do you have virtual Center - if you do it is quite easy - you can cold migrate the VMs, migrating with them powered off, which will allow you to move datastores or if have vMotion you would be able to sue Storage vMotion which will allow you to move the VM's virtual disk while the VM is running. If not you will have to manually do it through the Remote CLI -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
ChanKaiShi
Enthusiast
Enthusiast

This ESXi forum. I don't have VC.

Reply
0 Kudos
norregaard
Expert
Expert

It looks like you have snapshots on the two VM's. If you commit/delete the snapshots, you should see the amount of files go down to two (if it is two VMs that you have...)

Reply
0 Kudos
ChanKaiShi
Enthusiast
Enthusiast

I looked at snapshot manager and there is something there called "Consolidate Helper - 0" as snapshot which I did not initiate. Strange.

Reply
0 Kudos
norregaard
Expert
Expert

Are you in the progress of comitting a snapshot? This can generate such a helper snapshot. Or it can, I believe, be related to VCB if you're using that.

If you're in the process of comitting a snapshot, then see link below on how to follow the process (it times out in VC if it takes more than 15 minutes)

Reply
0 Kudos
hstagner
VMware Employee
VMware Employee

Hello ChanKai Shi,

FYI. You can manage ESXi with vCenter as well. Anyway, there are several options to move the VM's.

-You could use the RCLI and SCP

-You could use FastSCP 3.0

-You could use the datastore browser in the VI client to download all of the VM files to your local machine (or some other location), connect to the destination ESXi host with the VI client and upload the VM files.

With all of these options, you will need to register the VM on the destination ESXi host either using the RCLI or by using the datastore browser, right-clicking on the *.vmx file and selecting "Add to Inventory"

I hope this helps.

Don't forget to use the buttons on the side to award points if you found this useful (you'll get points too).

Regards,

Harley Stagner

----------------------------------------- Don't forget to mark this answer "correct" or "helpful" if you found it useful (you'll get points too). Regards, Harley Stagner VCP3/4, VCAP-DCD4/5, VCDX3/4/5 Website: http://www.harleystagner.com Twitter: hstagner
Reply
0 Kudos
ChanKaiShi
Enthusiast
Enthusiast

I just want to move single file from one datastore to another and leave the rest of VMDK files on old disk. I'm using VI client to move file via GUI but since only single file is moved, do I need to do anything about updating configuration of virtual machine for this?

Reply
0 Kudos
norregaard
Expert
Expert

Like weinstein5 proposed, I would use SVMotion to do it, then all relevant files will be moved. And you don't have to shut down the VM. There's a graphical plugin for VI client that you can use. Then it's just drag and drop.

Reply
0 Kudos
TomHowarth
Leadership
Leadership

you can not use sVmotion if you do not have vCenter.

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

Tom Howarth VCP / vExpert

VMware Communities User Moderator

Blog: www.planetvm.net

Contributing author for the upcoming book "VMware Virtual Infrastructure Security: Securing ESX and the Virtual Environment”.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
TomHowarth
Leadership
Leadership

Which version of ESXi are you using?? you have snapshots on your machine this is shown by the 00001 format of your VMDKs. you need to be careful here as if you do not do it correcty you can ruin your guest configuration thereby causing you a world of pain.

the first thing you need to do is remove those shapshots - do this before attempting to move anything.

you can use vConverter to do this - it is free.

the next part I am not too sure as to what you are exactly asking.

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

Tom Howarth VCP / vExpert

VMware Communities User Moderator

Blog: www.planetvm.net

Contributing author for the upcoming book "VMware Virtual Infrastructure Security: Securing ESX and the Virtual Environment”.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
JenkinsG03
Contributor
Contributor

Would this scenario work?

Using the vSphere Client

1. Shutdown the VM

2. Detach The VMDK that holds the OS volume.

3. Move the OS VMDK from DS3_Data to DS2_VM

4. Attach the OS VMDK to the VM

5. Restart the VM

Environment:

Virtual machine with two drives.

The OS and data drives are located on the same datastore, an iSCSI target, built from an old server and running OpenFiler.

ESXi 4.1 Host

No paid licenses

Datastores:

DS1_Int_Swap (Small IDE drive holding just swap files)

DS2_Int_VM (160gb SATA drive)

DS3_SAN_Data (iSCSI attached OpenFiler)

Reply
0 Kudos
VirtualDave999
Contributor
Contributor

I am working with a Vi 3.5 release 5

I moved the VMDK (and all other files relating to this VM ) to a new LUN..  The original  VM Icon was removed from inventory   I tried to register the   register the VM on the destination ESX host by browseing to  the  *.vmx file in the datastore and selecting "Add to Inventory"  It showed me the cluster I have, but no host show appear any of the steps of this wizard.    I am wondering if there is a problem with the cluster .   Or is there a way I can register the VMX file directly with the host.   

I also tried to create a new VM with the custom option that allowed me to point at the existing vm dsk.   However it appears that the snap shot is running because the application is no long installed.    And a new fold was created with the  append name of the orginal folder - an 1 or an A was added (sorry I don't recall which it was)      I did move the files with a snapshot as part of the package and I read after doing so that can cause problems.  

Any insight that can be provided would be very helpful.   :smileyconfused:

Thanks,

Dave

Reply
0 Kudos