Coder Social home page Coder Social logo

ghettovcb's Introduction

ghettoVCB

Table of Contents

Description

The ghettoVCB script performs backups of virtual machines residing on ESX(i) 3.x, 4.x, 5.x, 6.x, 7.x & 8.x servers using methodology similar to VMware's VCB tool. The script takes snapshots of live running virtual machines, backs up the master VMDK(s) and then upon completion, deletes the snapshot until the next backup. The only caveat is that it utilizes resources available to the ESXi Shell running the backups as opposed to following the traditional method of offloading virtual machine backups through a VCB proxy.

This script has been tested on ESX 3.5/4.x/5.x and ESXi 3.5/4.x/5.x/6.x/7.x/8.x and supports the following backup mediums: LOCAL STORAGE, SAN and NFS. The script is non-interactive and can be setup to run via cron. Currently, this script accepts a text file that lists the display names of virtual machine(s) that are to be backed up. Additionally, one can specify a folder containing configuration files on a per VM basis for granular control over backup policies.

Additionally, for ESX(i) environments that don't have persistent NFS datastores designated for backups, the script offers the ability to automatically connect the ESX(i) server to a NFS exported folder and then upon backup completion, disconnect it from the ESX(i) server. The connection is established by creating an NFS datastore link which enables monolithic (or thick) VMDK backups as opposed to using the usual *nix mount command which necessitates breaking VMDK files into the 2gbsparse format for backup. Enabling this mode is self-explanatory and will evidently be so when editing the script (Note: VM_BACKUP_VOLUME variable is ignored if ENABLE_NON_PERSISTENT_NFS=1).

In its current configuration, the script will allow up to 3 unique backups of the Virtual Machine before it will overwrite the previous backups; this however, can be modified to fit procedures if need be. Please be diligent in running the script in a test or staging environment before using it on production live Virtual Machines; this script functions well within our environment but there is a chance that it may not fit well into other environments.

Note: If you have found this script to be useful and would like to contribute back, feel free to donate a cup of coffee โ˜•๐Ÿ˜

Features

  • Online back up of VM(s)
  • Support for multiple VMDK disk(s) backup per VM
    • Only valid VMDK(s) presented to the VM will be backed up
  • Ability to shutdown guestOS and initiate backup process and power on VM afterwards with the option of hard power timeout
  • Allow spaces in VM(s) backup list (not recommended and not a best practice)
  • Ensure that snapshot removal process completes prior to to continuing onto the next VM backup
    • VM(s) that intially contain snapshots will not be backed up and will be ignored
  • Ability to specify the number of backup rotations for VM
  • Output back up VMDK(s) in either ZEROEDTHICK (default behavior) or 2GB SPARSE or THIN or EAGERZEROEDTHICK format
  • Support for both SCSI and IDE disks
  • Non-persistent NFS backup
  • Fully support VMDK(s) stored across multiple datastores
  • Ability to compress backups
  • Ability to configure individual VM backup policies
  • Ability to include/exclude specific VMDK(s) per VM (requires individual VM backup policy setup)
  • Ability to configure logging output to file
  • Independent disk awareness (will ignore VMDK)
  • New timeout variables for shutdown and snapshot creations
  • Ability to configure snapshots with both memory and/or quiesce options
  • Ability to configure disk adapter format
  • Additional debugging information including dry run execution
  • Support for VMs with both virtual/physical RDM (pRDM will be ignored and not backed up)
  • Support for global ghettoVCB configuration file
  • Support for VM exclusion list
  • Ability to backup all VMs residing on a specific host w/o specifying VM list
  • Implemented simple locking mechenism to ensure only 1 instance of ghettoVCB is running per host
  • Updated backup directory structure - rsync friendly
  • Additional logging and final status output
  • Logging of ghettoVCB PID (proces id)
  • Email backup logs
  • Rsync "Link" Support (Experimental Suppport)
  • Enhanced "dryrun" details including configuration and/or VMDK(s) issues
  • New storage debugging details pre/post backup
  • Quick email status summary
  • Support for individual VM backup via command-line
  • Support VM(s) with existing snapshots
  • Support mulitple running instances of ghettoVCB
  • Configure VM shutdown/startup order
  • Support changing custom VM name during restore

Requirements:

  • VMs running on ESX(i) 3.5/4.x+/5.x/6.x/7.x/8.x
  • SSH console access to ESX(i) host

Download

Latest ghettoVCB VIB and Offline Bundle can be downloaded from here

Install

You can quickly install/update ghettoVCB by downloading and installing either the VIB or offline bundle using the following commands. If you wish to update to latest ghettoVCB release and are using the ghettovcb.conf file and wish to have your settings persist, make sure to use the update command instead of install

Once installed, you will find all ghettoVCB configuration files located in:

/opt/ghettovcb/ghettoVCB.conf
/opt/ghettovcb/ghettoVCB-restore_vm_restore_configuration_template
/opt/ghettovcb/ghettoVCB-vm_backup_configuration_template

Both ghettoVCB and ghettoVCB-restore scripts are located in:

/opt/ghettovcb/bin/ghettoVCB.sh
/opt/ghettovcb/bin/ghettoVCB-restore.sh

For ESXi 5.x to 6.x

Install VIB

esxcli software vib install -v /vghetto-ghettoVCB-7x.vib -f

Update VIB

esxcli software vib update -v /vghetto-ghettoVCB-7x.vib -f

Retrieve installation

esxcli software vib get -n ghettoVCB

For ESXi 7.x

Install VIB

esxcli software vib install -v /vghetto-ghettoVCB-7x.vib -f

Install offline bundle

esxcli software vib install -d /vghetto-ghettoVCB-offline-bundle-7x.zip -f

Update VIB

esxcli software vib update -v /vghetto-ghettoVCB-7x.vib -f

Update offline bundle

esxcli software vib update -d /vghetto-ghettoVCB-offline-bundle-7x.zip -f

Retrieve installation

esxcli software vib get -n ghettoVCB

For ESXi 8.x and later

Install VIB

esxcli software vib install -v /vghetto-ghettoVCB-8x.vib -f

Install offline bundle

esxcli software vib install -d /vghetto-ghettoVCB-offline-bundle-8x.zip -f

Update VIB

esxcli software vib update -v /vghetto-ghettoVCB-8x.vib -f

Update offline bundle

esxcli software vib update -d /vghetto-ghettoVCB-offline-bundle-8x.zip -f

Retrieve installation

esxcli software vib get -n ghettoVCB

Uninstall

Remove ghettoVCB

esxcli software vib remove -n ghettoVCB

Note: If the installation takes some time. Just wait. This is normal.

Build VIB and Offline Bundle

See the build documentation here

Configuration Options

The following variables need to be defined within the script or in VM backup policy prior to execution.

Defining the backup datastore and folder in which the backups are stored (if folder does not exist, it will automatically be created):

VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS

Defining the backup disk format (zeroedthick, eagerzeroedthick, thin, and 2gbsparse are available):

DISK_BACKUP_FORMAT=thin

Note: If you are using the 2gbsparse on an ESXi 5.1 host, backups may fail. Please download the latest version of the ghettoVCB script which automatically resolves this or take a look at this article for the details.

Defining the backup rotation per VM:

VM_BACKUP_ROTATION_COUNT=3

Defining whether the VM is powered down or not prior to backup (1 = enable, 0 = disable):

POWER_VM_DOWN_BEFORE_BACKUP=0

Note: VM(s) that are powered off will not require snapshoting

Defining whether the VM can be hard powered off when POWER_VM_DOWN_BEFORE_BACKUP is enabled and VM does not have VMware Tools installed

ENABLE_HARD_POWER_OFF=0

If ENABLE_HARD_POWER_OFF is enabled, then this defines the number of (60sec) iterations the script will before executing a hard power off when:

ITER_TO_WAIT_SHUTDOWN=3

The number (60sec) iterations the script will wait when powering off the VM and will give up and ignore the particular VM for backup:

POWER_DOWN_TIMEOUT=5

The number (60sec) iterations the script will wait when taking a snapshot of a VM and will give up and ignore the particular VM for backup:

SNAPSHOT_TIMEOUT=15

Defining whether or not to enable compression (1 = enable, 0 = disable):

ENABLE_COMPRESSION=0

Note: With ESXi 3.x/4.x/5.x, there is a limitation of the maximum size of a VM for compression within the unsupported Busybox Console which should not affect backups running classic ESX 3.x,4.x or 5.x. On ESXi 3.x the largest supported VM is 4GB for compression and on ESXi 4.x the largest supported VM is 8GB. If you try to compress a larger VM, you may run into issues when trying to extract upon a restore. PLEASE TEST THE RESTORE PROCESS BEFORE MOVING TO PRODUCTION SYSTEMS!. Please note, do not mix uncompressed backups with compressed backups. Ensure that directories selected for backups do not contain any backups with previous versions of ghettoVCB before enabling and implementing the compressed backups feature.

Defining whether virtual machine memory is snapped and if quiescing is enabled (1 = enable, 0 = disable):

VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0

Note: VM_SNAPSHOT_MEMORY is only used to ensure when the snapshot is taken, it's memory contents are also captured. This is only relevant to the actual snapshot and it's not used in any shape/way/form in regards to the backup. All backups taken whether your VM is running or offline will result in an offline VM backup when you restore. This was originally added for debugging purposes and in generally should be left disabled

Defining VMDK(s) to backup from a particular VM either a list of vmdks or "all"

VMDK_FILES_TO_BACKUP="myvmdk.vmdk"

Defining whether or not VM(s) with existing snapshots can be backed up. This flag means it will CONSOLIDATE ALL EXISTING SNAPSHOTS for a VM prior to starting the backup (1 = yes, 0 = no):

ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=0

Defining the order of which VM(s) should be shutdown first, especially if there is a dependency between multiple VM(s). This should be a comma seperate list of VM(s)

VM_SHUTDOWN_ORDER=vm1,vm2,vm3

Defining the order of VM(s) that should be started up first after backups have completed, especially if there is a dependency between multiple VM(s). This should be a comma seperate list of VM(s)

VM_STARTUP_ORDER=vm3,vm2,vm1

Defining NON-PERSISTENT NFS Backup Volume (1 = yes, 0 = no):

ENABLE_NON_PERSISTENT_NFS=0

