VMware Communities
jmz2
Contributor
Contributor

Backup full vmware folder

Hello,

I have been looking into the community for this but I haven't found anything.

I am looking for a way to backup the vmware folder where the machines files are stored BUT I need something that work while the vmachines are running. I mean, I don't want to stop the machines in order to have the backup done.

Is this posible? Could you please point me in the right direction?

Many thanks

0 Kudos
6 Replies
Peter_vm
Immortal
Immortal

This is best done by backup agent istalled inside of guest OS.

Many posibilities.

Many difficulties also, if you run specific applications (databases are good example) and don't shut application down or use agent that doesn't support particular, live database.

0 Kudos
louyo
Virtuoso
Virtuoso

What OS? If you are running W2003/W2008 server or Vista you can use anything that uses Volume Shadow Copy Services to copy any files, open or otherwise. From Windows Servers you can just use vssadmin to create a shapshot of the volume and then copy it. Best to use a backup program that uses VSSC. I have used NovaBack but usually just use NTBackup or directly copy the snapshot with my own program.

Linux makes things a little easier.

Lou

0 Kudos
jmz2
Contributor
Contributor

To clarify: I use Windows 2003 as the virtual machine and Debian as the host OS.

Thanks

0 Kudos
louyo
Virtuoso
Virtuoso

>>Debian as the host OS.

Ah, the choices are almost boundless ("Linux is about choice") Smiley Happy Tar is probably as good a way as any. I do this with a (36.5GB)Vista VM running on openSUSE:

simple tar:

Command prompt from the directory where my VM is located:

tar -cjvf /data250/testvs2008 .

(uses normal compression, probably gzip would be faster)

That creates a tarball (named testvs2008) of everything in the current directory, and puts it in the directoy /data250

It gave me several "status" messages such as:

tar: ./Windows Vista VS2008-2-s005.vmdk: file changed as we read it

tar: ./Windows Vista VS2008-1-s004.vmdk: file changed as we read it

tar: ./Windows Vista VS2008-1-s002.vmdk: file changed as we read it

Linux uses the honor system (and permissions) to protect open files....

It takes over an hour, I think, but it creates a 14.5GB tarball, out of a 36.5GB directory, full of my Vista machine (with VS2008) files. Eliminating compression would speed things up. If you don't need to do a chron job with it, you could just use konqueror or some such to copy the files. I like to compress to copy to my laptop or USB drive.

I then, do a:

tar -xjvf /data250/testvs2008

from the directory where I wanted to create the copy of the VM.

It uncompresses all 36.5 GB and I can start the VM (after deleting all the .lck files/directories). It asks me if I moved or copied and I always tell it moved so as not to aggravate Vista by changing the MAC. When I booted Vista in the VM, it acted as if it had had an abnormal shutdown, probably because it thought I had kicked its feet out from under it. Whether this would disturb a server VM, I can't answer, haven't tried it but I would think not. What I would probably do if this was a production VM is use the ntbackup or some other backup program in the VM to save the systemstate which should also backup the PDC, you are probably doing this anyway along with any DB program (they usually can recover from the journal). I have never had it lose anything but it is a "point in time" backup anyway. We backup our systemstate at least once a week. If our domain was more critical or large, I would do it daily.

rsync is another good backup program, that is what I use on our file server (also openSUSE), it allows an update mode, only copying newer files and can sync by deleting anything on the target that is not on the source. If you want to make an image, you can use dd or ddrescue (handles bad sectors) but I try to keep things simple. I think it was Alfred Einstein who said something like: You should keep things simple, but no simpler than necessary.

Lou

"In the beginning there was nothing, and God said: 'Let there be light'. And there was still nothing .. but now you could see it."

0 Kudos
Peter_vm
Immortal
Immortal

That's right. Copying virtual machine directory, when it is running, equals to yanking power off from running machine.

Plus, some sectors corresponding to virtual hard drive sectors are not copied at the same time, so snapshot might also loose virtual disk (filesystem) integrity.

Depending on what your guest does, you may suffer or get away with it.

0 Kudos
WoodyZ
Immortal
Immortal

It gave me several "status" messages such as:

tar: ./Windows Vista VS2008-2-s005.vmdk: file changed as we read it

tar: ./Windows Vista VS2008-1-s004.vmdk: file changed as we read it

tar: ./Windows Vista VS2008-1-s002.vmdk: file changed as we read it

Linux uses the honor system (and permissions) to protect open files....

>

... and I can start the VM (after deleting all the .lck files/directories). It asks me if I moved or copied and I always tell it moved so as not to aggravate Vista by changing the MAC. When I booted Vista in the VM, it acted as if it had had an abnormal shutdown, probably because it thought I had kicked its feet out from under it.

It's obvious from what you've said that you're tar-balling the Virtual Machine while it's running and that's not a good practice! Also if applicable one should consider using VMware Tools to first Shrink the Virtual Hard Disk(s) before archiving.

0 Kudos