VMware Cloud Community
dat5904
Contributor
Contributor

Moving VM from one storage to another

Hi ,

We have four datastore all are local . No SAN. Now due space problem we have tried move VM from one storage to another . NOw problem is there are two copy of VM on both datatstore. And VMDK name has been changed. I have attached screenshot with this. We have start VM from its old storage location. it works ok . But one of the vmdk file is on other datastore. Can we move that VMDK to old LOcation. problem is both datatstore have same VMDK Filename.  how to resolve it. we have not  move VM by SvMotion because we have only std. Licence.

0 Kudos
7 Replies
MauroBonder
VMware Employee
VMware Employee

Hi,

You can use FastSCP to do this realocation. Or converter depending of scenario ( http://www.vmware.com/go/download-converter ).

And to rename vmdk´s check http://kb.vmware.com/kb/1002491

Hope help.

Good Luck

*Please, don't forget the awarding points for "helpful" and/or "correct" answers. *Por favor, não esqueça de atribuir os pontos se a resposta foi útil ou resolveu o problema.* Thank you/Obrigado
0 Kudos
dat5904
Contributor
Contributor

all copied well but now when i start vm getting error "unable to access file since it is locked"

0 Kudos
Texiwill
Leadership
Leadership

Hello,

Moved to the Virtual Machine and Guest OS forum.

I believe you also copied over the working files. Look at the 'vmware.log' file associated with the VM to determine which file is locked.

Best regards,

Edward L. Haletky

Communities Moderator, VMware vExpert,

Author: VMware vSphere and Virtual Infrastructure Security,VMware ESX and ESXi in the Enterprise 2nd Edition

Podcast: The Virtualization Security Podcast Resources: The Virtualization Bookshelf

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
MauroBonder
VMware Employee
VMware Employee

Try power off this virtual machine.

Might this virtual machine is powered on and have a .LCK (lock) in this disk vmdk


Please, don't forget the awarding points for "helpful" and/or "correct" answers. 

Mauro Bonder - Moderator

*Please, don't forget the awarding points for "helpful" and/or "correct" answers. *Por favor, não esqueça de atribuir os pontos se a resposta foi útil ou resolveu o problema.* Thank you/Obrigado
0 Kudos
murreyaw
Enthusiast
Enthusiast

You have to down the VM to get the file lock to release.  Also make sure that that particular VM isn't running on another host that has access to that storage. 

0 Kudos
BSRKrishna
Enthusiast
Enthusiast

HI ,

Sorry for the dalay ..

using vmkfstools command you can resolve the issue .

vmkfstools VM-Disk and VMFS Management in the console

vmkfstools  -X

Extend virtual Disk

vmkfstools  -X  12G ./testing.vmdk

To extend an existing Virtual Disk to 12GB. Instead of G you can use M for Megabytes
With the same command you can shrink the disk (only for ESX Version prior to 3.0)   if you choose a smaller than the present size. Be aware if the  shrinked size is smaller as the partition size in the guest there might  be a data losse or a corrupted system resulting!


In some cases the shrink command must be issued with the --force option:

vmkfstools -X  4G ./testing.vmdk --force

For shrinking on ESX 3.0x   use the VMWare Converter (download from the VMware Website for  freee).  Point the source and destination to the same ESX Host.

If you receive an error one parameter was incrorrect the size might be smaller as the original size!

If you have blanks in the file or directoryname, mask the full path with  '

vmkfstools  -i

To export or clone a virtual disk from VMFS
vmkfstools -i  <source-file> -d diskformat <destination-file>

Example:

Copy from one vmfs to another:

Source=/vmfs/volumes/esxpublic/testvm2.vmdk
Destination=/vmfs/volumes/production/testvmnew2.vmdk

vmkfstools -i /vmfs/volumes/esxpublic/testvm2.vmdk /vmfs/volumes/production/testvmnew2.vmdk

Export to ext3 partition:

Source=/vmfs/volumes/esxpublic/testvm2.vmdk
Destination=/vmimages/testvm2.vmdk

vmkfstools -i  /vmfs/esxpublic/testvm2.vmdk -d 2gbsparse /vmimages/testvm2.vmdk

vmkfstools  -E

Rename files associated with a specified virtual disk

vmkfstools  -U

Delete Virtualdisk
Delete files associated with the specified virtual disk.

vmkfstools  -c 4000M ./file.vmdk

To create a new empty virtual disk

vmkfstools -c 300G -a lsilogic /vmfs/volume/vmfslabel/directory/newdisk.vmdk

or in current directory

vmkfstools -c 300G -a lsilogic ./newdisk.vmdk

This command is very useful because you can use user-friendly names for the disks

Please let me know still issue not resolved

Thanks & Regards,

BSR Krishna

Thanks & Regards, BSR Krishna If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
nancy31
Enthusiast
Enthusiast

Thank you for sharing the information.  I will take note on all the solution you shared http://imagicon.info/cat/5-59/1.gif

0 Kudos