Note: This is meant for environments that do not want a persisted connection to their NFS backup volume and allows the NFS volume to only be mounted during backups. The script expects the following 5 variables to be defined if this is to be used: UNMOUNT_NFS, NFS_SERVER, NFS_MOUNT, NFS_LOCAL_NAMEandNFS_VM_BACKUP_DIR`

Defining whether or not to unmount the NFS backup volume (1 = yes, 0 = no):

UNMOUNT_NFS=0

Defining the NFS server address (IP/hostname):

NFS_SERVER=172.51.0.192

Defining the NFS export path:

NFS_MOUNT=/upload

Defining the NFS datastore name:

NFS_LOCAL_NAME=backup

Defining the NFS backup directory for VMs:

NFS_VM_BACKUP_DIR=mybackups

Note: Only supported if you are running vSphere 4. and later. If you are having issues with sending mail, please take a look at Email Backup Log section

Defining whether or not to email backup logs (1 = yes, 0 = no):

EMAIL_LOG=1

Defining whether or not to email message will be deleted off the host whether it is successful in sending, this is used for debugging purposes. (1 = yes, 0 = no):

EMAIL_DEBUG=1

Defining email server:

EMAIL_SERVER=auroa.primp-industries.com

Defining email server port:

EMAIL_SERVER_PORT=25

Defining email delay interval (useful if you have slow SMTP server and would like to include a delay in netcat using -i param, default is 1second):

EMAIL_DELAY_INTERVAL=1

Defining recipient of the email (comma separated):

Defining from user which may require specific domain entry depending on email server configurations:

EMAIL_FROM=root@ghettoVCB

Note: nc (netcat) utility must be present for email support to function, this utility is a now a default with the release of vSphere 4.1 or greater, previous releases of VI 3.5 and/or vSphere 4.0 does not contain this utility. The reason this is listed as experimental is it may not be compatible with all email servers as the script utlizes nc (netcat) utility to communicate to an email server. This feature is provided as-is with no guarantees. If you enable this feature, a separate log will be generated along side any normal logging which will be used to email recipient. If for whatever reason, the email fails to send, an entry will appear per the normal logging mechanism.

If you are running ESXi 5.1 and later, you will need to create a custom firewall rule to allow your email traffic to go out which I will assume is default port 25. Here are the steps for creating a custom email rule.

Step 1 - Create a file called /etc/vmware/firewall/email.xml with contains the following:

<ConfigRoot>
  <service>
    <id>email</id>
    <rule id="0000">
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>25</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>
</ConfigRoot>

Step 2 - Reload the ESXi firewall by running the following ESXCLI command:

# esxcli network firewall refresh

Step 3 - Confirm that your email rule has been loaded by running the following ESXCLI command:

# esxcli network firewall ruleset list | grep email
email                  true

Step 4 - Connect to your email server by usingn nc (netcat) by running the following command and specifying the IP Address/Port of your email server:

# nc 172.30.0.107 25
220 mail.primp-industries.com ESMTP Postfix

You should recieve a response from your email server and you can enter Ctrl+C to exit. This custom ESXi firewall rule will not persist after a reboot, so you should create a custom VIB to ensure it persists after a system reboot. Please take a look at this article for the details.

Defining to support RSYNC symbolic link creation (1 = yes, 0 = no):

RSYNC_LINK=0

To make use of this feature, modify the variable RSYNC_LINK from 0 to 1. Please note, this is an experimental feature request from users that rely on rsync to replicate changes from one datastore volume to another datastore volume. The premise of this feature is to have a standardized folder that rsync can monitor for changes to replicate to another backup datastore. When this feature is enabled, a symbolic link will be generated with the format of "-symlink" and will reference the latest successful VM backup. You can then rely on this symbolic link to watch for changes and replicate to your backup datastore.

Here is an example of what this would look like:

[root@himalaya ghettoVCB]# ls -la /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/vcma/
total 0
drwxr-xr-x 1 nobody nobody 110 Sep 27 08:08 .
drwxr-xr-x 1 nobody nobody  17 Sep 16 14:01 ..
lrwxrwxrwx 1 nobody nobody  89 Sep 27 08:08 vcma-symlink -> /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/vcma/vcma-2010-09-27_08-07-37
drwxr-xr-x 1 nobody nobody  58 Sep 27 08:04 vcma-2010-09-27_08-04-26
drwxr-xr-x 1 nobody nobody  58 Sep 27 08:06 vcma-2010-09-27_08-05-55
drwxr-xr-x 1 nobody nobody  58 Sep 27 08:08 vcma-2010-09-27_08-07-37

Note: This enables an automatic creation of a generic symbolic link (both a relative & absolution path) in which users can refer to run replication backups using rsync from a remote host. This does not actually support rsync backups with ghettoVCB. Please take a look at the Rsync Section of the documentation for more details.

A sample global ghettoVCB configuration file is included with the download called ghettoVCB.conf. It contains the same variables as defined from above and allows a user to customize and define multiple global configurations based on a user's environment.

# cat ghettoVCB.conf
VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
DISK_BACKUP_FORMAT=thin
VM_BACKUP_ROTATION_COUNT=3
POWER_VM_DOWN_BEFORE_BACKUP=0
ENABLE_HARD_POWER_OFF=0
ITER_TO_WAIT_SHUTDOWN=3
POWER_DOWN_TIMEOUT=5
ENABLE_COMPRESSION=0
VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0
ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=0
ENABLE_NON_PERSISTENT_NFS=0
UNMOUNT_NFS=0
NFS_SERVER=172.30.0.195
NFS_MOUNT=/nfsshare
NFS_LOCAL_NAME=nfs_storage_backup
NFS_VM_BACKUP_DIR=mybackups
SNAPSHOT_TIMEOUT=15
EMAIL_LOG=0
EMAIL_SERVER=auroa.primp-industries.com
EMAIL_SERVER_PORT=25
EMAIL_DELAY_INTERVAL=1
[email protected]
EMAIL_FROM=root@ghettoVCB
WORKDIR_DEBUG=0
VM_SHUTDOWN_ORDER=
VM_STARTUP_ORDER=

To override any existing configurations within the ghettoVCB.sh script and to use a global configuration file, user just needs to specify the -g flag and path to global configuration file.

Running multiple instances of ghettoVCB is now supported with the latest release by specifying the working directory (-w) flag.

By default, the working directory of the ghettoVCB instance is /tmp/ghettoVCB.work and you can run another instance by providing an alternate working directory. You should try to minimize the number of ghettoVCB instances running on your ESXi host as it does consume some amount of resources when running in the ESXi Shell. This is considered an experimental feature, so please test in a development environment to ensure everything is working prior to moving to production system.

Usage

# /opt/ghettovcb/bin/ghettoVCB.sh
###############################################################################
#
# ghettoVCB for ESX/ESXi 3.5, 4.x, 5.x, 6.x, 7.x & 8.x
# Author: William Lam
# http://www.virtuallyghetto.com/
# Documentation: http://communities.vmware.com/docs/DOC-8760
# Created: 11/17/2008
# Last modified: 2023_09_29 Version 1
#
###############################################################################

Usage: ghettoVCB.sh [options]

OPTIONS:
   -a     Backup all VMs on host
   -f     List of VMs to backup
   -m     Name of VM to backup (overrides -f)
   -j     Job name to show in email report subject (makes sense only in conjunction with -f)
   -c     VM configuration directory for VM backups
   -g     Path to global ghettoVCB configuration file
   -l     File to output logging
   -w     ghettoVCB work directory (default: /tmp/ghettoVCB.work)
   -d     Debug level [info|debug|dryrun] (default: info)

(e.g.)

Backup list of VMs from a file (optionally include a job name for the email report)
	/opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup [ -j myJob ]

Backup a single VM
	/opt/ghettovcb/bin/ghettoVCB.sh -m vm_to_backup

Backup all VMs residing on this host
	/opt/ghettovcb/bin/ghettoVCB.sh -a

Backup all VMs residing on this host except for the VMs in the exclusion list
	/opt/ghettovcb/bin/ghettoVCB.sh -a -e vm_exclusion_list

Backup VMs based on specific configuration located in directory
	/opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -c vm_backup_configs

Backup VMs using global ghettoVCB configuration file
	/opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -g /global/ghettoVCB.conf

Output will log to /tmp/ghettoVCB.log (consider logging to local or remote datastore to persist logs)
	/opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -l /vmfs/volume/local-storage/ghettoVCB.log

Dry run (no backup will take place)
	/opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -d dryrun

The input to this script is a file that contains the display name of the virtual machine(s) separated by a newline. When creating this file on a non-Linux/UNIX system, you may introduce ^M character which can cause the script to miss-behave. To ensure this does not occur, plesae create the file on the ESX/ESXi host.

Here is a sample of what the file would look like:

[root@himalaya ~]# cat vms_to_backup
vCOPS
vMA
vCloudConnector

Sample Execution:

Dry Run

This execution mode provides a quick summary of details on whether a given set of VM(s)/VMDK(s) will be backed up. It provides additional information such as VMs that may have snapshots, VMDK(s) that are configured as independent disks, or other issues that may cause a VM or VMDK to not backed up.

  • Log verbosity: dryrun
  • Log output: stdout & /tmp (default)
    • Logs by default will be stored in /tmp, these log files may not persist through reboots, especially when dealing with ESXi. You should log to either a local or remote datastore to ensure that logs are kept upon a reboot.
[root@himalaya]# /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -d dryrun
Logging output to "/tmp/ghettoVCB-2011-03-13_15-19-57.log" ...
2011-03-13 15:19:57 -- info: ============================== ghettoVCB LOG START ==============================

2011-03-13 15:19:57 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:19:57 -- info: CONFIG - GHETTOVCB_PID = 30157
2011-03-13 15:19:57 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:19:57 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:19:57 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-19-57
2011-03-13 15:19:57 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:19:57 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:19:57 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:19:57 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2011-03-13 15:19:57 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:19:57 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:19:57 -- info: CONFIG - LOG_LEVEL = dryrun
2011-03-13 15:19:57 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2011-03-13_15-19-57.log
2011-03-13 15:19:57 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:19:57 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:19:57 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2011-03-13 15:19:57 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:19:57 -- info:
2011-03-13 15:19:57 -- dryrun: ###############################################
2011-03-13 15:19:57 -- dryrun: Virtual Machine: scofield
2011-03-13 15:19:57 -- dryrun: VM_ID: 704
2011-03-13 15:19:57 -- dryrun: VMX_PATH: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield.vmx
2011-03-13 15:19:57 -- dryrun: VMX_DIR: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield
2011-03-13 15:19:57 -- dryrun: VMX_CONF: scofield/scofield.vmx
2011-03-13 15:19:57 -- dryrun: VMFS_VOLUME: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:19:57 -- dryrun: VMDK(s):
2011-03-13 15:19:58 -- dryrun:  scofield_3.vmdk 3 GB
2011-03-13 15:19:58 -- dryrun:  scofield_2.vmdk 2 GB
2011-03-13 15:19:58 -- dryrun:  scofield_1.vmdk 1 GB
2011-03-13 15:19:58 -- dryrun:  scofield.vmdk   5 GB
2011-03-13 15:19:58 -- dryrun: INDEPENDENT VMDK(s):
2011-03-13 15:19:58 -- dryrun: TOTAL_VM_SIZE_TO_BACKUP: 11 GB
2011-03-13 15:19:58 -- dryrun: ###############################################

2011-03-13 15:19:58 -- dryrun: ###############################################
2011-03-13 15:19:58 -- dryrun: Virtual Machine: vMA
2011-03-13 15:19:58 -- dryrun: VM_ID: 1440
2011-03-13 15:19:58 -- dryrun: VMX_PATH: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vMA/vMA.vmx
2011-03-13 15:19:58 -- dryrun: VMX_DIR: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vMA
2011-03-13 15:19:58 -- dryrun: VMX_CONF: vMA/vMA.vmx
2011-03-13 15:19:58 -- dryrun: VMFS_VOLUME: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:19:58 -- dryrun: VMDK(s):
2011-03-13 15:19:58 -- dryrun:  vMA-000002.vmdk 5 GB
2011-03-13 15:19:58 -- dryrun: INDEPENDENT VMDK(s):
2011-03-13 15:19:58 -- dryrun: TOTAL_VM_SIZE_TO_BACKUP: 5 GB
2011-03-13 15:19:58 -- dryrun: Snapshots found for this VM, please commit all snapshots before continuing!
2011-03-13 15:19:58 -- dryrun: THIS VIRTUAL MACHINE WILL NOT BE BACKED UP DUE TO EXISTING SNAPSHOTS!
2011-03-13 15:19:58 -- dryrun: ###############################################

2011-03-13 15:19:58 -- dryrun: ###############################################
2011-03-13 15:19:58 -- dryrun: Virtual Machine: vCloudConnector
2011-03-13 15:19:58 -- dryrun: VM_ID: 2064
2011-03-13 15:19:58 -- dryrun: VMX_PATH: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmx
2011-03-13 15:19:58 -- dryrun: VMX_DIR: /vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector
2011-03-13 15:19:58 -- dryrun: VMX_CONF: vCloudConnector/vCloudConnector.vmx
2011-03-13 15:19:58 -- dryrun: VMFS_VOLUME: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:19:58 -- dryrun: VMDK(s):
2011-03-13 15:19:59 -- dryrun:  vCloudConnector.vmdk    3 GB
2011-03-13 15:19:59 -- dryrun: INDEPENDENT VMDK(s):
2011-03-13 15:19:59 -- dryrun:  vCloudConnector_1.vmdk  40 GB
2011-03-13 15:19:59 -- dryrun: TOTAL_VM_SIZE_TO_BACKUP: 3 GB
2011-03-13 15:19:59 -- dryrun: Snapshots can not be taken for indepdenent disks!
2011-03-13 15:19:59 -- dryrun: THIS VIRTUAL MACHINE WILL NOT HAVE ALL ITS VMDKS BACKED UP!
2011-03-13 15:19:59 -- dryrun: ###############################################

2011-03-13 15:19:59 -- info: ###### Final status: OK, only a dryrun. ######

2011-03-13 15:19:59 -- info: ============================== ghettoVCB LOG END ================================

In the example above, we have 3 VMs to be backed up:

  • scofield has 4 VMDK(s) that total up to 11GB and does not contain any snapshots/independent disks and this VM should backup without any issues
  • vMA has 1 VMDK but it also contains a snapshot and clearly this VM will not be backed up until the snapshot has been committed
  • vCloudConnector has 2 VMDK(s), one which is 3GB and another which is 40GB and configured as an independent disk. Since snapshots do not affect independent disk, only the 3GB VMDK will be backed up for this VM as denoted by the "TOTAL_VM_SIZE_TO_BACKUP"

Debug

This execution modes provides more in-depth information about environment/backup process including additional storage debugging information which provides information about both the source/destination datastore pre and post backups. This can be very useful in troubleshooting backups

  • Log verbosity: debug
  • Log output: stdout & /tmp (default)
    • Logs by default will be stored in /tmp, these log files may not persist through reboots, especially when dealing with ESXi. You should log to either a local or remote datastore to ensure that logs are kept upon a reboot.
[root@himalaya]# /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -d debug
Logging output to "/tmp/ghettoVCB-2011-03-13_15-27-59.log" ...
2011-03-13 15:27:59 -- info: ============================== ghettoVCB LOG START ==============================

2011-03-13 15:27:59 -- debug: Succesfully acquired lock directory - /tmp/ghettoVCB.lock

2011-03-13 15:27:59 -- debug: HOST VERSION: VMware ESX 4.1.0 build-260247
2011-03-13 15:27:59 -- debug: HOST LEVEL: VMware ESX 4.1.0 GA
2011-03-13 15:27:59 -- debug: HOSTNAME: himalaya.primp-industries.com

2011-03-13 15:27:59 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:27:59 -- info: CONFIG - GHETTOVCB_PID = 31074
2011-03-13 15:27:59 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:27:59 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:27:59 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-27-59
2011-03-13 15:27:59 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:27:59 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:27:59 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:27:59 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2011-03-13 15:27:59 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:27:59 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:27:59 -- info: CONFIG - LOG_LEVEL = debug
2011-03-13 15:27:59 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2011-03-13_15-27-59.log
2011-03-13 15:27:59 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:27:59 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:27:59 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2011-03-13 15:27:59 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:27:59 -- info:
2011-03-13 15:28:01 -- debug: Storage Information before backup:
2011-03-13 15:28:01 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:28:01 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:28:01 -- debug:
2011-03-13 15:28:01 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:28:01 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:28:01 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:28:01 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:28:01 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:28:01 -- debug:
2011-03-13 15:28:02 -- info: Initiate backup for scofield
2011-03-13 15:28:02 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_3.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield_3.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_3.vmdk'...
Clone: 37% done.
2011-03-13 15:28:04 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_2.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield_2.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_2.vmdk'...
Clone: 85% done.
2011-03-13 15:28:05 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_1.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield_1.vmdk"

2011-03-13 15:28:06 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/scofield/scofield-2011-03-13_15-27-59/scofield.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield.vmdk'...
Clone: 78% done.
2011-03-13 15:29:52 -- info: Backup Duration: 1.83 Minutes
2011-03-13 15:29:52 -- info: Successfully completed backup for scofield!

2011-03-13 15:29:54 -- debug: Storage Information after backup:
2011-03-13 15:29:54 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:29:54 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:29:54 -- debug:
2011-03-13 15:29:54 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:29:54 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:29:54 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:29:54 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:29:54 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:29:54 -- debug:
2011-03-13 15:29:55 -- debug: Storage Information before backup:
2011-03-13 15:29:55 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:29:55 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:29:55 -- debug:
2011-03-13 15:29:55 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:29:55 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:29:55 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:29:55 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:29:55 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:29:55 -- debug:
2011-03-13 15:29:55 -- info: Snapshot found for vMA, backup will not take place

2011-03-13 15:29:57 -- debug: Storage Information before backup:
2011-03-13 15:29:57 -- debug: SRC_DATASTORE: himalaya-local-SATA.RE4-GP:Storage
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_CAPACITY: 1830.5 GB
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_FREE: 539.4 GB
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_BLOCKSIZE: 4
2011-03-13 15:29:57 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 1024 GB
2011-03-13 15:29:57 -- debug:
2011-03-13 15:29:57 -- debug: DST_DATASTORE: dlgCore-NFS-bigboi.VM-Backups
2011-03-13 15:29:57 -- debug: DST_DATASTORE_CAPACITY: 1348.4 GB
2011-03-13 15:29:57 -- debug: DST_DATASTORE_FREE: 296.8 GB
2011-03-13 15:29:57 -- debug: DST_DATASTORE_BLOCKSIZE: NA
2011-03-13 15:29:57 -- debug: DST_DATASTORE_MAX_FILE_SIZE: NA
2011-03-13 15:29:57 -- debug:
2011-03-13 15:29:58 -- info: Initiate backup for vCloudConnector
2011-03-13 15:29:58 -- debug: /usr/sbin/vmkfstools -i "/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmdk" -a "buslogic" -d "thin" "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/vCloudConnector/vCloudConnector-2011-03-13_15-27-59/vCloudConnector.vmdk"
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmdk'...
Clone: 97% done.
2011-03-13 15:30:45 -- info: Backup Duration: 47 Seconds
2011-03-13 15:30:45 -- info: WARN: vCloudConnector has some Independent VMDKs that can not be backed up!

2011-03-13 15:30:45 -- info: ###### Final status: ERROR: Only some of the VMs backed up, and some disk(s) failed! ######

2011-03-13 15:30:45 -- debug: Succesfully removed lock directory - /tmp/ghettoVCB.lock

2011-03-13 15:30:45 -- info: ============================== ghettoVCB LOG END ================================

Backup VMs stored in a list

[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup

Backup Single VM using CLI

[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB.sh -m MyVM

Backup All VMs residing on specific host

[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB.sh -a

Backup All VMs residing on specific host and exclude the VMs in the exclusion list

[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB.sh -a -e vm_exclusion_list

Backup VMs based on individual VM backup policies

  • Log verbosity: info (default)
  • Log output: /tmp/ghettoVCB.log
  • Logs by default will be stored in /tmp, these log files may not persist through reboots, especially when dealing with ESXi. You should log to either a local or remote datastore to ensure that logs are kept upon a reboot.
  1. Create folder to hold individual VM backup policies (can be named anything):
[root@himalaya ~]# mkdir backup_config
  1. Create individual VM backup policies for each VM that ensure each file is named exactly as the display name of the VM being backed up (use provided template to create duplicates):
[root@himalaya]# cp /opt/ghettovcb/ghettoVCB-vm_backup_configuration_template scofield
[root@himalaya]# cp /opt/ghettovcb/ghettoVCB-vm_backup_configuration_template vCloudConnector

Listing of VM backup policy within backup configuration directory

[root@himalaya backup_config]# ls
ghettoVCB-vm_backup_configuration_template  scofield  vCloudConnector

Backup policy for "scofield" (backup only 2 specific VMDKs)

[root@himalaya backup_config]# cat scofield
VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
DISK_BACKUP_FORMAT=thin
VM_BACKUP_ROTATION_COUNT=3
POWER_VM_DOWN_BEFORE_BACKUP=0
ENABLE_HARD_POWER_OFF=0
ITER_TO_WAIT_SHUTDOWN=4
POWER_DOWN_TIMEOUT=5
SNAPSHOT_TIMEOUT=15
ENABLE_COMPRESSION=0
VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0
VMDK_FILES_TO_BACKUP="scofield_2.vmdk,scofield_1.vmdk"

Backup policy for VM "vCloudConnector" (backup all VMDKs found)

[root@himalaya backup_config]# cat vCloudConnector
VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
DISK_BACKUP_FORMAT=thin
VM_BACKUP_ROTATION_COUNT=3
POWER_VM_DOWN_BEFORE_BACKUP=0
ENABLE_HARD_POWER_OFF=0
ITER_TO_WAIT_SHUTDOWN=4
POWER_DOWN_TIMEOUT=5
SNAPSHOT_TIMEOUT=15
ENABLE_COMPRESSION=0
VM_SNAPSHOT_MEMORY=0
VM_SNAPSHOT_QUIESCE=0
VMDK_FILES_TO_BACKUP="vCloudConnector.vmdk"

Note: When specifying -c option (individual VM backup policy mode) if a VM is listed in the backup list but DOES NOT have a corresponding backup policy, the VM will be backed up using the default configuration found within the ghettoVCB.sh script.

Execution of backup

[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -c backup_config -l /tmp/ghettoVCB.log

2011-03-13 15:40:50 -- info: ============================== ghettoVCB LOG START ==============================

2011-03-13 15:40:51 -- info: CONFIG - USING CONFIGURATION FILE = backup_config//scofield
2011-03-13 15:40:51 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:40:51 -- info: CONFIG - GHETTOVCB_PID = 2967
2011-03-13 15:40:51 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:40:51 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:40:51 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-40-50
2011-03-13 15:40:51 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:40:51 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:40:51 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:40:51 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 4
2011-03-13 15:40:51 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:40:51 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:40:51 -- info: CONFIG - LOG_LEVEL = info
2011-03-13 15:40:51 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB.log
2011-03-13 15:40:51 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:40:51 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:40:51 -- info: CONFIG - VMDK_FILES_TO_BACKUP = scofield_2.vmdk,scofield_1.vmdk
2011-03-13 15:40:51 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:40:51 -- info:
2011-03-13 15:40:53 -- info: Initiate backup for scofield
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_2.vmdk'...
Clone: 100% done.

Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/scofield/scofield_1.vmdk'...
Clone: 100% done.

2011-03-13 15:40:55 -- info: Backup Duration: 2 Seconds
2011-03-13 15:40:55 -- info: Successfully completed backup for scofield!

2011-03-13 15:40:57 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:40:57 -- info: CONFIG - GHETTOVCB_PID = 2967
2011-03-13 15:40:57 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:40:57 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:40:57 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-40-50
2011-03-13 15:40:57 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:40:57 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:40:57 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:40:57 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2011-03-13 15:40:57 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:40:57 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:40:57 -- info: CONFIG - LOG_LEVEL = info
2011-03-13 15:40:57 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB.log
2011-03-13 15:40:57 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:40:57 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:40:57 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2011-03-13 15:40:57 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:40:57 -- info:
2011-03-13 15:40:59 -- info: Snapshot found for vMA, backup will not take place

2011-03-13 15:40:59 -- info: CONFIG - USING CONFIGURATION FILE = backup_config//vCloudConnector
2011-03-13 15:40:59 -- info: CONFIG - VERSION = 2011_03_13_1
2011-03-13 15:40:59 -- info: CONFIG - GHETTOVCB_PID = 2967
2011-03-13 15:40:59 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS
2011-03-13 15:40:59 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2011-03-13 15:40:59 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2011-03-13_15-40-50
2011-03-13 15:40:59 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2011-03-13 15:40:59 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2011-03-13 15:40:59 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2011-03-13 15:40:59 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 4
2011-03-13 15:40:59 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2011-03-13 15:40:59 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2011-03-13 15:40:59 -- info: CONFIG - LOG_LEVEL = info
2011-03-13 15:40:59 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB.log
2011-03-13 15:40:59 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2011-03-13 15:40:59 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2011-03-13 15:40:59 -- info: CONFIG - VMDK_FILES_TO_BACKUP = vCloudConnector.vmdk
2011-03-13 15:40:59 -- info: CONFIG - EMAIL_LOG = 0
2011-03-13 15:40:59 -- info:
2011-03-13 15:41:01 -- info: Initiate backup for vCloudConnector
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage/vCloudConnector/vCloudConnector.vmdk'...
Clone: 100% done.

2011-03-13 15:41:51 -- info: Backup Duration: 50 Seconds
2011-03-13 15:41:51 -- info: WARN: vCloudConnector has some Independent VMDKs that can not be backed up!

2011-03-13 15:41:51 -- info: ###### Final status: ERROR: Only some of the VMs backed up, and some disk(s) failed! ######

2011-03-13 15:41:51 -- info: ============================== ghettoVCB LOG END ================================

Enable compression for backups

To make use of this feature, modify the variable ENABLE_COMPRESSION from 0 to 1. Please note, do not mix uncompressed backups with compressed backups. Ensure that directories selected for backups do not contain any backups with previous versions of ghettoVCB before enabling and implementing the compressed backups feature.

Stopping ghettoVCB Process

There may be a situation where you need to stop the ghettoVCB process and entering Ctrl+C will only kill off the main ghettoVCB process, however there may still be other spawn processes that you may need to identify and stop. Below are two scenarios you may encounter and the process to completely stop all processes related to ghettoVCB.

Interactively running ghettoVCB:

Step 1 - Press Ctrl+C which will kill off the main ghettoVCB instance

Step 2 - Search for any existing ghettoVCB process by running the following:

# ps -c | grep ghettoVCB | grep -v grep
3360136 3360136 tail                 tail -f /tmp/ghettoVCB.work/ghettovcb.Cs1M1x

Step 3 - Here we can see there is a tail command that was used in the script. We need to stop this process by using the kill command which accepts the PID (Process ID) which is identified by the first value on the far left hand side of the command. In this example, it is 3360136.

# kill -9 3360136

Note: Make sure you identify the correct PID, else you could accidently impact a running VM or worse your ESXi host.

Step 4 - Depending on where you stopped the ghettoVCB process, you may need to consolidate or remove any existing snapshots that may exist on the VM that was being backed up. You can easily do so by using the vSphere Client.

Non-Interactively running ghettoVCB:

Step 1 - Search for the ghettoVCB process (you can also validate the PID from the logs)

~ # ps -c | grep ghettoVCB | grep -v grep
3360393 3360393 busybox              ash ./ghettoVCB.sh -f list -d debug
3360790 3360790 tail                 tail -f /tmp/ghettoVCB.work/ghettovcb.deGeB7

Step 2 - Stop both the main ghettoVCB instance & tail command by using the kill command and specifying their respective PID IDs:

kill -9 3360393
kill -9 3360790

Step 3 - If a VM was in the process of being backed up, there is an additional process for the actual vmkfstools copy. You will need to identify the process for that and kill that as well. We will again use ps -c command and search for any vmkfstools that are running:

# ps -c | grep vmkfstools | grep -v grep
3360796 3360796 vmkfstools           /sbin/vmkfstools -i /vmfs/volumes/himalaya-temporary/VC-Windows/VC-Windows.vmdk -a lsilogic -d thin /vmfs/volumes/test-dont-use-this-volume/backups/VC-Windows/VC-Windows-2013-01-26_16-45-35/VC-Windows.vmdk

Step 4 - In case there is someone manually running a vmkfstools, make sure you take a look at the command itself and that it maps back to the current VM that was being backed up before kill the process. Once you have identified the proper PID, go ahead and use the kill command:

# kill -9 3360796

Step 5 - Depending on where you stopped the ghettoVCB process, you may need to consolidate or remove any existing snapshots that may exist on the VM that was being backed up. You can easily do so by using the vSphere Client.

Scheduling Backups using Cron

First, please review this primer on what is cronjob

The task of configuring cronjobs on classic ESX servers (with Service Console) is no different than traditional cronjobs on *nix operating systems (this procedure is outlined in the link above). With ESXi on the other hand, additional factors need to be taken into account when setting up cronjobs in the limited shell console called Busybox because changes made do not persist through a system reboot. The following document will outline steps to ensure that cronjob configurations are saved and present upon a reboot.

Note: Always redirect the ghettoVCB output to /dev/null and/or to a log when automating via cron, this becomes very important as one user has identified a limited amount of buffer capacity in which once filled, may cause ghettoVCB to stop in the middle of a backup. This primarily only affects users on ESXi, but it is good practice to always redirect the output. Also ensure you are specifying the FULL PATH when referencing the ghettoVCB script, input or log files.

e.g.

0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /dev/null

or

0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /tmp/ghettoVCB.log

Example - Configure ghettoVCB.sh to execute a backup five days a week (M-F) at 12AM (midnight) everyday and send output to a unique log file

Configure on ESX:

  1. As root, you'll install your cronjob by issuing:
[root@himalaya ~]# crontab -e
  1. Append the following entry:
0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB-backup-$(date +\%s).log
  1. Save and exit
[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
  1. List out and verify the cronjob that was just created:
[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# crontab -l
0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB-backup-$(date +\%s).log

Configure on ESXi:

  1. Setup the cronjob by appending the following line to /var/spool/cron/crontabs/root:
0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-$(date +\%s).log

If you are unable to edit/modify /var/spool/cron/crontabs/root, please make a copy and then edit the copy with the changes

cp /var/spool/cron/crontabs/root /var/spool/cron/crontabs/root.backup

Once your changes have been made, then "mv" the backup to the original file. This may occur on ESXi 4.x or 5.x hosts

mv /var/spool/cron/crontabs/root.backup /var/spool/cron/crontabs/root

You can now verify the crontab entry has been updated by using "cat" utility.

  1. Kill the current crond (cron daemon) and then restart the crond for the changes to take affect:

On ESXi < 3.5u3

kill $(ps | grep crond | cut -f 1 -d ' ')

On ESXi 3.5u3+

~ # kill $(pidof crond)
~ # crond

On ESXi 4.x/5.0

~ # kill $(cat /var/run/crond.pid)
~ # busybox crond

On ESXi 5.1 to 6.x

~ # kill $(cat /var/run/crond.pid)
~ # crond

On ESXi 7.x

~ # kill $(cat /var/run/crond.pid)
~ # /usr/lib/vmware/busybox/bin/busybox crond
  1. Now that the cronjob is ready to go, you need to ensure that this cronjob will persist through a reboot. You'll need to add the following two lines to /etc/rc.local (ensure that the cron entry matches what was defined above). In ESXi 5.1, you will need to edit /etc/rc.local.d/local.sh instead of /etc/rc.local as that is no longer valid.

On ESXi 3.5

/bin/kill $(pidof crond)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
crond

On ESXi 4.x/5.0

/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
/bin/busybox crond

On ESXi 5.1 to 6.x

/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
crond

On ESXi 7.x and later

/bin/kill $(cat /var/run/crond.pid) > /dev/null 2>&1
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
/usr/lib/vmware/busybox/bin/busybox crond

Afterwards the file should look like the following:

~ # cat /etc/rc.local
#! /bin/ash
export PATH=/sbin:/bin

log() {
   echo "$1"
   logger init "$1"
}

#execute all service retgistered in /etc/rc.local.d
if [http:// -d /etc/rc.local.d |http:// -d /etc/rc.local.d ]; then
   for filename in `find /etc/rc.local.d/ | sort`
      do
         if [ -f $filename ] && [ -x $filename ]; then
            log "running $filename"
            $filename
         fi
      done
fi

/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 0 * * 1-5 /vmfs/volumes/simplejack-local-storage/ghettoVCB.sh -f /vmfs/volumes/simplejack-local-storage/backuplist > /vmfs/volumes/simplejack-local-storage/ghettoVCB-backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
/bin/busybox crond

This will ensure that the cronjob is re-created upon a reboot of the system through a startup script

  1. To ensure that this is saved in the ESXi configuration, we need to manually initiate an ESXi backup by running:
~ # /sbin/auto-backup.sh
config implicitly loaded
local.tgz
etc/vmware/vmkiscsid/vmkiscsid.db
etc/dropbear/dropbear_dss_host_key
etc/dropbear/dropbear_rsa_host_key
etc/opt/vmware/vpxa/vpxa.cfg
etc/opt/vmware/vpxa/dasConfig.xml
etc/sysconfig/network
etc/vmware/hostd/authorization.xml
etc/vmware/hostd/hostsvc.xml
etc/vmware/hostd/pools.xml
etc/vmware/hostd/vmAutoStart.xml
etc/vmware/hostd/vmInventory.xml
etc/vmware/hostd/proxy.xml
etc/vmware/ssl/rui.crt
etc/vmware/ssl/rui.key
etc/vmware/vmkiscsid/initiatorname.iscsi
etc/vmware/vmkiscsid/iscsid.conf
etc/vmware/vmware.lic
etc/vmware/config
etc/vmware/dvsdata.db
etc/vmware/esx.conf
etc/vmware/license.cfg
etc/vmware/locker.conf
etc/vmware/snmp.xml
etc/group
etc/hosts
etc/inetd.conf
etc/rc.local
etc/chkconfig.db
etc/ntp.conf
etc/passwd
etc/random-seed
etc/resolv.conf
etc/shadow
etc/sfcb/repository/root/interop/cim_indicationfilter.idx
etc/sfcb/repository/root/interop/cim_indicationhandlercimxml.idx
etc/sfcb/repository/root/interop/cim_listenerdestinationcimxml.idx
etc/sfcb/repository/root/interop/cim_indicationsubscription.idx
Binary files /etc/vmware/dvsdata.db and /tmp/auto-backup.31345.dir/etc/vmware/dvsdata.db differ
config implicitly loaded
Saving current state in /bootbank
Clock updated.
Time: 20:40:36   Date: 08/14/2009   UTC

Now you're really done!

If you're still having trouble getting the cronjob to work, ensure that you've specified the correct parameters and there arenโ€™t any typos in any part of the syntax.

Ensure crond (cron daemon) is running:

ESX 3.x/4.0:

[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# ps -ef | grep crond | grep -v grep
root      2625     1  0 Aug13 ?        00:00:00 crond

ESXi 3.x/4.x/5.x:

~ # ps | grep crond | grep -v grep
5196 5196 busybox              crond

Ensure that the date/time on your ESX(i) host is setup correctly:

ESX(i):

[root@himalaya dlgCore-NFS-bigboi.VM-Backups]# date
Fri Aug 14 23:44:47 PDT 2009

Note: Careful attention must be noted if more than one backup is performed per day. Backup windows should be staggered to avoid contention or saturation of resources during these periods.

Restore Backups

The ghettoVCB-restore.sh script performs a restore of virtual machines backed up using ghettoVCB. Tasks are performed directly within the service console of the ESX(i) server involved in the restore process. Two main use cases are supported:

  1. Restore a VM that contains ALL VMDKs on one datastore
  2. Restore a VM that has VMDKs located on multiple datastores

In all cases, restored VMs will have VMDKs that reside on the SAME datastore chosen for the restore process. Please ensure that there is sufficient space on the target datastore before attempting a restore operation. In the near future, restoration of VMs backed up using the compression feature of ghettoVCB will be implemented.

Features

  • Support for logging output
  • Support for various debugging output
  • Allow spaces in VM(s) backup list (not recommended and not a best practice)
  • Support for restore in the following formats: ZEROEDTHICK (default behavior), 2GB SPARSE, THIN or EAGERZEROEDTHICK
  • Support changing custom VM name during restore

Usage

[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB-restore.sh
###############################################################################
#
# ghettoVCB-restore for ESX/ESXi 3.5, 4.x and 5.x
# Author: William Lam
# http://www.virtuallyghetto.com/
# Created: 08/18/2009
# Last modified: 2011_11_19_1
#
###############################################################################

Usage: ./ghettoVCB-restore.sh -c [VM_BACKUP_UP_LIST] -l [LOG_FILE] -d [DRYRUN_DEBUG_INFO]

OPTIONS:
   -c     VM backup list
   -l     File ot output logging
   -d     Dryrun/Debug Info [1|2]

(e.g.)

Output will go to stdout
        ./ghettoVCB-restore.sh -c vms_to_restore

Output will log to /tmp/ghettoVCB-restore.log
        ./ghettoVCB-restore.sh -c vms_to_restore -l /tmp/ghettoVCB-restore.log

Dryrun/Debug Info (dryrun only)
        ./ghettoVCB-restore.sh -c vms_to_restore -d 1
        ./ghettoVCB-restore.sh -c vms_to_restore -d 2

Standard input for script is a file that contains:

  1. Full path to the backed up VM
  2. Full restore path
  3. Restoration disk format
  4. Restored VM Display Name (NEW!)

Reminder: When creating this file on a non-Linux/UNIX system, one may introduce ^M characters that will cause the script to misbehave. To ensure that this does not occur, please create the file on the ESX/ESXi host.

Here is a sample of what the file should look like:

[root@himalaya ~]# cat vms_to_restore
#"<DIRECTORY or .TGZ>;<DATASTORE_TO_RESTORE_TO>;<DISK_FORMAT_TO_RESTORE>;<OPTIONAL_RESTORED_VM_DISPLAY_NAME>"
# DISK_FORMATS
# 1 = zeroedthick
# 2 = 2gbsparse
# 3 = thin
# 4 = eagerzeroedthick
# e.g.
# "/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS/VCAP/VCAP-2009-08-18--1;/vmfs/volumes/himalaya-local-SATA.RE4-GP:Storage;1"
"/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36;/vmfs/volumes/mini-local-datastore-1;3"
"/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36;/vmfs/volumes/mini-local-datastore-1;1;VCSA-RESTORE"

Comments in the input file is acceptable so long as the intended line is preceded by a #.

The above sample VM restore file, vms_to_restore, describes the following backup:

VM to restore Datastore to restore to VMDK format Restore VM Name
/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36 /vmfs/volumes/mini-local-datastore-1 thin VCSA-5.1
/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36 /vmfs/volumes/mini-local-datastore-1 zeroedthick VCSA-RESTORE

Sample Execution:

Perform a dryrun by displaying debug information ( restore will not take place)

Display debug information level 1:

# /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore -d 1

################ DEBUG MODE ##############
Virtual Machine: "VCSA-5.1"
VM_ORIG_VMX: "VCSA-5.1.vmx"
VM_ORG_FOLDER: "VCSA-5.1-2012-12-25_01-30-36"
VM_RESTORE_VMX: "VCSA-5.1.vmx"
VM_RESTORE_FOLDER: "VCSA-5.1"
VMDK_LIST_TO_MODIFY:
scsi0:0.fileName = "VCSA-5.1.vmdk"
scsi0:0.fileName  = "VCSA-5.1-0.vmdk"
scsi0:1.fileName = "VCSA-5.1_1.vmdk"
scsi0:1.fileName  = "VCSA-5.1-1.vmdk"
##########################################


################ DEBUG MODE ##############
Virtual Machine: "VCSA-RESTORE"
VM_ORIG_VMX: "VCSA-5.1.vmx"
VM_ORG_FOLDER: "VCSA-5.1-2012-12-25_01-30-36"
VM_RESTORE_VMX: "VCSA-RESTORE.vmx"
VM_RESTORE_FOLDER: "VCSA-RESTORE"
VMDK_LIST_TO_MODIFY:
scsi0:0.fileName = "VCSA-5.1.vmdk"
scsi0:0.fileName  = "VCSA-RESTORE-0.vmdk"
scsi0:1.fileName = "VCSA-5.1_1.vmdk"
scsi0:1.fileName  = "VCSA-RESTORE-1.vmdk"
##########################################


Start time: Sun Jan 13 16:45:12 UTC 2013
End   time: Sun Jan 13 16:45:14 UTC 2013
Duration  : 2 Seconds

Display debug information level 2:

[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore -d 2


################## Restoring VM: VCSA-5.1  #####################
==========> DEBUG MODE LEVEL 2 ENABLED <==========
Start time: Sun Jan 13 16:45:35 UTC 2013
Restoring VM from: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36"
Restoring VM to Datastore: "/vmfs/volumes/mini-local-datastore-1" using Disk Format: "thin"
Creating VM directory: "/vmfs/volumes/mini-local-datastore-1/VCSA-5.1" ...
Copying "VCSA-5.1.vmx" file ...
Restoring VM's VMDK(s) ...
Updating VMDK entry in "VCSA-5.1.vmx" file ...

SOURCE: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1.vmdk"
    ORIGINAL_VMX_LINE: -->scsi0:0.fileName = "VCSA-5.1.vmdk"<--
DESTINATION: "/vmfs/volumes/mini-local-datastore-1/VCSA-5.1/VCSA-5.1-0.vmdk"
    MODIFIED_VMX_LINE: -->scsi0:0.fileName  = "VCSA-5.1-0.vmdk"<--
Updating VMDK entry in "VCSA-5.1.vmx" file ...

SOURCE: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1_1.vmdk"
    ORIGINAL_VMX_LINE: -->scsi0:1.fileName = "VCSA-5.1_1.vmdk"<--
DESTINATION: "/vmfs/volumes/mini-local-datastore-1/VCSA-5.1/VCSA-5.1-1.vmdk"
    MODIFIED_VMX_LINE: -->scsi0:1.fileName  = "VCSA-5.1-1.vmdk"<--
Registering VCSA-5.1 ...
End time: Sun Jan 13 16:45:35 UTC 2013
################## Completed restore for VCSA-5.1! #####################

################## Restoring VM: VCSA-RESTORE  #####################
==========> DEBUG MODE LEVEL 2 ENABLED <==========
Start time: Sun Jan 13 16:45:35 UTC 2013
Restoring VM from: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36"
Restoring VM to Datastore: "/vmfs/volumes/mini-local-datastore-1" using Disk Format: "zeroedthick"
Creating VM directory: "/vmfs/volumes/mini-local-datastore-1/VCSA-RESTORE" ...
Copying "VCSA-5.1.vmx" file ...
Restoring VM's VMDK(s) ...
Updating VMDK entry in "VCSA-RESTORE.vmx" file ...

SOURCE: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1.vmdk"
    ORIGINAL_VMX_LINE: -->scsi0:0.fileName = "VCSA-5.1.vmdk"<--
DESTINATION: "/vmfs/volumes/mini-local-datastore-1/VCSA-RESTORE/VCSA-RESTORE-0.vmdk"
    MODIFIED_VMX_LINE: -->scsi0:0.fileName  = "VCSA-RESTORE-0.vmdk"<--
Updating VMDK entry in "VCSA-RESTORE.vmx" file ...

SOURCE: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1_1.vmdk"
    ORIGINAL_VMX_LINE: -->scsi0:1.fileName = "VCSA-5.1_1.vmdk"<--
DESTINATION: "/vmfs/volumes/mini-local-datastore-1/VCSA-RESTORE/VCSA-RESTORE-1.vmdk"
    MODIFIED_VMX_LINE: -->scsi0:1.fileName  = "VCSA-RESTORE-1.vmdk"<--
Registering VCSA-RESTORE ...
End time: Sun Jan 13 16:45:35 UTC 2013
################## Completed restore for VCSA-RESTORE! #####################


Start time: Sun Jan 13 16:45:34 UTC 2013
End   time: Sun Jan 13 16:45:35 UTC 2013
Duration  : 1 Seconds

---------------------------------------------------------------------------------------------------------------

Execute restore with output going to stdout (restore the first two VMs listed from above):

Input file:

[root@himalaya ~]# cat vms_to_restore

"/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36;/vmfs/volumes/mini-local-datastore-1;3"
"/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36;/vmfs/volumes/mini-local-datastore-1;1;VCSA-RESTORE"
[root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore

################## Restoring VM: VCSA-5.1  #####################
Start time: Sun Jan 13 16:46:41 UTC 2013
Restoring VM from: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36"
Restoring VM to Datastore: "/vmfs/volumes/mini-local-datastore-1" using Disk Format: "thin"
Creating VM directory: "/vmfs/volumes/mini-local-datastore-1/VCSA-5.1" ...
Copying "VCSA-5.1.vmx" file ...
Restoring VM's VMDK(s) ...
Updating VMDK entry in "VCSA-5.1.vmx" file ...
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1.vmdk'...
Clone: 100% done.
Updating VMDK entry in "VCSA-5.1.vmx" file ...
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1_1.vmdk'...
Clone: 100% done.
Registering VCSA-5.1 ...
34
End time: Sun Jan 13 16:48:51 UTC 2013
################## Completed restore for VCSA-5.1! #####################

################## Restoring VM: VCSA-RESTORE  #####################
Start time: Sun Jan 13 16:48:52 UTC 2013
Restoring VM from: "/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36"
Restoring VM to Datastore: "/vmfs/volumes/mini-local-datastore-1" using Disk Format: "zeroedthick"
Creating VM directory: "/vmfs/volumes/mini-local-datastore-1/VCSA-RESTORE" ...
Copying "VCSA-5.1.vmx" file ...
Restoring VM's VMDK(s) ...
Updating VMDK entry in "VCSA-RESTORE.vmx" file ...
Destination disk format: VMFS zeroedthick
Cloning disk '/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1.vmdk'...
Clone: 100% done.
Updating VMDK entry in "VCSA-RESTORE.vmx" file ...
Failed to clone disk: There is not enough space on the file system for the selected operation (13).
Destination disk format: VMFS zeroedthick
Cloning disk '/vmfs/volumes/mini-local-datastore-2/backups/VCSA-5.1/VCSA-5.1-2012-12-25_01-30-36/VCSA-5.1_1.vmdk'...
Registering VCSA-RESTORE ...
35
End time: Sun Jan 13 16:50:19 UTC 2013
################## Completed restore for VCSA-RESTORE! #####################


Start time: Sun Jan 13 16:46:40 UTC 2013
End   time: Sun Jan 13 16:50:19 UTC 2013
Duration  : 3.65 Minutes


---------------------------------------------------------------------------------------------------------------

Execute restore with output going to log file

/tmp/ghettoVCB-restore.log (restore the last two VMs listed from above):

[root@himalaya ~]# ./ghettoVCB-restore.sh -c vms_to_restore -l /tmp/ghettoVCB-restore.log
Logging output to "/tmp/ghettoVCB-restore.log" ...

ghettovcb's People

Contributors

11chrisadams11 avatar christopherkobayashi avatar chrostek avatar community-vsphere-tag avatar daviderickson avatar drtomasso avatar eric-young avatar gvalkov avatar jakdaniels avatar jobscry avatar jonweatherhead avatar kentsoderlind avatar lamw avatar leonbroadbent avatar mbalex avatar mike2038 avatar nboeckmann avatar p-schneider avatar pmhausen avatar ptgob avatar rapitharian avatar sethxxxx avatar sijans avatar szaszg avatar thenetworkisdown avatar tofi86 avatar tvlooy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghettovcb's Issues

dryrun ignores VMDK_FILES_TO_BACKUP

Hi,
I've set VMDK_FILES_TO_BACKUP to only one of the VMDKs but dryrun lists all VMDKs and TOTAL_VM_SIZE_TO_BACKUP is the sum of all VMDKs.

however, runing the script without dryrun will only backup the designated VMDKs.

has some Independent VMDKs that can not be backed up!

I become the follow Error - when i backup the vm.

/vmfs/volumes/4f755f0a-a874d160-b002-782bcb6dc1f7 # ./ghettoVCB.sh -f ./backuplist
Logging output to "/tmp/ghettoVCB-2013-05-03_11-01-26-8613148.log" ...
2013-05-03 11:01:26 -- info: ============================== ghettoVCB LOG START ==============================

2013-05-03 11:01:26 -- info: CONFIG - VERSION = 2013_01_11_0
2013-05-03 11:01:26 -- info: CONFIG - GHETTOVCB_PID = 8613148
2013-05-03 11:01:26 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/SATA-RAID1/backups
2013-05-03 11:01:26 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2013-05-03 11:01:26 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2013-05-03_11-01-26
2013-05-03 11:01:26 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2013-05-03 11:01:26 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2013-05-03 11:01:26 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2013-05-03 11:01:26 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2013-05-03 11:01:26 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2013-05-03 11:01:26 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2013-05-03 11:01:26 -- info: CONFIG - LOG_LEVEL = info
2013-05-03 11:01:26 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2013-05-03_11-01-26-8613148.log
2013-05-03 11:01:26 -- info: CONFIG - ENABLE_COMPRESSION = 0
2013-05-03 11:01:26 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2013-05-03 11:01:26 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2013-05-03 11:01:26 -- info: CONFIG - ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP = 0
2013-05-03 11:01:26 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2013-05-03 11:01:26 -- info: CONFIG - VM_SHUTDOWN_ORDER =
2013-05-03 11:01:26 -- info: CONFIG - VM_STARTUP_ORDER =
2013-05-03 11:01:26 -- info: CONFIG - EMAIL_LOG = 0
2013-05-03 11:01:26 -- info:
2013-05-03 11:01:29 -- info: Initiate backup for vm01
2013-05-03 11:01:29 -- info: Backup Duration: 0 Seconds
2013-05-03 11:01:29 -- info: WARN: vm01 has some Independent VMDKs that can not be backed up!

2013-05-03 11:01:31 -- info: ###### Final status: ERROR: No VMs backed up! ######

2013-05-03 11:01:31 -- info: ============================== ghettoVCB LOG END ================================

---- Files ----
-rw------- 1 root root 38296903680 May 3 11:00 vm01-flat.vmdk
-rw------- 1 root root 8684 May 3 11:00 vm01.nvram
-rw------- 1 root root 588 May 3 10:55 vm01.vmdk
-rw-r--r-- 1 root root 43 May 3 11:01 vm01.vmsd
-rwxr-xr-x 1 root root 2030 May 3 11:01 vm01.vmx
-rw-r--r-- 1 root root 363 Feb 12 16:39 vm01.vmxf
-rw-r--r-- 1 root root 74530 Feb 12 15:42 vmware-1.log
-rw-r--r-- 1 root root 78913 Feb 12 16:11 vmware-2.log
-rw-r--r-- 1 root root 81948 Apr 25 15:30 vmware-3.log
-rw-r--r-- 1 root root 73441 May 3 10:29 vmware-4.log
-rw-r--r-- 1 root root 81313 May 3 11:01 vmware.log

Esxi 5.0.0

cannot upgrade with the vib installed

Installer will HALT with error:

THis program has encountered an error:
Error (see log for more info):

Could not obtain module order from existing db
the isntallation profile could not be validated due to the following errors
VIB virtuallyGhetto_bootbank_ghettoVCB_1.0.0-0.0.0 violates extensibility rule checks [u (line 24: col 0_ Element vib failed to validate content]

VIB vrituallyGhetto_bootbank_ghettoVCB_1.0.0-0.0.0 acceptance level is community which is not compliant with the ImageProfile acceptance level partner

after reboot uninstalled the vib..

update went through nicely

Issue with a space and brackets in datastore name

I get error /vmfs/volumes/datastore1 (3)/ghettoVCB/ghettoVCB.sh: eval: line 1: syntax error: unexpected "(" when I try to execute the following command:
/vmfs/volumes/datastore1\ \(3\)/ghettoVCB/ghettoVCB.sh -g /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/ghettoVCB.conf -l /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/log/ghettoVCB.log -f /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/vm-list.txt -c /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/policies -d dryrun > /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/log/ghettoVCB-backup-$(/bin/date +\%F_\%H-\%M-\%S).log 2>&1.

or
"/vmfs/volumes/datastore1 (3)/ghettoVCB/ghettoVCB.sh" -g "/vmfs/volumes/datastore1 (3)/ghettoVCB/ghettoVCB.conf" -l "/vmfs/volumes/datastore1 (3)/ghettoVCB/log/ghettoVCB.log" -f "/vmfs/volumes/datastore1 (3)/ghettoVCB/vm-list.txt" -c "/vmfs/volumes/datastore1 (3)/ghettoVCB/policies" -d dryrun > "/vmfs/volumes/datastore1 (3)/ghettoVCB/log/ghettoVCB-backup-$(/bin/date +\%F_\%H-\%M-\%S).log" 2>&1

There is no such problem if the -f parameter is replaced with -m:
/vmfs/volumes/datastore1\ \(3\)/ghettoVCB/ghettoVCB.sh -g /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/ghettoVCB.conf -l /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/log/ghettoVCB.log -m millenium -c /vmfs/volumes/datastore1\ \(3\)/ghettoVCB/policies -d dryrun 2>&1

Or if not to use symlinks in volumes' names:
/vmfs/volumes/544b046f-e5625ec2-a958-0cc47a13cce8/ghettoVCB/ghettoVCB.sh -g /vmfs/volumes/544b046f-e5625ec2-a958-0cc47a13cce8/ghettoVCB/ghettoVCB.conf -l /vmfs/volumes/544b046f-e5625ec2-a958-0cc47a13cce8/ghettoVCB/log/ghettoVCB.log -f /vmfs/volumes/544b046f-e5625ec2-a958-0cc47a13cce8/ghettoVCB/vm-list.txt -c /vmfs/volumes/544b046f-e5625ec2-a958-0cc47a13cce8/ghettoVCB/policies -d dryrun > /vmfs/volumes/544b046f-e5625ec2-a958-0cc47a13cce8/ghettoVCB/log/ghettoVCB-backup-$(/bin/date +\%F_\%H-\%M-\%S).log 2>&1

Well, it seems to me that the issue is related with using a space and brackets in datastore name: datastore1 (3). Is there any hope that it can be fixed in source code of ghettoVCB.sh? I cannot rename the datastore. There are too many running VMs on it.

Actions to take when backup of VMDKs fails

It seems that in case backup of VMDK fails for some reason, ghettoVCB continues to backup VM. In this case it will also rotate backups of VM (with checkVMBackupRotation when VM_BACKUP_DIR_NAMING_CONVENTION<>0 => backup directories have date+time in name). I am not sure if this is how it should work by desing or if this is an error.

I think this is anyway somewhat unpleasant situation because it may cause backup to be corrupted so that VM can not be restored from backup...or at least VM will not work properly when some of the disks can not be recovered. If this is not noticed and backups fail in a row multible times, this may cause situation where all stored backups are corrupted.

For this reason I made modifications in my fork of ghettoVCB so that it will terminate backup of VM in case backup of any of its VMDKS's fails. In this case it will delete faulty backup and instead keep old valid backups. This also fixes symlink problem related to failed backup (earlier symlink was not updated, when faulty backup caused backup rotation). To accomplish this I had to change location of compress and rsync blocks and move them in the end of code block for VM backup (original code still exists there but they are commented out).

Does anybody find this approach preferable... ?

Minor errors fixed:
In debug mode, free space for SRC_DATASTORE_FREE and DST_DATASTORE_FREE displayed two values because grep command used to filter lines with string "capacity" ('.. | grep -i "capacity" ..') gives two different values in vmw 5.5.0 ("maxVirtualDiskCapacity" and "capacity"). I removed "-i" parameter of grep command to fix this. I do not know how it works with earlier versions of vmware.

Other additions:
Added optional variable to supply extra options for VMKFSTOOLS_CMD. Optional variable for extra pause between backup of VMDKs of VM + additional debug messages (to debug cases of failed backup).

VMware 5.5.0

Version checking in ghettoVCB.sh needs to be updated to include 5.5.0. Needs to be updated in -restore.sh as well.

@@ -254,7 +254,7 @@
     ESX_VERSION=$(vmware -v | awk '{print $3}')

     case "${ESX_VERSION}" in
-        5.0.0|5.1.0)    VER=5; break;;
+        5.0.0|5.1.0|5.5.0)    VER=5; break;;
         4.0.0|4.1.0)    VER=4; break;;
         3.5.0|3i)       VER=3; break;;
         *)              echo "You're not running ESX(i) 3.5, 4.x, 5.x!"; exit 1; break;;

VM_BACKUP_ROTATION_COUNT=0 removes newly made backup

With VM_BACKUP_ROTATION_COUNT=0, any backup that is made will also directly be removed. Although mathematically this makes sense, it doesn't from any other perspective. My suggestion would be to change the check for existence of a value into a numeric value check to make sure the minimum rotation count is 1.

ash: bad number when calling 'logger' function

When running a second session with one already running, I get error "ash: bad number" I think this will fix that

--- ghettoVCB.sh
+++ ghettoVCB.sh.15762
@@ -180,7 +180,7 @@
     if [[ "${LOG_LEVEL}" == "debug" ]] && [[ "${LOG_TYPE}" == "debug" ]] || [[ "${LOG_TYPE}" == "info" ]] || [[ "${LOG_TYPE}" == "dryrun" ]]; then
         TIME=$(date +%F" "%H:%M:%S)
-        if [[ "${LOG_TO_STDOUT}" -eq 1 ]] ; then
+        if [[ "${LOG_TO_STDOUT}" = 1 ]] ; then
             echo -e "${TIME} -- ${LOG_TYPE}: ${MSG}"
         fi

Saving data in working directory vs. value of variable WORKDIR_DEBUG=1

I could not get ghettoVCB to save workdir in dryrun mode when WORKDIR_DEBUG was set eq. to 1.
There is test about value of WORKDIR_DEBUG with command <trap 'rm -rf "${WORKDIR}"' 0> in two places.

Should the same test about value of WORKDIR_DEBUG be used also with third command <trap 'rm -rf "${WORKDIR}" ; exit 2' 1 2 3 13 15> so that workdir would be saved always in case WORKDIR_DEBUG=1 ?

If these extra tests would fix this, I can remove my "not so elegant tweak" with workdir and I could then create pull request for you for #21 (and #19) if you think my fix is good enough to distribute.

Missing check for ESXi 6.0.0 in restore script

On line 96 of ghettoVCB-restore.sh there should be a check for VER6 but it is missing.
I have added the check to my script and now it is possible to restore a VM in ESXi 6.0.0.

I don't know how to clone, change and commit my changes so I only report it as an issue.

Symlink problem

Currently, I can find in the code

ln -sf "${SYMLINK_DST1}" "${SYMLINK_SRC}"

to manage symlink.

To upload an existing symlink too, adding a -n could solve the problem.

ln -sfn "${SYMLINK_DST1}" "${SYMLINK_SRC}"

Any can confirm ?

handle sparse vmdks

I have a couple of VMs where the disks are all in a sparse format... The ghettoVCB throws "THIS VIRTUAL MACHINE WILL NOT BE BACKED UP DUE TO EMPTY VMDK LIST!" for such VMs..

EMAIL CONFIGURATIONS - Authentication

Thank for your great job.
I've three esx hosts all using ghettoVCB to backup my VMs.

Could you please add authentication options?
Most email servers need authentication.

ERROR: Only some of the VMs backed up

I have been getting this perky message. Regardless all the vms are able to back up?

Looks like it is failing on a 'blank' vm name at the very end.

`2016-10-04 05:05:00 -- info: ============================== ghettoVCB LOG START ==============================

2016-10-04 05:05:00 -- debug: Succesfully acquired lock directory - /tmp/ghettoVCB.work

2016-10-04 05:05:00 -- debug: HOST VERSION: VMware ESXi 5.5.0 build-2403361
2016-10-04 05:05:00 -- debug: HOST LEVEL: VMware ESXi 5.5.0 Update 2
2016-10-04 05:05:00 -- debug: HOSTNAME: hsesx2

2016-10-04 05:05:00 -- info: CONFIG - USING GLOBAL GHETTOVCB CONFIGURATION FILE = /vmfs/volumes/hsesx2_ds/ghettoVCB-master/conf
2016-10-04 05:05:00 -- info: CONFIG - VERSION = 2013_26_11_2
2016-10-04 05:05:00 -- info: CONFIG - GHETTOVCB_PID = 2676260
2016-10-04 05:05:00 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/hsesx2_backup/hsesx2_vms
2016-10-04 05:05:00 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 5
2016-10-04 05:05:00 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2016-10-04_05-04-59
2016-10-04 05:05:00 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2016-10-04 05:05:00 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2016-10-04 05:05:00 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2016-10-04 05:05:00 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2016-10-04 05:05:00 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2016-10-04 05:05:00 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2016-10-04 05:05:00 -- info: CONFIG - LOG_LEVEL = debug
2016-10-04 05:05:00 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2016-10-04_05-04-59-2676260.log
2016-10-04 05:05:00 -- info: CONFIG - ENABLE_COMPRESSION = 0
2016-10-04 05:05:00 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2016-10-04 05:05:00 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2016-10-04 05:05:00 -- info: CONFIG - ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP = 0
2016-10-04 05:05:00 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2016-10-04 05:05:00 -- info: CONFIG - VM_SHUTDOWN_ORDER =
2016-10-04 05:05:00 -- info: CONFIG - VM_STARTUP_ORDER = =
2016-10-04 05:05:00 -- info: CONFIG - RSYNC_LINK = 0
2016-10-04 05:05:00 -- info: CONFIG - EMAIL_LOG = 1
2016-10-04 05:05:00 -- info: CONFIG - EMAIL_SERVER = smtp.hstf.local
2016-10-04 05:05:00 -- info: CONFIG - EMAIL_SERVER_PORT = 25
2016-10-04 05:05:00 -- info: CONFIG - EMAIL_DELAY_INTERVAL = 1
2016-10-04 05:05:00 -- info: CONFIG - EMAIL_FROM = root@hsesx2
2016-10-04 05:05:00 -- info: CONFIG - EMAIL_TO = [email protected]
2016-10-04 05:05:00 -- info: CONFIG - WORKDIR_DEBUG = 0
2016-10-04 05:05:00 -- info:
2016-10-04 05:05:07 -- debug: Storage Information before backup:
2016-10-04 05:05:07 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:05:07 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:05:07 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:05:07 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:05:07 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:05:07 -- debug:
2016-10-04 05:05:07 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:05:07 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:05:07 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:05:07 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:05:07 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:05:07 -- debug:
2016-10-04 05:05:07 -- debug: getVMDKs() - HSSEPM1_1.vmdk###50:HSSEPM1.vmdk###40:
2016-10-04 05:05:08 -- info: Initiate backup for HSSEPM1
2016-10-04 05:05:08 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-04" for HSSEPM1
2016-10-04 05:05:10 -- debug: Waiting for snapshot "ghettoVCB-snapshot-2016-10-04" to be created
2016-10-04 05:05:10 -- debug: Snapshot timeout set to: 900 seconds
2016-10-04 05:05:11 -- debug: findVMDK() - Searching for VMDK: "HSSEPM1_1.vmdk" to backup
2016-10-04 05:05:11 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSSEPM1/HSSEPM1_1.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSSEPM1/HSSEPM1-2016-10-04_05-04-59/HSSEPM1_1.vmdk"
2016-10-04 05:08:34 -- debug: findVMDK() - Searching for VMDK: "HSSEPM1.vmdk" to backup
2016-10-04 05:08:34 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSSEPM1/HSSEPM1.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSSEPM1/HSSEPM1-2016-10-04_05-04-59/HSSEPM1.vmdk"
2016-10-04 05:12:26 -- info: Removing snapshot from HSSEPM1 ...
2016-10-04 05:12:26 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSSEPM1/HSSEPM1-2016-09-29_05-05-01
2016-10-04 05:12:26 -- info: Backup Duration: 7.30 Minutes
2016-10-04 05:12:26 -- info: Successfully completed backup for HSSEPM1!

2016-10-04 05:12:31 -- debug: Storage Information after backup:
2016-10-04 05:12:31 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:12:31 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:12:31 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:12:31 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:12:31 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:12:31 -- debug:
2016-10-04 05:12:31 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:12:31 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:12:31 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:12:31 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:12:31 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:12:31 -- debug:
2016-10-04 05:12:36 -- debug: Storage Information before backup:
2016-10-04 05:12:36 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:12:36 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:12:36 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:12:36 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:12:36 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:12:36 -- debug:
2016-10-04 05:12:36 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:12:36 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:12:36 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:12:36 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:12:36 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:12:36 -- debug:
2016-10-04 05:12:37 -- debug: getVMDKs() - HSSPLUNK1.vmdk###16:
2016-10-04 05:12:37 -- info: Initiate backup for HSSPLUNK1
2016-10-04 05:12:38 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-04" for HSSPLUNK1
2016-10-04 05:12:39 -- debug: Waiting for snapshot "ghettoVCB-snapshot-2016-10-04" to be created
2016-10-04 05:12:39 -- debug: Snapshot timeout set to: 900 seconds
2016-10-04 05:12:40 -- debug: findVMDK() - Searching for VMDK: "HSSPLUNK1.vmdk" to backup
2016-10-04 05:12:40 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSSPLUNK1/HSSPLUNK1.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSSPLUNK1/HSSPLUNK1-2016-10-04_05-04-59/HSSPLUNK1.vmdk"
2016-10-04 05:13:03 -- info: Removing snapshot from HSSPLUNK1 ...
2016-10-04 05:13:03 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSSPLUNK1/HSSPLUNK1-2016-09-29_05-05-01
2016-10-04 05:13:03 -- info: Backup Duration: 26 Seconds
2016-10-04 05:13:03 -- info: Successfully completed backup for HSSPLUNK1!

