VMware Cloud Community
mudha
Hot Shot
Hot Shot

vmdk file

When we try to copy a vmdk file from one datastore to another using cp command, it will not allow. Why? As moving this same file is possible using storage vmotion (svmotion)?

Thanks

Reply
0 Kudos
10 Replies
AndreTheGiant
Immortal
Immortal

You cannot copy a file that is in use (if the VM is powered on).

Use SVmotion instead.

Andre

**if you found this or any other answer useful please consider allocating points for helpful or correct answers

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
Reply
0 Kudos
mudha
Hot Shot
Hot Shot

does that mean that my vm is in use so i can use svmotion and move the vm, so if the vm is power off then can move my vmdk file

thanks

Reply
0 Kudos
depping
Leadership
Leadership

if your VM is in use you will need to use Storage VMotion to move it. If it powered off you should use the "cold migration" feature to move it. (VMotion it when the VM is powered off, this will give you the option to move it)

Duncan

VMware Communities User Moderator | VCP | VCDX

-


Blogging:

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
malaysiavm
Expert
Expert

when you try to move the vmdk or vmdk flat file, I will suggest you do this from the virtual center. If you manually copy from the command line, and deleted the original vmdk and flat file, you may end up have to manual edit the vm configuration file to point to the new location

Craig

vExpert 2009

Malaysia VMware Communities -

Craig vExpert 2009 & 2010 Netapp NCIE, NCDA 8.0.1 Malaysia VMware Communities - http://www.malaysiavm.com
Reply
0 Kudos
htoudiee
Contributor
Contributor

You mentioned "copy". You can easily clone the VM while it's powered on to another VM. After clone is done, you have a copy of all the files that make up your source VM. You can now do what you need to with that set of files.

Reply
0 Kudos
mudha
Hot Shot
Hot Shot

yes that's right.. but my question is can i copy my vmdk file to another storage by cp command..

i guess know and we have to use storage vmotion or cloning why it is ?

what is thw limitation ??

thnaks

Reply
0 Kudos
mcwill
Expert
Expert

From memory, I was told you shouldn't use the cp command to copy vmdk files.

Instead the vmkfstools should be used to copy vmdk disks, this allocates the full destination file space and then dd's the data across.

mudha
Hot Shot
Hot Shot

why it is not supported and if u can share the vmkfstool comanad guide it would be great

thanks for your help.

Reply
0 Kudos
mcwill
Expert
Expert

If you do a search on cp & vmkfstools you will pick up quite a few threads discussing this in some detail.

As for how to use vmkfstools, the following site is useful...

esxguide

specifically

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

Reply
0 Kudos
azn2kew
Champion
Champion

You could try vSphere Client method right click VM->Migrate->choose neither move to different host or move the disk to different storage. These two can be done while VM is on, but you have to do one process at a time but doable, if you want to try both migrate VM/disk to different hosts and storage, than the VM must be off. I found this method is fast and easy to do so give it a shot.

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

Regards,

Stefan Nguyen

VMware vExpert 2009

iGeek Systems Inc.

VMware, Citrix, Microsoft Consultant

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!! Regards, Stefan Nguyen VMware vExpert 2009 iGeek Systems Inc. VMware vExpert, VCP 3 & 4, VSP, VTSP, CCA, CCEA, CCNA, MCSA, EMCSE, EMCISA
Reply
0 Kudos