VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts)
5 Replies Last post: Dec 4, 2007 11:47 AM by franl  

vmfs backups posted: Dec 3, 2007 7:12 AM

Click to view tomekz's profile Lurker 1 posts since
Dec 3, 2007
Hello
I'm comletely new in ESX 3.0.2 architecture, so please forgive me maybe stupid question but i bothering about loosing my data. My question is about backups of VMFS content. I 'm currently doing virtual machines backups using vcbMounter command - and this is very good tool for saving particular virtual machine, but what about the rest of vmfs filesystem structures ?. I mean, what about /vmfs/devices content ? If I lost completely whole /vmfs filesystem, information about datastores structures and all those vml.xxxxxx files would be lost too ? How can I backup this files which i suppose represents datastores. Or maybe I'm wrong and there's no need to backup them ?

Regards
Tomek

Re: vmfs backups

1. Dec 3, 2007 7:21 AM in response to: tomekz
Click to view sbeaver's profile Guru 7,719 posts since
Nov 1, 2004
Just really worry about the VM's. If you had to rebuild from scratch you would create another datastore and then restore the VM's register and your set

Steve Beaver
VMTN Forum Moderator

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

Re: vmfs backups

2. Dec 3, 2007 7:23 AM in response to: tomekz
Click to view wila's profile Virtuoso 3,266 posts since
Jun 27, 2006
Hi,

You don't need to back those up, for rebuilding the VMs the only required files are the .vmdk and vmx files. Without the vmx file you'd probably survive as well.
In the case of a host failure, the advice is to rebuilt from scratch. It's not as bad as it sounds, if you have a slightly complicated setup then you are encouraged to look at building a kickstart file for rebuilding your hosts.

Re: vmfs backups

3. Dec 3, 2007 8:20 AM in response to: sbeaver
Click to view franl's profile Novice 9 posts since
Oct 22, 2007
The Virtual Machine Backup Guide for ESX Server 3.0.1 says: "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."

But I could swear that I've read in these forums that one should not use such commands to copy virtual machines from a VMFS volume, because there is a risk of corrupting the virtual disk files.

Which is it: Are these commands safe for backing up virtual machines or not?

Re: vmfs backups

4. Dec 4, 2007 12:10 AM in response to: franl
Click to view wila's profile Virtuoso 3,266 posts since
Jun 27, 2006
You can use the cp command to get your data out of the VMFS and it will work - as you say - provided that the destination filesystem is capable of storing these large files.
For best compatibility however, it is recommended to use the vmkfstools command to export your disks to a "thin" format of your disks so that they never cross the 2Gb boundary.

Then for importing the disks back into your vmfs storage, you can again use cp, however this has downsides as:
  • there will be a larger number of SCSI locks which can cause problems with your other VMs
  • the destination VM disk can be fragmented as cp doesn't allocate the complete file before starting the copy

So in conclusion, the standard unix copy commands work with the VMFS filesystem, but they are not the optimal way of using your resources. In that case use the vmkfstools command.
Here's a simple example:

backup:
vmkfstools -i /vmfs/volumes/storage1/test/test.vmdk -d 2gbsparse /home/wila/backup/test.vmdk

restore:
vmkfstools -i /home/wila/backup/test.vmdk /vmfs/volumes/storage1/test/test.vmdk

Message was edited by: wila
Added example

Re: vmfs backups

5. Dec 4, 2007 11:48 AM in response to: wila
Click to view franl's profile Novice 9 posts since
Oct 22, 2007
Thanks, wila. But in thread http://communities.vmware.com/message/810769 troberts (a VMware TSE) wrote:
Just using cp to copy an vmdk file to a non-VMFS filesystem will corrupt the vmdk because the blosk sizes are different.
(Emphasis mine.) This seems to contradict what you wrote above.

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