2016-10-04 05:13:08 -- debug: Storage Information after backup:
2016-10-04 05:13:08 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:13:08 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:13:08 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:13:08 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:13:08 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:13:08 -- debug:
2016-10-04 05:13:08 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:13:08 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:13:08 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:13:08 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:13:08 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:13:08 -- debug:
2016-10-04 05:13:13 -- debug: Storage Information before backup:
2016-10-04 05:13:13 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:13:13 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:13:13 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:13:13 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:13:13 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:13:13 -- debug:
2016-10-04 05:13:13 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:13:13 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:13:13 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:13:13 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:13:13 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:13:13 -- debug:
2016-10-04 05:13:14 -- debug: getVMDKs() - HSAP3P_1.vmdk###50:HSAP3P.vmdk###16:
2016-10-04 05:13:15 -- info: Initiate backup for HSAP3P
2016-10-04 05:13:15 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-04" for HSAP3P
2016-10-04 05:13:17 -- debug: Waiting for snapshot "ghettoVCB-snapshot-2016-10-04" to be created
2016-10-04 05:13:17 -- debug: Snapshot timeout set to: 900 seconds
2016-10-04 05:13:17 -- debug: findVMDK() - Searching for VMDK: "HSAP3P_1.vmdk" to backup
2016-10-04 05:13:17 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSAP3P/HSAP3P_1.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSAP3P/HSAP3P-2016-10-04_05-04-59/HSAP3P_1.vmdk"
2016-10-04 05:17:07 -- debug: findVMDK() - Searching for VMDK: "HSAP3P.vmdk" to backup
2016-10-04 05:17:07 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSAP3P/HSAP3P.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSAP3P/HSAP3P-2016-10-04_05-04-59/HSAP3P.vmdk"
2016-10-04 05:17:35 -- info: Removing snapshot from HSAP3P ...
2016-10-04 05:17:35 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSAP3P/HSAP3P-2016-09-29_05-05-01
2016-10-04 05:17:36 -- info: Backup Duration: 4.35 Minutes
2016-10-04 05:17:36 -- info: Successfully completed backup for HSAP3P!

