VMware
1 2 3 Previous Next 42 Replies Last post: May 20, 2009 12:59 PM by PCS_Dan  

VISBU - Free easy-to-use VI3 backup utility posted: Mar 6, 2007 9:53 AM

Click to view mittell's profile Champion 3,096 posts since
Apr 25, 2006
I've written a backup utility, it's currently still in 'beta' but I think I've worked out most of the bugs and it's been working very well for me, so I thought I'd share my work with the community.

I'll be trying to update it fairly regularly as and when I have time, hot-clone of a VM or specific VMDK attached to a VM planned for next version.

Please see the readme file here for some initial instructions: http://users.ox.ac.uk/~alexm/README

You can download the utility here: http://users.ox.ac.uk/~alexm/visbu-0.8.4.tar.gz

Once you've extracted the archive, please read the README file in the directory created for instructions on using the utility.

Alex

Re: VISBU - Free easy-to-use VI3 backup utility

1. Apr 27, 2007 6:22 AM in response to: mittell
Click to view paulkbeyer's profile Enthusiast 44 posts since
Sep 27, 2006
Hey Alex,

Cracking Script mate, though I haven't DOH'd through the config file yet .. I'm just having a real hard time getting the export path right. My error output is :-

[root@esxhost vi-backup]# vi-backup.pl -c /usr/local/vi-backup.cfg
readline() on closed filehandle CONFIG at /usr/local/sbin/vi-backup.pl line 1162.
Use of uninitialized value in concatenation (.) or string at /usr/local/sbin/vi-backup.pl line 1081.
Use of uninitialized value in substitution (s///) at /usr/local/sbin/vi-backup.pl line 1082.
Use of uninitialized value in substitution (s///) at /usr/local/sbin/vi-backup.pl line 1082.
Use of uninitialized value in pattern match (m//) at /usr/local/sbin/vi-backup.pl line 1083.
FATAL ERROR: You cannot use / as a destination for backups! Exiting script.

The .cfg file looks like this :-

hostname=esxhost.domain.com
username=root
password=password
searchspec=name:VMGuest
exportpath=/vmfs/volumes/virtual_machines_backup/
safemode=0
mailreport=1
mailserver=192.168.0.1
mailfrom=esxhostbackup@domain.com
mailto=esxalerts@domain.com
smb=0

Can anyone see where I've been slightly dim?

Again, it's a cracking script Alex and it makes me want to learn Perl so I feel I could contribute! Any references to starting scripting in Perl appreciated! Really cool stuff.

Paul.

Re: VISBU - Free easy-to-use VI3 backup utility

2. May 13, 2007 2:51 PM in response to: mittell
Click to view Intelligen's profile Novice 12 posts since
Mar 16, 2006
Can you give some more details information on the settings when setting up a configuration file?

Like what is SafeMode? Where are these Search Param?

Re: VISBU - Free easy-to-use VI3 backup utility

5. Jun 3, 2007 1:55 PM in response to: mittell
Click to view mcretan's profile Lurker 5 posts since
Aug 15, 2006
Great Script thanks Alex - works like a charm!

Any idea when you might implement the zip backup file option? (hint hint ;)

We're using your script to create VM backups, which we want to then zip up and arhive off to tape with our backup exec server via RALUS on the esx box. We could do the zipping outside your script, but it'd be much neater if it was included as part of the backup process.

Also, another idea for you - any chance of allowing a separate email reporting address to be used if errors are encountered during backups? It'd really help to put backup errors in the face of people that need to know about them without them having to manually scour plain old log messages.

Keep up the great work.

Cheers,

Mike Cretan

Re: VISBU - Free easy-to-use VI3 backup utility

7. Jun 6, 2007 11:25 PM in response to: mittell
Click to view violet68's profile Enthusiast 84 posts since
Dec 1, 2006
Hi all,

if i want to backup VM1 nothing else,

what is the command to run ?

and should i change the config file like this :
## Config file created by vi-backup.pl 0.9 ##
hostname=ESX3-01.XXX.COM
username=root
password=password
searchspec=name:VM1
exportpath=/mnt/backup/
2gbsparse=1
safemode=1
mailreport=1
mailserver=192.168.X.X
mailfrom=XXX@XXX.COM
mailto=XXX@XXX.COM
smb=0

Re: VISBU - Free easy-to-use VI3 backup utility

8. Jun 7, 2007 7:42 PM in response to: violet68
Click to view violet68's profile Enthusiast 84 posts since
Dec 1, 2006
i found the answer

use this : searchspec=name:VM1

Re: VISBU - Free easy-to-use VI3 backup utility

9. Jun 12, 2007 2:04 PM in response to: mittell
Click to view dwightmccann's profile Novice 14 posts since
Apr 5, 2005
I am running on an ESX 3.0.0 system with two virtual machines provided to me to test your script (for which I thank you profusely.) I have a couple of issues that are eluding me.

The VMs:
[root@blade20 volumes]# vmware-cmd -l
/vmfs/volumes/455dbba7-fdf002e9-db01-0011254a3fe4/2k3test2/2k3test2.vmx
/vmfs/volumes/455dbba7-fdf002e9-db01-0011254a3fe4/esx3/esx3.vmx

The .cfg file:
[root@blade20 volumes]# cat /usr/local/vi-backup/vi-backup.cfg
## Config file created by vi-backup.pl 0.9 ##
hostname=blade20.xxx.xxx.xxx
username=root
password=xxx
searchspec=powerstate:on
exportpath=/vmfs/volumes/44f70cf4-1cf7a617-71dc-0011254a3fe4/visbutest
2gbsparse=0
safemode=1
mailreport=1
mailserver=xxx.xxx.xxx
mailfrom=dwight.mccann@isc.ucsb.edu
mailto=xxx.xxx.xxx
smb=0

The .vmx for the machine with the issue:
#!/usr/bin/vmware
config.version = "6"
virtualHW.version = "3"
floppy0.present = "true"
powerType.powerOff = "default"
powerType.powerOn = "default"
powerType.suspend = "default"
powerType.reset = "default"

displayName = "2k3test2"
extendedConfigFile = "2k3test2.vmxf"

scsi0.present = "true"
scsi0.sharedBus = "none"
scsi0.virtualDev = "vmxlsilogic"
memsize = "1024"
scsi0:0.present = "true"
scsi0:0.name = "2k3test2.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
ide0:0.present = "true"
ide0:0.fileName = "/dev/cdrom"
ide0:0.deviceType = "atapi-cdrom"
floppy0.startConnected = "false"
floppy0.fileName = "/dev/fd0"
ethernet0.present = "true"
ethernet0.startConnected = "TRUE"
ethernet0.allowGuestConnectionControl = "false"
ethernet0.networkName = "123SubNet"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:b7:3d:bd"
guestOS = "winnetstandard"
uuid.bios = "50 37 02 81 d9 92 8b d8-87 e6 c9 7b 4c b4 46 5e"
log.fileName = "vmware.log"
sched.cpu.min = "0"
sched.cpu.units = "mhz"
sched.cpu.shares = "normal"
sched.mem.minsize = "512"
sched.mem.max = "1024"
sched.mem.shares = "normal"
cpuid.1.eax = "----xxxxxxxx--------xxxx--------"
cpuid.1.ecx = "----------------R-0------R------"
cpuid.1.ecx.amd = "--------------------------------"
cpuid.80000001.ecx = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0"
cpuid.80000001.edx = "xx0xxxxxxxx0xxxxxxxxxxxxxxxxxxxx"

checkpoint.cptConfigName = "2k3test2"
priority.grabbed = "normal"
priority.ungrabbed = "normal"
scsi0:0.redo = "/vmfs/volumes/455dbba7-fdf002e9-db01-0011254a3fe4/2k3test2/2k3test2.vmdk.REDO"
tools.syncTime = "FALSE"

uuid.location = "56 4d d6 54 91 4b a0 d5-a0 b7 b8 58 c5 bc d2 26"
sched.swap.derivedName = "/vmfs/volumes/455dbba7-fdf002e9-db01-0011254a3fe4/2k3test2/2k3test2.vswp"

The issue is that VISBU says there are no disks to export for the 2k3test2 VM:
11/06/2007 23:55:06: [esx3] Backup completed without errors.

11/06/2007 23:59:57: [2k3test2] No disks to export!
Backup completed without errors.

*** Script completed successfully. ***

The log file:
12/06/2007 04:07:23: Log file opened.
12/06/2007 04:07:24: [2007-06-12 04:07:24.150 'App' 3076448384 info] Current working directory: /
[2007-06-12 04:07:24.182 'BaseLibs' 13863856 warning] [Vmdb_Unset] Unsetting unknown path: /vmomi/

[2007-06-12 04:07:24.316 'CreateSnapshot' 3076448384 info] Creating snapshot
[2007-06-12 04:07:24.377 'vcbSnapshot' 3076448384 error] Error: This operation is not supported.
12/06/2007 04:07:24: [2007-06-12 04:07:24.703 'App' 3076452480 info] Current working directory: /
[2007-06-12 04:07:24.735 'BaseLibs' 7977904 warning] [Vmdb_Unset] Unsetting unknown path: /vmomi/

[2007-06-12 04:07:24.866 'App' 3076452480 error]

Exception: Assert failed!
[2007-06-12 04:07:24.867 'App' 3076452480 error] Backtrace:
[00] eip 0xa06d1e
[01] eip 0x95dd29
[02] eip 0x918295
[03] eip 0x91893e
[04] eip 0x9189f9
[05] eip 0x918ac5
[06] eip 0x8062bed
[07] eip 0x806067f
[08] eip 0x805e650
[09] eip 0x8072e95
[10] eip 0x805e82e
[11] eip 0x39279a
[12] eip 0x805dbc1

[2007-06-12 04:07:24.870 'App' 3076452480 error] Backtrace:
[00] eip 0xa06d1e
[01] eip 0x95dd29
[02] eip 0xa06965
[03] eip 0x91894b
[04] eip 0x9189f9
[05] eip 0x918ac5
[06] eip 0x8062bed
[07] eip 0x806067f
[08] eip 0x805e650
[09] eip 0x8072e95
[10] eip 0x805e82e
[11] eip 0x39279a
[12] eip 0x805dbc1

Any clues as to what is going wrong? Unfortunately I am not the VMware person but the Backup person and I didn't create the server or the VMs.

Dwight

Re: VISBU - Free easy-to-use VI3 backup utility

11. Jun 13, 2007 9:19 AM in response to: mittell
Click to view dwightmccann's profile Novice 14 posts since
Apr 5, 2005
Yes, it was imported from ESX 2 as it turns out ... your response looks very helpful for resolving some other issues for us. Thanks. I'll try to get back here with an update.

Re: VISBU - Free easy-to-use VI3 backup utility

13. Aug 30, 2007 1:23 PM in response to: mittell
Click to view Wingen's profile Lurker 1 posts since
Aug 30, 2007
I had an issue with a corrupt esx.conf file presumably from running out of disk space during a backup.

Re: VISBU - Free easy-to-use VI3 backup utility

14. Oct 5, 2007 7:02 AM in response to: Wingen
Click to view Ramdez's profile Lurker 3 posts since
Oct 4, 2007

same exact thing happened to us. corrupted both of our host config files and we're reinstalling tonight. do you think in the next release it would be beneficial to include the esx.conf file in the backup process?

The issue reared it's ugly head by a vm saying after a reboot 'cable disconnected' because our vswitch was no longer active. Then editing a vswitch we saw the error

Error during configuration of the host: no child key with name:vswitch1 at parent net /net/vswitch

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