Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Wednesday, March 10, 2010

How to backup VMWare Virtual Machines?


As you may already know - backing up virtual machines isn't a walk in the park. Actually, it is very much similar to usual backup process of any physical machine. However, VMWare has a nice tool called "VMware Consolidated Backup" which can do even online backups of virtual machines, without disrupting users and applications. Of course this tool isn't free. So, we are back at the begining of this story - how to backup virtual machines.

There are few ways to do manual backup of virtual machines which can then bi scripted into a semi-automatic backup or automatic backup if you whish. The down side of this approach is that you have downtime of virtual machine when doing backup, but in most cases I find this acceptable.

We are using VMWare server 2.0 platform for our virtual machines. There are few requirements in order to do this. First, you need to familiarize yourself with vmrun command line tool. Vmrun is used for managing virtual machines from command line. This and other Vmware tools are by default located in c:\Program Files\VMWare\VMware Server\.

This is what I use for "soft" stopping virtual machine SPWFE1.domain.local located at E_DRIVE datastore of VMWare Server named VM.domain.local. I am using local administrator user context for running this command i.e. user:admin with password:wordxxxx

From command prompt run: "vmrun -T server -h https://vm.domain.local:8333/sdk -u admin -p wordxxxx stop "[E_DRIVE] spwfe1\spwfe1.domain.local.vmx" soft"

This command, shutsdown virtual machine spwfe1.domain.local after ending all processes.

Now, we need to go to next step, which is copying the virtual machine to another location i.e. making backup of the virtual machine. In order to do that - I use xcopy command to copy folder content to another location.

After copying is done, we can start the virtual machine by running command "vmrun -T server -h https://vm.domain.local:8333/sdk -u admin -p wordxxxx start "[E_DRIVE] spwfe1\spwfe1.domain.local.vmx"

The final thing, in order to automate this, you should organize stop, copy and startup scripts into different scripts and use either windows AT command or Scheduled Tasks to schedule starting of these scripts.

Sharepoint backup error: Object xyz_DB failed in event OnBackup

I started having problems with Sharepoint backup some time ago. The problems were that I would get an error message "Object SharedServices1_Search_DB failed in event OnBackup" and similar started showing in Central Administration backup when I moved my backup location from Sharepoint server to UNC network location. I tried many things but - I even tried to login with Sharepoint service account and do the backup but it didn't work - even though this same account "spservice" had "Full control" on this network share folder. So, what eventually did help me was to (for testing purposes only) change NTFS permissions on network share where my backup was done. I gave Everyone and Anonymous group "Full control" permissions on my \\fileserver\StsadmBackup folder. After I did that - backup was done succesfully! :)

Anyway, at least now I know that everything is OK with my Sharepoint frontend and DB servers. It was permissions that were the issue. I will probably move backup folder back to frontend machine or I will leave UNC path on network share but really need to get rid of anonymous and everyone groups.

Regards,
Damir.