2016-10-04 05:17:41 -- debug: Storage Information after backup:
2016-10-04 05:17:41 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:17:41 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:17:41 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:17:41 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:17:41 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:17:41 -- debug:
2016-10-04 05:17:41 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:17:41 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:17:41 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:17:41 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:17:41 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:17:41 -- debug:
2016-10-04 05:17:46 -- debug: Storage Information before backup:
2016-10-04 05:17:46 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:17:46 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:17:46 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:17:46 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:17:46 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:17:46 -- debug:
2016-10-04 05:17:46 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:17:46 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:17:46 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:17:46 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:17:46 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:17:46 -- debug:
2016-10-04 05:17:46 -- debug: getVMDKs() - HSTERM2.vmdk###50:
2016-10-04 05:17:47 -- info: Initiate backup for HSTERM2
2016-10-04 05:17:47 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-04" for HSTERM2
2016-10-04 05:17:48 -- debug: Waiting for snapshot "ghettoVCB-snapshot-2016-10-04" to be created
2016-10-04 05:17:48 -- debug: Snapshot timeout set to: 900 seconds
2016-10-04 05:17:49 -- debug: findVMDK() - Searching for VMDK: "HSTERM2.vmdk" to backup
2016-10-04 05:17:49 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSTERM2/HSTERM2.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSTERM2/HSTERM2-2016-10-04_05-04-59/HSTERM2.vmdk"
2016-10-04 05:22:15 -- info: Removing snapshot from HSTERM2 ...
2016-10-04 05:22:15 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSTERM2/HSTERM2-2016-09-29_05-05-01
2016-10-04 05:22:15 -- info: Backup Duration: 4.47 Minutes
2016-10-04 05:22:15 -- info: Successfully completed backup for HSTERM2!

2016-10-04 05:22:20 -- debug: Storage Information after backup:
2016-10-04 05:22:20 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:22:20 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:22:20 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:22:20 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:22:20 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:22:20 -- debug:
2016-10-04 05:22:20 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:22:20 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:22:20 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:22:20 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:22:20 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:22:20 -- debug:
2016-10-04 05:22:25 -- debug: Storage Information before backup:
2016-10-04 05:22:25 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:22:25 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:22:25 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:22:25 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:22:25 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:22:25 -- debug:
2016-10-04 05:22:25 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:22:25 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:22:25 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:22:25 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:22:25 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:22:25 -- debug:
2016-10-04 05:22:26 -- debug: getVMDKs() - HSNPS2.vmdk###40:
2016-10-04 05:22:26 -- info: Initiate backup for HSNPS2
2016-10-04 05:22:26 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-04" for HSNPS2
2016-10-04 05:22:28 -- debug: Waiting for snapshot "ghettoVCB-snapshot-2016-10-04" to be created
2016-10-04 05:22:28 -- debug: Snapshot timeout set to: 900 seconds
2016-10-04 05:22:29 -- debug: findVMDK() - Searching for VMDK: "HSNPS2.vmdk" to backup
2016-10-04 05:22:29 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSNPS2/HSNPS2.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSNPS2/HSNPS2-2016-10-04_05-04-59/HSNPS2.vmdk"
2016-10-04 05:25:06 -- info: Removing snapshot from HSNPS2 ...
2016-10-04 05:25:06 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSNPS2/HSNPS2-2016-09-29_05-05-01
2016-10-04 05:25:06 -- info: Backup Duration: 2.67 Minutes
2016-10-04 05:25:06 -- info: Successfully completed backup for HSNPS2!

