VMware

This Question is Answered

1 "helpful" answer available (6 pts)
1 2 Previous Next 18 Replies Last post: Dec 5, 2007 9:33 AM by wila  

How is "vmkfstools -i old.vmdk new.vmdk" different from just copying the .vmdk file? posted: Oct 22, 2007 11:37 AM

Click to view franl's profile Novice 9 posts since
Oct 22, 2007

I understand that I can manually clone an ESX Server virtual machine disk using vmkfstools -i option and then create a new virtual machine that references that new disk file. But how is that different from just copying the .vmdk files using the Console OS's cp command?

From the vmkfstools man page, it seems like the -i option is mainly for use in combination with the -d option to change the format of the disk file. But I don't want to change the format, just make a copy of it.

Am I violation some fundamental rule of VMware by just copying the .vmdk files instead of using "*vmkfstools -i old.vmdk new.vmdk*?

Click to view esiebert7625's profile Guru 6,794 posts since
Oct 23, 2006
See this thread...


Using vmkfstools instead of scp to copy virtual disks - http://www.vmware.com/community/thread.jspa?messageID=704200

-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-
Thanks, Eric
Visit my website: http://vmware-land.com/
-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-

Click to view sbeaver's profile Guru 7,719 posts since
Nov 1, 2004

A while back ago there was some talk about this and if my memory serves me correctly it had to do with the way it does the copy and something about the locks or scsi reservations but it as been a while. Bottom line is you want to use vmkfstools to do this. Maybe someone with better memory will pipe up


Steve Beaver
VMTN Forum Moderator

**Virtualization is a journey, not a project.**

Click to view Dave.Mishchenko's profile Guru 8,943 posts since
Nov 15, 2005
vmkfstools will allocate all of the disk space required for the copy of the file up front. This is different from cp in that it will keep expanding the size of the copied file as it copies data over. The task of expanding a file on vmfs can create performance issues because the host has to lock the entire VMFS while it expands the vmdk which creates a momentary I/O pause for any VMs on that same LUN.
Click to view troberts's profile Enthusiast 62 posts since
Nov 3, 2004
You can use vmkfstools -i to back up virtual disk files created with ESX Server to non-VMFS file systems, or to convert ESX Server virtual disks to a format that can be used with GSX Server and Workstation. Just using cp to copy an vmdk file to a non-VMFS filesystem will corrupt the vmdk because the blosk sizes are different.

Click to view oreeh's profile Guru 9,872 posts since
Nov 30, 2005
Since troberts has the 3-boxes logo and is a VMware TSE...
Click to view sbeaver's profile Guru 7,719 posts since
Nov 1, 2004
as the host file system supports these large files

This is what is key. If you try to send a 500GB file to a file systems that does not support files that big or has a different block size things will get screwed up.
Click to view sbeaver's profile Guru 7,719 posts since
Nov 1, 2004
For me it was getting bit and learning from there :)
Click to view troberts's profile Enthusiast 62 posts since
Nov 3, 2004

Please read http://kb.vmware.com/kb/900

VMware does not support the use of virtual machine disk files moved from a VMFS volume to a non-VMFS file system by SCP or FTP. When you move a virtual machine disk file to a non-VMFS file system without using the vmkfstools export command or the file manager in the VMware Management Interface, the resulting disk file is completely corrupted and is rendered unusable. This is because the file format is completely different and a non-VMFS file system does not understand how to handle a file created under a VMFS file system.

Click to view oreeh's profile Guru 9,872 posts since
Nov 30, 2005
Thanks for the KB entry Todd - bookmarked for further reference when the question comes up again :D
Click to view troberts's profile Enthusiast 62 posts since
Nov 3, 2004

I believe your referring to the following

"From the service console, you can view and manipulate files in the /vmfs/volumes
directory in mounted VMFS volumes with ordinary file commands, such as ls and cp.
Although mounted VMFS volumes might appear similar to any other file system, such
as ext3, VMFS is primarily intended to store large files, such as disk images with the
size of up to 2TB. You can use ftp, scp, and cp commands for copying files to and from
a VMFS volume as long as the host file system supports these large files."

I should clarify my statement a bit. If you're using ESX3 you can use standard *nix commands like ftp, scp, and cp commands for copying files, but it's is a very inefficient way of copying/moving files. vmkfstools is much better at this and is always the recommend way.

ftp, scp, and cp commands operate in the following manner

1. program says "i need a block to write data"

2. block is given

3.data is written

4. repeat until all data is copied

scsi reservations may occur during this process

vmkfstools operates in the following manner

1. I need X blocks

2. X blocks are given

2. data is written

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities