VMware Cloud Community
drheim
Enthusiast
Enthusiast

Problem with visbu restoring to alternate storage location

When visbu restores a VM to an alternate location it does leave the vmx file unchanged, but it also moves the vmdk disk files into another subdirectory and it does not add the machine back to the VC server even if you backed it up through the Victual Center server. When you go to browse the datastore and right-click on the vmx file and tell it to add to datastore it fails with the error. "a specified parameter was not correct" I have tried putting the vmdk files back into the same directory as the vmx file and I updated everything in the vmx to match the the path but still having trouble. I noticed that the vswp file was still pointing to the old location and I tried correting it and creating a blank vswp file, but it still fails. If anyone has used visbu to restore to an alternate location please let me know.

Dan

0 Kudos
2 Replies
cas5213
Contributor
Contributor

The problem is that the Visbu script hardcodes the location of your vmdk files in relatino to the path of the server where the backup was created. if you manually edit the problem line in your VMNAME.restore file, the script will work.

For example:

The problem is the line: $vminfo('backup_location') = "/path/to/files/.../.../VMNAME"

By changing the filepath from your old server file path to the relative location on your "new" server, the restore script will work. I wrote a bash script that automates the process. Place this in the same directory as your .restore file and run it. It should fix the problem and let you run a restore using the newly generated script. So far I've had 100% success on 2 attempts using the script, and 4 attempts manually editing the filepath. However, please keep in mind your mileage may very and no guarantees included :smileygrin:

Hopefully this is still of some help for you!

Place this in the same directory as your old .restore file and run it. You may have to chmod or chown the file to run it. Good luck!

EDIT: attached script instead, it got messed up posted directly in here. Sorry!

Message was edited by: cas5213

EDIT: newer version available below!

0 Kudos
cas5213
Contributor
Contributor

Encountered a problem using this script...

Currently working on a solution...

EDIT: newest version available attached here. Plese reply if any users encounter failure to work or any bugs - I would like to continue maitenance and correction for any errors.

Still carrying 100% success when changing the file manually and restoring to different servers. One small bump in the road with the script version which is now fixed.

Thank you!

0 Kudos