2016-10-04 05:25:11 -- debug: Storage Information after backup:
2016-10-04 05:25:11 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:25:11 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:25:11 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:25:11 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:25:11 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:25:11 -- debug:
2016-10-04 05:25:11 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:25:11 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:25:11 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:25:11 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:25:11 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:25:11 -- debug:
2016-10-04 05:25:16 -- debug: Storage Information before backup:
2016-10-04 05:25:16 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:25:16 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:25:16 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:25:16 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:25:16 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:25:16 -- debug:
2016-10-04 05:25:16 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:25:16 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:25:16 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:25:16 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:25:16 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:25:16 -- debug:
2016-10-04 05:25:16 -- debug: getVMDKs() - HSAP2P_1.vmdk###25:HSAP2P.vmdk###40:
2016-10-04 05:25:17 -- info: Initiate backup for HSAP2P
2016-10-04 05:25:17 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-04" for HSAP2P
2016-10-04 05:25:18 -- debug: Waiting for snapshot "ghettoVCB-snapshot-2016-10-04" to be created
2016-10-04 05:25:18 -- debug: Snapshot timeout set to: 900 seconds
2016-10-04 05:25:19 -- debug: findVMDK() - Searching for VMDK: "HSAP2P_1.vmdk" to backup
2016-10-04 05:25:19 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSAP2P/HSAP2P_1.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSAP2P/HSAP2P-2016-10-04_05-04-59/HSAP2P_1.vmdk"
2016-10-04 05:25:30 -- debug: findVMDK() - Searching for VMDK: "HSAP2P.vmdk" to backup
2016-10-04 05:25:30 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSAP2P/HSAP2P.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSAP2P/HSAP2P-2016-10-04_05-04-59/HSAP2P.vmdk"
2016-10-04 05:26:53 -- info: Removing snapshot from HSAP2P ...
2016-10-04 05:26:53 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSAP2P/HSAP2P-2016-09-29_05-05-01
2016-10-04 05:26:53 -- info: Backup Duration: 1.60 Minutes
2016-10-04 05:26:53 -- info: Successfully completed backup for HSAP2P!

2016-10-04 05:26:58 -- debug: Storage Information after backup:
2016-10-04 05:26:58 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:26:58 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:26:58 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:26:58 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:26:58 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:26:58 -- debug:
2016-10-04 05:26:58 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:26:58 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:26:58 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:26:58 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:26:58 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:26:58 -- debug:
2016-10-04 05:27:03 -- debug: Storage Information before backup:
2016-10-04 05:27:03 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:27:03 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:27:03 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:27:03 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:27:03 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:27:03 -- debug:
2016-10-04 05:27:03 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:27:03 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:27:03 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:27:03 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:27:03 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:27:03 -- debug:
2016-10-04 05:27:03 -- debug: getVMDKs() - HSNAGIOS1.vmdk###10:
2016-10-04 05:27:04 -- info: Initiate backup for HSNAGIOS1
2016-10-04 05:27:04 -- debug: findVMDK() - Searching for VMDK: "HSNAGIOS1.vmdk" to backup
2016-10-04 05:27:04 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSNAGIOS1/HSNAGIOS1.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSNAGIOS1/HSNAGIOS1-2016-10-04_05-04-59/HSNAGIOS1.vmdk"
2016-10-04 05:29:20 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSNAGIOS1/HSNAGIOS1-2016-09-29_05-05-01
2016-10-04 05:29:20 -- info: Backup Duration: 2.27 Minutes
2016-10-04 05:29:20 -- info: Successfully completed backup for HSNAGIOS1!

2016-10-04 05:29:25 -- debug: Storage Information after backup:
2016-10-04 05:29:25 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:29:25 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:29:25 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:29:25 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:29:25 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:29:25 -- debug:
2016-10-04 05:29:25 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:29:25 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:29:25 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:29:25 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:29:25 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:29:25 -- debug:
2016-10-04 05:29:30 -- debug: Storage Information before backup:
2016-10-04 05:29:30 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:29:30 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:29:30 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:29:30 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:29:30 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:29:30 -- debug:
2016-10-04 05:29:30 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:29:30 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:29:30 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:29:30 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:29:30 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:29:30 -- debug:
2016-10-04 05:29:30 -- info: Snapshot found for RDDC1, backup will not take place

2016-10-04 05:29:35 -- debug: Storage Information before backup:
2016-10-04 05:29:35 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:29:35 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:29:35 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:29:35 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:29:35 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:29:35 -- debug:
2016-10-04 05:29:35 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:29:35 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:29:35 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:29:35 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:29:35 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:29:35 -- debug:
2016-10-04 05:29:36 -- debug: getVMDKs() - RDDC2.vmdk###40:
2016-10-04 05:29:37 -- info: Initiate backup for RDDC2
2016-10-04 05:29:37 -- debug: findVMDK() - Searching for VMDK: "RDDC2.vmdk" to backup
2016-10-04 05:29:37 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/RDDC2/RDDC2.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/RDDC2/RDDC2-2016-10-04_05-04-59/RDDC2.vmdk"
2016-10-04 05:30:49 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/RDDC2/RDDC2-2016-09-29_05-05-01
2016-10-04 05:30:49 -- info: Backup Duration: 1.20 Minutes
2016-10-04 05:30:49 -- info: Successfully completed backup for RDDC2!

2016-10-04 05:30:54 -- debug: Storage Information after backup:
2016-10-04 05:30:54 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:30:54 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:30:54 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:30:54 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:30:54 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:30:54 -- debug:
2016-10-04 05:30:54 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:30:54 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:30:54 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:30:54 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:30:54 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:30:54 -- debug:
2016-10-04 05:30:59 -- debug: Storage Information before backup:
2016-10-04 05:30:59 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:30:59 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:30:59 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:30:59 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:30:59 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:30:59 -- debug:
2016-10-04 05:30:59 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:30:59 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:30:59 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:30:59 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:30:59 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:30:59 -- debug:
2016-10-04 05:30:59 -- debug: getVMDKs() - HSZBXN1.vmdk###30:
2016-10-04 05:31:00 -- info: Initiate backup for HSZBXN1
2016-10-04 05:31:00 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-04" for HSZBXN1
2016-10-04 05:31:02 -- debug: Waiting for snapshot "ghettoVCB-snapshot-2016-10-04" to be created
2016-10-04 05:31:02 -- debug: Snapshot timeout set to: 900 seconds
2016-10-04 05:31:03 -- debug: findVMDK() - Searching for VMDK: "HSZBXN1.vmdk" to backup
2016-10-04 05:31:03 -- debug: /sbin/vmkfstools -i "/vmfs/volumes/hsesx2_ds/HSZBXN1/HSZBXN1.vmdk" -a "lsilogic" -d "thin" "/vmfs/volumes/hsesx2_backup/hsesx2_vms/HSZBXN1/HSZBXN1-2016-10-04_05-04-59/HSZBXN1.vmdk"
2016-10-04 05:37:21 -- info: Removing snapshot from HSZBXN1 ...
2016-10-04 05:37:21 -- debug: Removing /vmfs/volumes/hsesx2_backup/hsesx2_vms/HSZBXN1/HSZBXN1-2016-09-29_05-05-01
2016-10-04 05:37:21 -- info: Backup Duration: 6.35 Minutes
2016-10-04 05:37:21 -- info: Successfully completed backup for HSZBXN1!

2016-10-04 05:37:26 -- debug: Storage Information after backup:
2016-10-04 05:37:26 -- debug: SRC_DATASTORE: hsesx2_ds
2016-10-04 05:37:26 -- debug: SRC_DATASTORE_CAPACITY: 63488.0
698.0 GB
2016-10-04 05:37:26 -- debug: SRC_DATASTORE_FREE: 502.5 GB
2016-10-04 05:37:26 -- debug: SRC_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:37:26 -- debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:37:26 -- debug:
2016-10-04 05:37:26 -- debug: DST_DATASTORE: hsesx2_backup
2016-10-04 05:37:26 -- debug: DST_DATASTORE_CAPACITY: 63488.0
931.2 GB
2016-10-04 05:37:26 -- debug: DST_DATASTORE_FREE: 673.1 GB
2016-10-04 05:37:26 -- debug: DST_DATASTORE_BLOCKSIZE: 1
2016-10-04 05:37:26 -- debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB
2016-10-04 05:37:26 -- debug:
2016-10-04 05:37:26 -- debug: VM Startup Order: =

2016-10-04 05:37:26 -- info: Powering on initiated for =
2016-10-04 05:37:28 -- info: VM is powerdOn
2016-10-04 05:37:28 -- info: ###### Final status: ERROR: Only some of the VMs backed up! ######

2016-10-04 05:37:28 -- debug: Succesfully removed lock directory - /tmp/ghettoVCB.work

