Enthusiast
Enthusiast

Restoring a VM backed up by vcb to another ESX server

Jump to solution

Hi,

every night we do a file-level backup of our virtual machines. Additional we use VCB to backup the whole virtual machine for disaster recovery.

We have 4 ESX servers in a HA/DRS cluster at the moment and I wrote a script that runs on each ESX server so all virtual machines residing on each ESX server are backed up. We don't want to use a VCB proxy...

Now I have a big problem. I tried to restore a virtual machine on another ESX server for testing purposes. It didn't work.

I used the following command on another ESX-Server:

"vcbRestore -s <<path-to-vcbbackup-of-vm>> -b overwrite -L 6"

I got some errors like these ones:

\[2007-02-28 12:27:17.759 'vcbRestore' 3076460672 error] Error: ResourcePool "/ha-folder-root/ha-datacenter/host/<<ESX-SERVER1>>/Resources" for VM not found.

\[2007-02-28 12:27:17.799 'App' 3076460672 verbose] Got vmdb error -14 (Pipe connection has been broken) when invoking \[logout] on \[vim.SessionManager:ha-sessionmgr]

I have tried to edit the "catalog" file without any success. I changed the following lines:

host= <<ESX-SERVER1>>

resourcepool= "/ha-folder-root/ha-datacenter/host/<<ESX-SERVER1>>/Resources"

to

host= <<ESX-SERVER2>>

resourcepool= "/ha-folder-root/ha-datacenter/host/<<ESX-SERVER2>>/Resources"

The same error appeared.

If I try to restore the virtual machine on the same ESX server where the virtual machine resided during backup it works great!!!

That's a big problem for us. What if one ESX server crashes? - We cannot restore any of our virtual machines using "vcbRestore".

Is there anything else I have to change? Any idea? Thanks!

0 Kudos
1 Solution

Accepted Solutions
Immortal
Immortal

I've found vcbMounter/vcbRestore to be quite frustrating to use all round, do you run your vcMounter backups from the service console? If so, consider using a snapshot and vmkfstools to export the disks instead, then you can re-import them anywhere you like without needing to make any changes. You can script it pretty easily, I've written one you can use if you like (posted on here).

As for your existing backups - I think you can manually import the VMDKs with vmkfstools, vcbMounter just renames them scsi-0-0-vmname.vmdk

View solution in original post

0 Kudos
5 Replies
Immortal
Immortal

I've found vcbMounter/vcbRestore to be quite frustrating to use all round, do you run your vcMounter backups from the service console? If so, consider using a snapshot and vmkfstools to export the disks instead, then you can re-import them anywhere you like without needing to make any changes. You can script it pretty easily, I've written one you can use if you like (posted on here).

As for your existing backups - I think you can manually import the VMDKs with vmkfstools, vcbMounter just renames them scsi-0-0-vmname.vmdk

View solution in original post

0 Kudos
Enthusiast
Enthusiast

Yes, I run "vcbSnapAll" from the service console on each ESX server. So there is no way to restore a virtual machine on another ESX server? If there is one, please tell me.

The next thing I'll try is your way: creating snapshots and then exporting the disks. But I need a workaround for our "old" backups. Even If I would never restore them that way.

0 Kudos
Enthusiast
Enthusiast

Thanks! I didn't realize that you've edited your message. Smiley Happy

0 Kudos
Immortal
Immortal

I've written a script that does a snap/vmkfstools export, also sends email reports, creates a .restore script to automate restores/renames. Save you the effort of writing one yourself.

http://www.vmware.com/community/thread.jspa?threadID=70253

0 Kudos
Enthusiast
Enthusiast

Hi Mittel!

I'm not familiar with perl, so I decided to improve my own bash script.

I have one question about the behaviour of DRS while your script is running:

When I start my script on an ESX server it might be that a virtual machine is beeing vmotioned to another ESX server in a cluster and the backup does not work for this virtual machine. I think the problem is that if I run a script like this one the command "vmware-cmd -l" is only executed once.:

for VirtualMachines in `vmware-cmd -l`

do

...

done

If a virtual machine is beeing vmotioned to another ESX server while this script is running the script would not realize that the virtual machine isn't running on the current ESX server anymore.

So how to solve this problem? Is it a good idea to "block" all virtual machines by creating snapshots for all virtual machines like this one?:

VMs=vmware-cmd -l

for VirtualMachine in $VMs

do

vmware-cmd $VirtualMachine createsnapshot

done

for VirtualMachine in $VMs

do

###Commands to export a VMDK-file

done

I think I have to use the variable $VMs so that the content does not change.

At first I create snapshots for all virtual machines. Now they are blocked for VMotion, aren't they? Right after that I run the script as usual and after that I would remove all snapshots.

What do you think? Smiley Happy

0 Kudos