VMware Cloud Community
continuum
Immortal
Immortal

how do I copy a thin vmdk to a thin vmdk ?

I have a free ESX4u1 with one small datastore.

I added a second larger disk disk and now want to copy the vmdks from the small datastore to the new ones.

How do I do this without changing thin vmdks to thick vmdks ?




___________________________________

VMX-parameters- Workstation FAQ -[ MOA-liveCD|http://sanbarrow.com/moa241.html] - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
13 Replies
golddiggie
Champion
Champion

Use storage vMotion to migrate them. You'll be given the option, at the "Disk Format" section of the wizard to select if you want to use thin provisioning, thick provisioning, or use the "Same format as source". If the vmdk files are already thin, then you can use either the same format option, or select thin again (won't do any harm selecting thin, just might take a little longer to vMotion). I've done this several times already, without any issue.

VCP4

0 Kudos
continuum
Immortal
Immortal

I don't have storage vmotion or vcenter - I want to do it from commandline




___________________________________

VMX-parameters- Workstation FAQ -[ MOA-liveCD|http://sanbarrow.com/moa241.html] - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
oreeh
Immortal
Immortal

vmkfstools?

0 Kudos
cody_bunch
Hot Shot
Hot Shot

Without vMotion you'll need to power the VM down. After that there are two (or more) methods that can be used:

Should be able to do this in PowerCLI using move-vm:

Get-VM $yourVM | Move-VM -Datastore $yourDatastore

You should also be able use the client, by removing from inventory, moving with the datastore browser, and finally adding back to inventory.

-Cody Bunch

vExpert, VCP

-Cody Bunch http://professionalvmware.com
0 Kudos
continuum
Immortal
Immortal

Are you sure ?

I tried to copy with the client but the results are thick




___________________________________

VMX-parameters- Workstation FAQ -[ MOA-liveCD|http://sanbarrow.com/moa241.html] - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
AndreTheGiant
Immortal
Immortal

As written before, vmkfstools could be a solution:

http://communities.vmware.com/message/899630

But you have to enter in the hidden (and unsupported) console.

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
a_p_
Leadership
Leadership

Ulli,

this is an interesting question.

To test this, I set up an ESXi with 2 datastores, datastore1 (1 MB block size, 40GB), datastore2 (2 MB block size, 20GB). Then I created a thin provisioned VM on datastore1 and copied/moved it to datastore2 using the datastore browser. The result was a thick provisioned disk. That confused me, because I was sure I did that before and the result was an exact copy.

To make a long (well, not really long) story short, there is a difference in copying a folder or just the files within that folder.

If you copy/move a folder to another datastore, the result is a thick provisioned disk. If you create an empty folder on the target datastore and cut & paste all the files from the source folder to the target folder you will end up with a 1:1 copy.

André

PS: The test was performed on an ESXi 4.0 running on VMware Workstation 7. However this should behave the same way as on physical hardware.

continuum
Immortal
Immortal

this is really bizzare Smiley Wink

Have a look at the screenshot.

I created a new directory on a second datastore and then used the datastorebrowser copy and paste function.

The basedisk really is copied to thin vmdk but a small snapshot which was a few kb in the original now is 1.7 Gb .... weird






___________________________________

VMX-parameters- Workstation FAQ -[ MOA-liveCD|http://sanbarrow.com/moa241.html] - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
Borja_Mari
Virtuoso
Virtuoso

Hi,

maybe if you delete the snapshot before make the copy do the trick? Smiley Wink

Regards/Saludos,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. ¡¡Muchas gracias!!

Virtually noob blog

------------------------------------------------------------------------------------------------- PLEASE CONSIDER AWARDING any HELPFUL or CORRECT reply. Thanks!! Por favor CONSIDERA PREMIAR cualquier respuesta ÚTIL o CORRECTA . ¡¡Muchas gracias!! VCP3, VCP4, VCP5-DCV (VCP550), vExpert 2010, 2014 BLOG: http://communities.vmware.com/blogs/VirtuallyAnITNoob
0 Kudos
continuum
Immortal
Immortal

that is not what I want.

I just want to know how to copy thin to thin without needing to prepare or change the VMs first




___________________________________

VMX-parameters- Workstation FAQ -[ MOA-liveCD|http://sanbarrow.com/moa241.html] - VM-Sickbay


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
a_p_
Leadership
Leadership

Ulli,

I agree, that's really weird.

Today I had some time to do some more tests on this issue.

Copying the snapshot vmdk resulted in the size of a consolidated vmdk (base + snapshot). So I deleted all files except for the snapshot vmdk (actually the two files which only show up as one file in the data browser). Trying to copy this file resulted in an error message.

I did a couple of other things which all resulted in the large snapshot file, until I finally found a way which seems to work.

First I created a folder on the target datastore and copied all files except for the snapshot vmdk to that new folder. At that point all of the copied files had the same size as the source. Then I created a new dummy folder on the source datastore and moved the snapshot vmdk to this folder (actually you could also delete all of the already copied files from the source folder to isolate the snapshot vmdk). Next I moved the folder containing the snapshot vmdk to the target datastore and finally I moved the snapshot vmdk to the folder containing the other files.

Well, at least in my opinion this is definitely not the way this should work, so it's up to you to try this with production vm's. Make sure you at least have a consistent backup before doing it.

Maybe a VMware employee comes around and gives dev a hint about this issue.

Good luck and keep your fingers crossed

André

0 Kudos
jsmithsd
Contributor
Contributor

I stumbled upon this thread while researching something similar. Figure I'll share as it seems semi-related to what you're seeing.

I have an ESXi 4 update 1 installation with a datastore (local) and a two thick VMDK files running VMs. I setup an NFS share and added it to ESXi and performed a copy of the VMDKs, and then pasted them to the NFS share.

Result? Thin disks.

I actually wanted to perform a Thin conversion eventually but hadn't gotten around to it yet. They boot fine. /shrug

0 Kudos
a_p_
Leadership
Leadership

This is by design. What you are seeing is the expected behavior for NFS.

see http://kb.vmware.com/kb/1005418 for details

André

0 Kudos