2016-10-04 05:37:28 -- info: ============================== ghettoVCB LOG END ================================`

backup problem from list

I cant do full backup of VM.

Logging output to "/tmp/ghettoVCB-2016-10-13_10-06-39-430569.log" ...
2016-10-13 10:06:40 -- info: ============================== ghettoVCB LOG START ==============================

2016-10-13 10:06:40 -- info: CONFIG - VERSION = 2015_05_06_1
2016-10-13 10:06:40 -- info: CONFIG - GHETTOVCB_PID = 430569
2016-10-13 10:06:40 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/datastore1
2016-10-13 10:06:40 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 3
2016-10-13 10:06:40 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2016-10-13_10-06-39
2016-10-13 10:06:40 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2016-10-13 10:06:40 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2016-10-13 10:06:40 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2016-10-13 10:06:40 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2016-10-13 10:06:40 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2016-10-13 10:06:40 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2016-10-13 10:06:40 -- info: CONFIG - LOG_LEVEL = info
2016-10-13 10:06:40 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2016-10-13_10-06-39-430569.log
2016-10-13 10:06:40 -- info: CONFIG - ENABLE_COMPRESSION = 0
2016-10-13 10:06:40 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2016-10-13 10:06:40 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2016-10-13 10:06:40 -- info: CONFIG - ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP = 0
2016-10-13 10:06:40 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2016-10-13 10:06:40 -- info: CONFIG - VM_SHUTDOWN_ORDER =
2016-10-13 10:06:40 -- info: CONFIG - VM_STARTUP_ORDER =
2016-10-13 10:06:40 -- info: CONFIG - RSYNC_LINK = 0
2016-10-13 10:06:40 -- info: CONFIG - BACKUP_FILES_CHMOD =
2016-10-13 10:06:40 -- info: CONFIG - EMAIL_LOG = 0
2016-10-13 10:06:40 -- info:
2016-10-13 10:06:44 -- info: Initiate backup for Win7
2016-10-13 10:06:44 -- info: Creating Snapshot "ghettoVCB-snapshot-2016-10-13" for Win7
Option --adaptertype is deprecated and hence will be ignored
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/datastore1/Win7/Win7.vmdk'...
Clone: 71% done.
2016-10-13 10:07:19 -- info: Removing snapshot from Win7 ...
2016-10-13 10:07:19 -- info: Backup Duration: 35 Seconds
2016-10-13 10:07:19 -- info: Successfully completed backup for Win7!

2016-10-13 10:07:22 -- info: ###### Final status: All VMs backed up OK! ######

2016-10-13 10:07:22 -- info: ============================== ghettoVCB LOG END ================================

sh: missing ]]
sh: bad number

Firewall SMTP (Documentation Change)

The existing documentation for the firewall rule says:

"This custom ESXi firewall rule will not persist after a reboot, so you should create a custom VIB to ensure it persists after a system reboot. Please take a look at this article for the details."

A simpler way to make this persistent is just to add it to /etc/rc.local.d/local.sh - especially since we're already modifying it for the cron job.

Here is the (tested/working) local.sh I use on both 5.1 and 5.5 machines:

#!/bin/sh

# local configuration options

# Note: modify at your own risk!  If you do/use anything in this
# script that is not part of a stable API (relying on files to be in
# specific places, specific tools, specific output, etc) there is a
# possibility you will end up with a broken system after patching or
# upgrading.  Changes are not supported unless under direction of
# VMware support.

/bin/cat > /etc/vmware/firewall/email.xml << EOF
<ConfigRoot>
  <service>
    <id>email</id>
    <rule id="0000">
      <direction>outbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>25</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>
</ConfigRoot>
EOF
/sbin/esxcli network firewall refresh

/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0 0 * * * /vmfs/volumes/Local/ghettoVCB/ghettoVCB.sh -f /vmfs/volumes/Local/ghettoVCB/backup.txt > /vmfs/volumes/Local/ghettoVCB/backup-\$(date +\\%s).log" >> /var/spool/cron/crontabs/root
crond

exit 0

VMs with special characters are not backed up

Example, 'Office VM+'

Line 826 in ghettoVCB.sh is this

VM_ID=$(grep -E ""${VM_NAME}"" ${WORKDIR}/vms_list | awk -F ";" '{print $1}' | sed 's/"//g')

The grep is failing because the -E means it is expecting extended regexps which include + as a special character. Removing the -E means it then works (at least the grep part). There doesn't seem a need for -E in that expression unless the VM include/exclusion lists are expected to work with wildcards?

There are several other examples of 'grep -E' in the script so I suspect changes might be needed for all or most of them.

busybox not found

On ESXi 5.1, I get an error message that busybox is not available.

Looking at the code:

IS_4I=0                                                                                                                                   

[[ ! -f /bin/bash ]] && IS_4I=1  

sets IS_4I to 1 because /bin/bash is not available in 5.1 making it use the busybox command on tar and fail. Perhaps there is a better way of detecting if it is 4I than this now that 5.1 is out?

Function sendMail, possible error...

I may be wrong but to me it looks like function sendMail does not obey parameters EMAIL_LOG and EMAIL_ALERT anymore. There is also duplicate for- loop to active email sending so it will send same email two times in certain case. Or have I missunderstood this completely...

independent disk error

this problem has already been discussed but i would like to investigate it a bit more, i'm posting in the original issue at #18

feel free to delete or merge as you prefer.
Marco.

Offline Bundle installed, and now?

I currently installed the offline bundle via vib

Installation Result
Message: Operation finished successfully.
Reboot Required: false
VIBs Installed: virtuallyGhetto_bootbank_ghettoVCB_1.0.0-0.0.0
VIBs Removed:
VIBs Skipped:

But now, I can not find any executable ๐Ÿ‘Ž

Where can I find it?

a little flexibility for email management

Thank for your great job.
I've five esx hosts all using ghettoVCB to backup my VMs, the result emailing is great to review what they done but I had to change the conf file on each host to have a different "mail from" field.
So I changed a bit the buildHeaders code adding these lines after the EMAIL_ADDRESS setting:

#check and adjust EMAIL_FROM
if [[ "${EMAIL_FROM%%@*}" == "" ]] ; then
    EMAIL_FROM="`hostname -s`$EMAIL_FROM"
fi

so in the conf file you can choose to set EMAIL_FROM either as a complete address like '[email protected]' or only as '@domain.com': the code will prepend the host name to the EMAIL_FROM variable.
I hope it could be usefull to someone else.

Flavio

VMWare 5.5 support

Can someone edit the master GhettoVCB?
This has to change If you want to use the GhettoVCB script on VMWARE ESXi 5.5:
5.0.0|5.5.0) VER=5; break;;

Wrong VMs are ignored with exclusion list.

The regular expression for checking if a VM is in an ignore file is not specific enough. It just checks if the start of any line matches the VM name. This way wrong VMs may be ignored. Example: The ignore file

foo10

also ignores VMs with names like foo or foo1 and not just foo10.

Line 815 should read:

             grep -E "^${VM_NAME}$" "${VM_EXCLUSION_FILE}" > /dev/null 2>&1

Location of command line parameter -w vs. parameters -a and -m

If -w parameter is not used, there are no problems with default value of workdir (/tmp/ghettoVCB.work).
But if command line parameter -w is used and it is not located as first (at least before parameters -a and -m) on command line, file ${VM_FILE} (used by -a and -m parameters) will be located in different location than what the value of -w parameter defines. I have made modification for this in my fork of ghettoVCB.

syntax error in ghettoVCB.sh script

/vmfs/volumes/b0e7723c-8167fac7/ghettoVCB # sh ghettoVCB-master/ghettoVCB.sh --help
ghettoVCB-master/ghettoVCB.sh: line 836: syntax error: Bad substitution

I changed locally bad brackets to
if [[ "${PROBLEM_VMS}/${VM_NAME}" != "${PROBLEM_VMS}" ]] ; then
but I do not know if this is expected, or the fix is more complex.

Tadeusz

Independent disk error

Hi,

I recive errors when backing up VM having some independent disks, ie:

2013-03-21 07:54:55 -- info: WARN: VirualMachineToBeBackedUp has some Independent VMDKs that can not be backed up!

2013-03-21 07:54:58 -- info: ###### Final status: ERROR: No VMs backed up! ######

2013-03-21 07:54:58 -- info: ============================== ghettoVCB LOG END ================================

The fact that independent disks are not backed up is fine - that's why i've made them indepentend.
What is more, despite error, backups seem to be OK (have not tryed restore yet, but disks that are supposed to be backed up have legit sizes). In previous versions of ghettoVCB there was warning, not an error (especially saying that no VM's have been backed up) . Could you please have a look at the issue?

Thanks in advance!

L.

VMDK on different datastore not found - ghettoVCB not honoring fileSearchPath in .vmx

We have a VM with two disks, one in the VM directory, one in a different datastore. In the vmx the disk file names are not stored with their full path, but the paths are set in the fileSearchPath variable.

ghettoVCB can only backup the VMDK in the VM directory.

Here the relevant lines from the .vmx file:

scsi0:0.fileName = "uranus ST2008.64.R2.vmdk"
scsi0:2.fileName = "uranus ST2008.64.R2_2.vmdk"
fileSearchPath = "/vmfs/volumes/5144d529-e22c7624-dff7-001517919b4e/uranus;."

I can enter the full path as the scsi0:2.fileName and do a backup, but the next time I try to do a backup, the full path already has been overwritten by the system again.

VM does not boot

This is just info burst in case somebody else happens to wonder what the problem is in this case...

In case you have shutdown VM before ghettoVCB starts taking backup of VM, you can not start up VM until backup of ghettoVCB has finished. You will get error something like this in case you try to restart VM during backup:

An error was received from the ESX host while powering on VM <vmname>. Failed to start the virtual machine. Module DiskEarly power on failed. Cannot open the disk '/vmfs/volumes/<volume-uid>/<vmname>/<vmname>.vmdk' or one of the snapshot disks it depends on. Failed to lock the file

typo in output text on line 887

In the code block:

        if [[ ${HAS_INDEPENDENT_DISKS} -eq 1 ]] ; then
            logger "dryrun" "Snapshots can not be taken for indepdenent disks!"
            logger "dryrun" "THIS VIRTUAL MACHINE WILL NOT HAVE ALL ITS VMDKS BACKED UP!"
        fi

independent is spelled indepdenent

esxi 6.0 support

ghettoVCB is a really good piece of work! It has been quite usefull for us on esxi 5.5. Thanks for the great work!

Is ghettoVCB going to support esxi 6.0 as well?

this ticket actually seems like it does already support 6.0... #54

It's just that the documentation does not mention it anywhere. Is it safe to use yet?

Issue running on ESXi 3.5

I've been running ghettoVCB for a while now and it has been working great. I just updated to the latest version and found that on my 1 ESXi 3.5 host the script would fail with the error - "You're not running ESX(i) 3.5, 4.x, 5.x!".

I found by changing following line, the issue was resolved

 ESX_VERSION=$(vmware -v | awk '{print $3}')

to

 ESX_VERSION=$(vmware -v | awk '{print $4}')

The vmware version info comes back as the following on my host:

 ~ # vmware -v
 VMware ESX Server 3i 3.5.0 build-207095
 ~ # vmware -v | awk '{print $3}'
 Server
 ~ # vmware -v | awk '{print $4}'
 3i

unexpected "Insufficient arguments." message in log

I get this at the beginning of the log

Logging output to "/tmp/ghettoVCB-2013-01-22_02-18-49-1761146.log" ...
Insufficient arguments.
2013-01-22 02:18:50 -- info: ============================== ghettoVCB LOG START ==============================

This is around line 271 in ghettovcb.sh, I have moved the "2>&1" part to update the line from this :

${VMWARE_CMD} vmsvc/snapshot.remove | grep "snapshotId" > /dev/null 2>&1

into this one

${VMWARE_CMD} vmsvc/snapshot.remove 2>&1 | grep "snapshotId" > /dev/null

The message is gone

Restore vm with spaces in display name

After restore an vm with ghetto-restore, the vm is registered but cant be started, configured, etc. Also, in the datastore browse the option "Add to inventory" is disabled.
Comparing the restored .vmx file with the original, the line displayName dont contain quotes:
displayName = Example Machine
So putting quotes between machine name solved the problem:
displayName = "Example Machine"

ghettoVCB-restore: support non persistent nfs

Hi,
it would be nice if ghettoVCB-restore would also support non persistent nfs stores the way ghettoVCB does. In the restore file you could enter a symbolical path like "[NFS]/$vm/$vm-$date" and ghettoVCB would find the correct vm to restore.

Cheres,
Nicki

Syntax error (fix included)

pohl@dv123:~/tmp/ghettoVCB$ ./ghettoVCB.sh 
./ghettoVCB.sh: Zeile 1326: Syntaxfehler im bedingten Ausdruck: Unerwartetes Zeichen `;'.
./ghettoVCB.sh: Zeile 1326: Syntaxfehler beim unerwarteten Wort `;'
./ghettoVCB.sh: Zeile 1326: `    if [[ "${EMAIL_LOG}" -eq 1 ]] || [[ "${EMAIL_ALERT}" -eq 1]] ; then'

pohl@dv123:~/tmp/ghettoVCB$ git diff ghettoVCB.sh
diff --git a/ghettoVCB.sh b/ghettoVCB.sh
index f641500..fbf4f2a 100755
--- a/ghettoVCB.sh
+++ b/ghettoVCB.sh
@@ -1323,7 +1323,7 @@ buildHeaders() {

 sendMail() {
     #close email message
-    if [[ "${EMAIL_LOG}" -eq 1 ]] || [[ "${EMAIL_ALERT}" -eq 1]] ; then
+    if [ "${EMAIL_LOG}" -eq 1 ] || [ "${EMAIL_ALERT}" -eq 1] ; then
         SMTP=1
         #validate firewall has email port open for ESXi 5
         if [[ "${VER}" == "5" ]] || [[ "${VER}" == "6" ]] ; then

ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP

I use the allow vms with snapshots to be backedup.
The issue is: this results in deleting all the existing snapshots during the backup.
How can i prevent this from happening? We use the snapshots for bug historie etc.

Can't install VIB - failed to validate content

Hi there!
I've 2 free HP esxi 5.5 servers. On the main one I installed months ago ghettoVCB with the old method.
Now I tried to install the VIB in the second server, but i get this error:

VIB virtuallyGhetto_bootbank_ghettoVCB_1.0.0-0.0.0 violates extensibility rule checks: [u'(line 23: col 0) Element vib failed to validate content']

Is there a solution? Otherwise I'll proceed installing with the zip files as usual.
Thank you in advance!

No config option for VM_BACKUP_DIR_NAMING_CONVENTION

It's currently not possible to set the backup dir naming convention. Personally I'm more in favour of having this handled externally anyway, but at least permitting an override would be nice. This also interferes with the current approach to finding and deleting older backups, so this might work best in a non-rotated fashion.

My OmniOS (Solaris Based) VM is not getting backed up

My other VM's are getting backed up with ghettoVCB without any issues. This includes 2 Ubuntu 12.04 Servers and a CentOS machine. However, my OmniOS device won't backup. There are no errors, and ghettoVCB stops at this line:

Creating Snapshot "ghettoVCB-snapshot-2013-07-26" for OmniOS

If I run a dryrun it says it completes successfully. Any ideas on what the issue could be? Some sort of setting within my VM maybe? Here's the log when I tried to backup OmniOS:

2013-07-26 20:17:44 -- info: ============================== ghettoVCB LOG START ==============================

2013-07-26 20:17:44 -- info: CONFIG - VERSION = 2013_01_11_0
2013-07-26 20:17:44 -- info: CONFIG - GHETTOVCB_PID = 6134
2013-07-26 20:17:44 -- info: CONFIG - VM_BACKUP_VOLUME = /vmfs/volumes/backups
2013-07-26 20:17:44 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT = 2
2013-07-26 20:17:44 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2013-07-26_20-17-43
2013-07-26 20:17:44 -- info: CONFIG - DISK_BACKUP_FORMAT = thin
2013-07-26 20:17:44 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP = 0
2013-07-26 20:17:44 -- info: CONFIG - ENABLE_HARD_POWER_OFF = 0
2013-07-26 20:17:44 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN = 3
2013-07-26 20:17:44 -- info: CONFIG - POWER_DOWN_TIMEOUT = 5
2013-07-26 20:17:44 -- info: CONFIG - SNAPSHOT_TIMEOUT = 15
2013-07-26 20:17:44 -- info: CONFIG - LOG_LEVEL = info
2013-07-26 20:17:44 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2013-07-26_20-17-43-6134.log
2013-07-26 20:17:44 -- info: CONFIG - ENABLE_COMPRESSION = 0
2013-07-26 20:17:44 -- info: CONFIG - VM_SNAPSHOT_MEMORY = 0
2013-07-26 20:17:44 -- info: CONFIG - VM_SNAPSHOT_QUIESCE = 0
2013-07-26 20:17:44 -- info: CONFIG - ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP = 0
2013-07-26 20:17:44 -- info: CONFIG - VMDK_FILES_TO_BACKUP = all
2013-07-26 20:17:44 -- info: CONFIG - VM_SHUTDOWN_ORDER =
2013-07-26 20:17:44 -- info: CONFIG - VM_STARTUP_ORDER =
2013-07-26 20:17:44 -- info: CONFIG - EMAIL_LOG = 0
2013-07-26 20:17:44 -- info:
2013-07-26 20:17:47 -- info: Initiate backup for OmniOS
2013-07-26 20:17:47 -- info: Creating Snapshot "ghettoVCB-snapshot-2013-07-26" for OmniOS

Independent VMDKs that can not be backed up!

Hi,

I use "GettoVCB" for many years. It works very well, thank you.
Now ioch would like to use some VM's Independent Disks.
The problem is, I get the following error messages.

ghettoVCB - 180 ###### Final status: ERROR: No VMs backed up! ######

2015-01-12 13:32:19 -- info: ###### Final status: ERROR: No VMs backed up! ######

2015-01-12 13:32:19 -- info: = ghettoVCB LOG END =

how can I create a backup with independent disks?
What should I set this to work.

The data have been backed up, only the messages in the log with error.

Thanks for the support

Function sendMail: useless variable EMAIL_ALERT, unnecessary update of LOG_STATUS

  1. To me it seems like variable EMAIL_ALERT is obsolate because there already is variable EMAIL_LOG to determine if email should be sent or not, so it would be better to remove it to avoid duplicates. If variable EMAIL_ALERT will be kept in code, it should be set "EMAIL_ALERT=0" also at row 288 where command for email sending is checked.
  2. I think it is not good idea to manipulate value of variable LOG_STATUS outside function getFinalSatus in sendMail function. This makes things just more complicated in long run and does not provide any benefits. Processing value of variable EMAIL_ERRORS_TO works just fine even when line LOG_STATUS="ERROR" is removed (=comment out lines 1340,1341 and 1350 or remove whole block at lines 1340-1350).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.