I just put up an experimental release of VMBackup (2.94). This version hopefully fixes the new 2.0 support code to perform backups properly.

The new version is available on the download page

Documentation can be found on the documentation page

The changes in this version are:

  1. Added additional checks to several of the VM functions to pass the VM to the vmrun command with the [datastore] vmx format instead of a normal Unix path (The server 2.0 vmrun command was frequently unable to figure out the correct VM the command was reffering to when the Unix path was passed).

6 Responses to “New Experiemental VMbackup 2.94 version hopefully fixes issues with VMware Server 2.0 backups”

  1. mike says:

    Hi Dwight,

    Thanks for the wonderful script for making life easier.
    I installed vmbackup_2.94_all.deb on ubuntu server Linux 2.6.27-9-server #1 SMP Thu Nov 20 22:53:41 UTC 2008 i686 GNU/Linux. I’m using the curent release of vmware server (VMware-server-2.0.0-122956.i386.tar.gz)

    I’ve tried some combinations, but can’t succeed in starting a backup. Is there a way I can troubleshoot this?

    thanks!
    Mike

    logs –
    root@psa9997f:~# vmbackup –all –lvm –format tgz –dest .
    Error: No VMs specified for backup

    vmbackup –user userid –password password [--all|--excludevm vm|--includevm vm] [ --lvm | --lvmsuspend | --cold ] [--format tgz | tbz2 | zip | iso | dir] [--logsyslog] [--dest directory|user@hostname:directory] [--help]
    –user The vmware userid, this parameter is required
    –password The vmware password, this parameter is required
    -a, –all Backup all registered VMs, except VMs that have been excluded
    -e, –excludevm Exclude a VM from backup
    -i, –includevm Add a VM to the list of VMs to back up
    -l, –lvm Perform a backup using an LVM snapshot, the VM files must be stored on an LVM
    volume. This is a hot backup however it does not store cpu/memory state so
    The VM will start from a powered off state when restored.
    -L, –lvmsuspend Perform a backup using LVM snapshot and suspend
    The VM will be pause while the LVM snapshot is created. Total downtime is
    normally less than a minute (similar to a hot backup).
    This is like a backup with the –lvm option but the restored VM will be able
    to resume to the running state when restored to a compatible CPU.
    -c, –cold Perform a cold backup (Backup using suspend)
    The VM will be unavailable during the backup when this archiveformat is used.
    -f, –format Choose the output archive format, available formats are:
    tar – Create an uncompress tar archive of the VM
    tgz – Create a gziped archive of the VM
    tbz2 – Create a bzip2 archive of the VM, this option is much slower and uses
    more CPU than the tgz option
    dir – Create a copy of the VM in a new directory. This will overwrite the
    contents of the destination directory, use with caution.
    -d, –dest Specify the destination to write the backup file to, the current directory is
    used if this option is not provided
    Can also be a remote host Unix/Linux host via ssh the format is
    user@hostname:destdir
    –logsyslog Log output to syslog instead of the console

    Examples:
    Create a lvm backup of all registered VMs and store them in directory /backups on a remote
    host named filehost
    vmbackup –lvm –dest filehost:/backups

    Create a cold backup of a VM named foobar.com with the maximum compression
    vmbackup –includevm foobar.com –cold –format tbz2
    root@psa9997f:~#

    root@psa9997f:/var/lib/vmware/Virtual Machines# ls TestXP/*.vmx
    TestXP/TestXP.vmx
    root@psa9997f:/var/lib/vmware/Virtual Machines# vmbackup –includevm TestXP –lvm –format tgz
    Error: No VMs specified for backup

    vmbackup –user userid –password password [--all|--excludevm vm|--includevm vm] [ --lvm | --lvmsuspend | --cold ] [--format tgz | tbz2 | zip | iso | dir] [--logsyslog] [--dest directory|user@hostname:directory] [--help]
    –user The vmware userid, this parameter is required
    –password The vmware password, this parameter is required
    -a, –all Backup all registered VMs, except VMs that have been excluded
    -e, –excludevm Exclude a VM from backup
    -i, –includevm Add a VM to the list of VMs to back up
    -l, –lvm Perform a backup using an LVM snapshot, the VM files must be stored on an LVM
    volume. This is a hot backup however it does not store cpu/memory state so
    The VM will start from a powered off state when restored.
    -L, –lvmsuspend Perform a backup using LVM snapshot and suspend
    The VM will be pause while the LVM snapshot is created. Total downtime is
    normally less than a minute (similar to a hot backup).
    This is like a backup with the –lvm option but the restored VM will be able
    to resume to the running state when restored to a compatible CPU.
    -c, –cold Perform a cold backup (Backup using suspend)
    The VM will be unavailable during the backup when this archiveformat is used.
    -f, –format Choose the output archive format, available formats are:
    tar – Create an uncompress tar archive of the VM
    tgz – Create a gziped archive of the VM
    tbz2 – Create a bzip2 archive of the VM, this option is much slower and uses
    more CPU than the tgz option
    dir – Create a copy of the VM in a new directory. This will overwrite the
    contents of the destination directory, use with caution.
    -d, –dest Specify the destination to write the backup file to, the current directory is
    used if this option is not provided
    Can also be a remote host Unix/Linux host via ssh the format is
    user@hostname:destdir
    –logsyslog Log output to syslog instead of the console

    Examples:
    Create a lvm backup of all registered VMs and store them in directory /backups on a remote
    host named filehost
    vmbackup –lvm –dest filehost:/backups

    Create a cold backup of a VM named foobar.com with the maximum compression
    vmbackup –includevm foobar.com –cold –format tbz2
    root@psa9997f:/var/lib/vmware/Virtual Machines# vmbackup –includevm ./TestXP/TestXP.vmx –lvm –format tgz
    Traceback (most recent call last):
    File “/usr/bin/vmbackup”, line 250, in
    vmitems.append(vm(configfile=vmi,destdir=DESTDIR,user=USERID,password=PASSWORD))
    File “/usr/lib/vmbackup/vmbackup_common.py”, line 270, in __init__
    shortconfig=temp1[1].strip()
    IndexError: list index out of range
    root@psa9997f:/var/lib/vmware/Virtual Machines#

  2. k.beeby@albion.co.uk says:

    Hi

    Trying to use the script with vmware server v2.0x but every time I try and run the command (even with –all ) it always errors “No VMs specified for backup”

    Any idea how I resolve this

    Keith

  3. TheBlob says:

    Hello all, I’ve just registered to this blog, however I too am developing a script to backup vmware (server only).
    I was reading the last two posts, but it seems everyone is using the only one dash before the “all” parameter ( -all) , and instead in the help it specifies two dashes (–all).
    Could it be the problem?

    Anyway, I also have a question of my own.
    I’ve installed the 2.94 version (rpm package on a CentOS 5.2 64bit with VmWare Server 2.0) and tested it on a single vm (an xppro “test subject”).
    I see it works fine, however I’ve also noticed that the “hot” backup mode is somehow hidden.
    I mean, in the help it’s not mentioned anymore, but it indeed works fine.
    Is this a mistake or an anticipation of future removal of hot backups (the ones without LVM)?

    Thank you for the script anyway :-)

    TheBlob

  4. drenton says:

    Hello, try using with the –user –password options as well.

  5. drenton says:

    We are running VMWare Server 2.0.0 Build 116503 on CentOS 5.2 64bit with multiple datastores.

    Our /etc/vmware/hostd/NEW_datastores.xml file only contained an entry for the first datastore. The datastores.xml file contained all the datastores. I had to change line 123 in vmbackup_common.py from

    file=open(’/etc/vmware/hostd/NEW_datastores.xml’)

    to

    file=open(’/etc/vmware/hostd/datastores.xml’)

  6. dhubbard says:

    Hot backup doesn’t work properly with all versions of VMware Server.

    In some cases hot backups can create a situation where the virtual machine is running from a snapshot that cannot be deleted, ever. It should work with VMware Server 2.0 but it hasn’t been tested that much either.

Leave a Reply

You must be logged in to post a comment. Login »