VMware Cloud Community
virtualesxer
Contributor
Contributor
Jump to solution

Making a backup without the 'empty' space

Hello,

Wanting to make backup, I read the following document:

http://www.vmware.com/pdf/vi3_301_201_vm_backup.pdf

But what I didn't find was a way to backup a whole VM, sans the empty space (like a largely empty 250G virtual drive). Someone told me this was possible, but I can't see how.

Also, can I not simply tar a directory and gzip it? (at the console, when the VM's are powered down, of course) It feels like an incredible waste having to copy hundreds of gigabytes of essentially empty space just because the VM has reserved that space already.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
depping
Leadership
Leadership
Jump to solution

You don't even have to shutdown the VM, just create a script that snapshots the vm first. but before you create some difficult script check out visbu: http://www.xtravirt.com/index.php?option=com_remository&Itemid=75&func=fileinfo&id=7

i think that it does exactly what you are looking for.

Duncan

My virtualisation blog:

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

View solution in original post

0 Kudos
4 Replies
depping
Leadership
Leadership
Jump to solution

If you do a full image backup via VCB it will breakdown the VMDK down, it will not dump empty blocks. But be aware that when you delete a file the block isn't cleaned out, only the pointer to the actual data is removed by the OS. So if you wan't to dump a really lean VMDK do a shrink(vmware tools) or use a tool like SDelete before you dump the VMDK. I wrote a small script a while back which can be scheduled to zero out the empty space and do a defrag. I usually run this before I use VCB to dump a VM.

Duncan

My virtualisation blog:

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

virtualesxer
Contributor
Contributor
Jump to solution

Thanks for answering. I don't have VCB; sorry, should have mentioned that. I tried copying over a VM with the Datastore Browser once, but since that doesn't use compression (like in SecureFX or similar tool), you're basically just doing the most inefficient backup possible. Hence, I was hoping to be able to tar and gzip the lot first, and then copy the compressed .tgz files over. I wrote a similar script like yours, that does a 'zerofill' inside the guest OS, to blank out unused space; so the whole VM folder ought to compress real well. The question just remains, for me, whether a powered-down VM can actually be tarred like that (and untarred in the same location, should the need arise); or whether ESX keeps a lock on these files or some such, or otherwise prevents such regular UNIX operations.

0 Kudos
depping
Leadership
Leadership
Jump to solution

You don't even have to shutdown the VM, just create a script that snapshots the vm first. but before you create some difficult script check out visbu: http://www.xtravirt.com/index.php?option=com_remository&Itemid=75&func=fileinfo&id=7

i think that it does exactly what you are looking for.

Duncan

My virtualisation blog:

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

0 Kudos
virtualesxer
Contributor
Contributor
Jump to solution

Thanks again! Very useful site you have there! Smiley Happy Really, a god-sent for people new to ESX, like yours truly.

0 Kudos