### Example Build Script Output Source: https://github.com/lamw/ghettovcb/blob/master/build/README.md This is an example output from running the ./build.sh script, showing the Docker build process and package updates. ```text ❯ ./build.sh Untagged: ghettovcb:latest Deleted: sha256:4961ac02e829aa3d71401565027e395f254b4a220570333b9deebd588d5bd8b0 Deleted: sha256:b2203f902261eee689c7cd066fed48687fe1dcbf72bf5c337f3e878b759b221a Deleted: sha256:5cd0340cce143df29664f5b095bafbe993e57b4fb7f7cb41c9f43b1fe36fd6fc Deleted: sha256:cd201ab3ba5c8a3bd20ed924fb67600c164d0950416630107303da6090c16c5c Deleted: sha256:085f155aaa2fcccc938ab899675ed05f6712f33a212f5015e7029e255ff85d53 Deleted: sha256:3f435a105eaf07a4f931b9e5438b4f753d12e4dbeb99aa30726f662c03a5ad3a Deleted: sha256:47227020e006eea1af0f5061ee277402bbd96a49ccb3f5c9e7c5fd5e1f456cf8 Sending build context to Docker daemon 9.728kB Step 1/8 : FROM lamw/vibauthor ---> a673ffe4ba43 Step 2/8 : RUN rpm --rebuilddb ---> Running in 894b1e52ce30 Removing intermediate container 894b1e52ce30 ---> e105a98f75ef Step 3/8 : RUN yum clean all ---> Running in 5418e2b59881 Loaded plugins: fastestmirror, ovl Cleaning repos: base extras updates Cleaning up Everything Removing intermediate container 5418e2b59881 ---> 1710944fd26b Step 4/8 : RUN yum update -y nss curl libcurl;yum clean all ---> Running in ab7ac3f661c4 Loaded plugins: fastestmirror, ovl Setting up Update Process Determining fastest mirrors Resolving Dependencies --> Running transaction check ---> Package curl.x86_64 0:7.19.7-53.el6_9 will be updated ---> Package curl.x86_64 0:7.19.7-54.el6_10 will be an update ---> Package libcurl.x86_64 0:7.19.7-53.el6_9 will be updated ---> Package libcurl.x86_64 0:7.19.7-54.el6_10 will be an update ---> Package nss.x86_64 0:3.36.0-8.el6 will be updated --> Processing Dependency: nss = 3.36.0-8.el6 for package: nss-sysinit-3.36.0-8.el6.x86_64 --> Processing Dependency: nss(x86-64) = 3.36.0-8.el6 for package: nss-tools-3.36.0-8.el6.x86_64 ---> Package nss.x86_64 0:3.44.0-7.el6_10 will be an update --> Processing Dependency: nss-softokn(x86-64) >= 3.44.0-1 for package: nss-3.44.0-7.el6_10.x86_64 --> Running transaction check ---> Package nss-softokn.x86_64 0:3.14.3-23.3.el6_8 will be updated ---> Package nss-softokn.x86_64 0:3.44.0-6.el6_10 will be an update ---> Package nss-sysinit.x86_64 0:3.36.0-8.el6 will be updated ---> Package nss-sysinit.x86_64 0:3.44.0-7.el6_10 will be an update ---> Package nss-tools.x86_64 0:3.36.0-8.el6 will be updated ---> Package nss-tools.x86_64 0:3.44.0-7.el6_10 will be an update --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Updating: curl x86_64 7.19.7-54.el6_10 updates 198 k libcurl x86_64 7.19.7-54.el6_10 updates 170 k nss x86_64 3.44.0-7.el6_10 updates 883 k Updating for dependencies: nss-softokn x86_64 3.44.0-6.el6_10 updates 288 k nss-sysinit x86_64 3.44.0-7.el6_10 updates 54 k nss-tools x86_64 3.44.0-7.el6_10 updates 472 k Transaction Summary ================================================================================ Upgrade 6 Package(s) Total download size: 2.0 M Downloading Packages: -------------------------------------------------------------------------------- Total 12 MB/s | 2.0 MB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Updating : nss-softokn-3.44.0-6.el6_10.x86_64 1/12 Updating : nss-sysinit-3.44.0-7.el6_10.x86_64 2/12 Updating : nss-3.44.0-7.el6_10.x86_64 3/12 Updating : libcurl-7.19.7-54.el6_10.x86_64 4/12 Updating : curl-7.19.7-54.el6_10.x86_64 5/12 Updating : nss-tools-3.44.0-7.el6_10.x86_64 6/12 Cleanup : nss-tools-3.36.0-8.el6.x86_64 7/12 Cleanup : curl-7.19.7-53.el6_9.x86_64 8/12 ``` -------------------------------- ### Example rc.local Content with ghettoVCB Cronjob Source: https://github.com/lamw/ghettovcb/blob/master/README.md This is an example of how `/etc/rc.local` should look after adding the ghettoVCB cronjob entry for persistence. ```console ~ # 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 ``` -------------------------------- ### Sample VM List File Content Source: https://github.com/lamw/ghettovcb/blob/master/README.md This is an example of the content for the 'vms_to_backup' file, where each line specifies a virtual machine's display name. ```console [root@himalaya ~]# cat vms_to_backup vCOPS vMA vCloudConnector ``` -------------------------------- ### Install VIB for ESXi 8.x and later Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to install the ghettoVCB VIB on ESXi versions 8.x and later. The -f flag forces the installation. ```bash esxcli software vib install -v /vghetto-ghettoVCB-8x.vib -f ``` -------------------------------- ### Define VM Startup Order Source: https://github.com/lamw/ghettovcb/blob/master/README.md Specifies the order in which VMs should be started up after backups are completed, useful for managing dependencies. This should be a comma-separated list of VM names. ```console VM_STARTUP_ORDER=vm3,vm2,vm1 ``` -------------------------------- ### Install Offline Bundle for ESXi 7.x Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to install the ghettoVCB offline bundle on ESXi version 7.x. The -f flag forces the installation. ```bash esxcli software vib install -d /vghetto-ghettoVCB-offline-bundle-7x.zip -f ``` -------------------------------- ### Install VIB for ESXi 5.x to 6.x Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to install the ghettoVCB VIB on ESXi versions 5.x through 6.x. The -f flag forces the installation. ```bash esxcli software vib install -v /vghetto-ghettoVCB-7x.vib -f ``` -------------------------------- ### Install Offline Bundle for ESXi 8.x and later Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to install the ghettoVCB offline bundle on ESXi versions 8.x and later. The -f flag forces the installation. ```bash esxcli software vib install -d /vghetto-ghettoVCB-offline-bundle-8x.zip -f ``` -------------------------------- ### Example RSYNC Symbolic Link Source: https://github.com/lamw/ghettovcb/blob/master/README.md Demonstrates the output of an RSYNC symbolic link created for VM backups. This link references the latest successful VM backup. ```console [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 ``` -------------------------------- ### Verifying Cron Job Installation Source: https://github.com/lamw/ghettovcb/blob/master/README.md Lists the current cron jobs for the root user to verify that the new entry has been successfully installed. This confirms the scheduled backup is configured. ```bash [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 ``` -------------------------------- ### GhettoVCB Backup Command Example Source: https://github.com/lamw/ghettovcb/blob/master/README.md This command initiates a backup of a virtual machine's VMDK file using vmkfstools. It specifies the source and destination paths, disk format (thin-provisioned), and adapter type. Use this to understand the underlying command executed for VMDK backups. ```bash /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" ``` -------------------------------- ### Configure Backup Policy for 'vCloudConnector' Source: https://github.com/lamw/ghettovcb/blob/master/README.md Defines a backup policy for the 'vCloudConnector' VM, backing up all VMDKs found. This example specifies a single VMDK to be backed up. ```bash [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" ``` -------------------------------- ### Basic Cron Job for ghettoVCB Backup Source: https://github.com/lamw/ghettovcb/blob/master/README.md Example of a cron job entry to run ghettoVCB backup daily, redirecting output to /dev/null. Ensure full paths are used for scripts and files. ```console 0 0 * * 1-5 /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/ghettoVCB.sh -f /vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/backuplist > /dev/null ``` -------------------------------- ### Configure Backup Policy for 'scofield' Source: https://github.com/lamw/ghettovcb/blob/master/README.md Defines a backup policy for the 'scofield' VM, specifying which VMDK files to back up. This example backs up two specific VMDKs. ```bash [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" ``` -------------------------------- ### GhettoVCB Restore Dryrun Debug Info Source: https://github.com/lamw/ghettovcb/blob/master/README.md Example of how to perform a dryrun of the restore process to display debug information without actually performing the restore operation. ```console # Display debug information level 1: ``` -------------------------------- ### Retrieve ghettoVCB Installation for ESXi 5.x to 6.x Source: https://github.com/lamw/ghettovcb/blob/master/README.md This command retrieves information about the installed ghettoVCB VIB on ESXi versions 5.x through 6.x. ```bash esxcli software vib get -n ghettoVCB ``` -------------------------------- ### Cron Job for ghettoVCB Backup with Log File Source: https://github.com/lamw/ghettovcb/blob/master/README.md Example of a cron job entry to run ghettoVCB backup daily, redirecting output to a specified log file. This is useful for monitoring backup processes. ```console 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 ``` -------------------------------- ### Extracting ghettoVCB Archive Source: https://github.com/lamw/ghettovcb/wiki/Home This command shows how to extract the ghettoVCB script files after downloading the archive. Ensure you have the unzip utility installed. ```bash # unzip ghettoVCB-master.zip Archive: ghettoVCB-master.zip creating: ghettoVCB-master/ inflating: ghettoVCB-master/README inflating: ghettoVCB-master/ghettoVCB-restore.sh inflating: ghettoVCB-master/ghettoVCB-restore_vm_restore_configuration_template inflating: ghettoVCB-master/ghettoVCB-vm_backup_configuration_template inflating: ghettoVCB-master/ghettoVCB.conf inflating: ghettoVCB-master/ghettoVCB.sh ``` -------------------------------- ### Allow Backups of VMs with Existing Snapshots Source: https://github.com/lamw/ghettovcb/blob/master/README.md Determines if VMs with existing snapshots can be backed up. If enabled (1), all existing snapshots will be consolidated before the backup starts. If disabled (0), backups will not proceed for VMs with snapshots. ```console ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=0 ``` -------------------------------- ### Update Offline Bundle for ESXi 7.x Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to update an existing ghettoVCB offline bundle installation on ESXi version 7.x. The -f flag forces the update. ```bash esxcli software vib update -d /vghetto-ghettoVCB-offline-bundle-7x.zip -f ``` -------------------------------- ### Sample GhettoVCB Configuration Source: https://github.com/lamw/ghettovcb/blob/master/README.md A sample global ghettoVCB configuration file demonstrating various backup and environment settings. ```shell # 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_TO=auroa@primp-industries.com EMAIL_FROM=root@ghettoVCB WORKDIR_DEBUG=0 VM_SHUTDOWN_ORDER= VM_STARTUP_ORDER= ``` -------------------------------- ### GhettoVCB Restore Script with Custom Input File Source: https://github.com/lamw/ghettovcb/blob/master/README.md Demonstrates how to use a custom input file to specify VM restore configurations. The input file contains paths to backups, destination datastores, disk formats, and optional VM names. ```bash 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" ``` ```bash /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore ``` -------------------------------- ### Initiate ESXi Configuration Backup Source: https://github.com/lamw/ghettovcb/blob/master/README.md Manually run the auto-backup script to save the current ESXi configuration. ```console ~ # /sbin/auto-backup.sh ``` -------------------------------- ### Enable Hard Power Off Source: https://github.com/lamw/ghettovcb/blob/master/README.md Determines if a hard power off is enabled when POWER_VM_DOWN_BEFORE_BACKUP is active and VMware Tools are not installed. ```console ENABLE_HARD_POWER_OFF=0 ``` -------------------------------- ### Running ghettoVCB Script Source: https://github.com/lamw/ghettovcb/wiki/Home This is the basic command to initiate the ghettoVCB backup script. Ensure you have configured the necessary settings in ghettoVCB.conf. ```bash ./ghettoVCB.sh ``` -------------------------------- ### GhettoVCB Backup Execution Log - Partial Configuration Source: https://github.com/lamw/ghettovcb/blob/master/README.md A sample log output showing configuration parameters loaded during a GhettoVCB backup execution. This snippet demonstrates the loaded configuration values. ```log 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 ``` -------------------------------- ### Create Backup Configuration Directory Source: https://github.com/lamw/ghettovcb/blob/master/README.md Creates a directory to store individual VM backup policy files. This is the first step in organizing custom backup settings. ```bash [root@himalaya ~]# mkdir backup_config ``` -------------------------------- ### Docker Build Output Source: https://github.com/lamw/ghettovcb/blob/master/build/README.md This output shows the steps involved in building a Docker image, including package cleanup, verification, and copying build scripts. It culminates in the successful creation of the ghettoVCB image. ```bash Cleanup : libcurl-7.19.7-53.el6_9.x86_64 9/12 Cleanup : nss-sysinit-3.36.0-8.el6.x86_64 10/12 Cleanup : nss-3.36.0-8.el6.x86_64 11/12 Cleanup : nss-softokn-3.14.3-23.3.el6_8.x86_64 12/12 Verifying : curl-7.19.7-54.el6_10.x86_64 1/12 Verifying : libcurl-7.19.7-54.el6_10.x86_64 2/12 Verifying : nss-softokn-3.44.0-6.el6_10.x86_64 3/12 Verifying : nss-tools-3.44.0-7.el6_10.x86_64 4/12 Verifying : nss-sysinit-3.44.0-7.el6_10.x86_64 5/12 Verifying : nss-3.44.0-7.el6_10.x86_64 6/12 Verifying : nss-softokn-3.14.3-23.3.el6_8.x86_64 7/12 Verifying : nss-3.36.0-8.el6.x86_64 8/12 Verifying : nss-sysinit-3.36.0-8.el6.x86_64 9/12 Verifying : libcurl-7.19.7-53.el6_9.x86_64 10/12 Verifying : curl-7.19.7-53.el6_9.x86_64 11/12 Verifying : nss-tools-3.36.0-8.el6.x86_64 12/12 Updated: curl.x86_64 0:7.19.7-54.el6_10 libcurl.x86_64 0:7.19.7-54.el6_10 nss.x86_64 0:3.44.0-7.el6_10 Dependency Updated: nss-softokn.x86_64 0:3.44.0-6.el6_10 nss-sysinit.x86_64 0:3.44.0-7.el6_10 nss-tools.x86_64 0:3.44.0-7.el6_10 Complete! Loaded plugins: fastestmirror, ovl Cleaning repos: base extras updates Cleaning up Everything Cleaning up list of fastest mirrors Removing intermediate container ab7ac3f661c4 ---> 5690d9c8f3b0 Step 5/8 : COPY create_ghettoVCB_vib.sh create_ghettoVCB_vib.sh ---> 41528c8b4a87 Step 6/8 : RUN chmod +x create_ghettoVCB_vib.sh ---> Running in 1ae6b4f7a749 Removing intermediate container 1ae6b4f7a749 ---> c10f6341e862 Step 7/8 : RUN /root/create_ghettoVCB_vib.sh ---> Running in bd605bcc5442 Initialized empty Git repository in /root/ghettoVCB/.git/ Successfully created vghetto-ghettoVCB.vib. Successfully created vghetto-ghettoVCB-offline-bundle.zip. Removing intermediate container bd605bcc5442 ---> 7d64d39dea4d Step 8/8 : CMD ["/bin/bash"] ---> Running in 043692b22cde Removing intermediate container 043692b22cde ---> 7e1196135f15 Successfully built 7e1196135f15 Successfully tagged ghettovcb:latest ``` -------------------------------- ### Update VIB for ESXi 8.x and later Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to update an existing ghettoVCB VIB installation on ESXi versions 8.x and later. The -f flag forces the update. ```bash esxcli software vib update -v /vghetto-ghettoVCB-8x.vib -f ``` -------------------------------- ### Update VIB for ESXi 5.x to 6.x Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to update an existing ghettoVCB VIB installation on ESXi versions 5.x through 6.x. The -f flag forces the update. ```bash esxcli software vib update -v /vghetto-ghettoVCB-7x.vib -f ``` -------------------------------- ### Execute GhettoVCB Backup with Individual Policies Source: https://github.com/lamw/ghettovcb/blob/master/README.md Executes the GhettoVCB backup process using a list of VMs to back up and a directory containing individual VM backup policies. Logs are directed to a specified file. ```bash [root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -c backup_config -l /tmp/ghettoVCB.log ``` -------------------------------- ### Update Offline Bundle for ESXi 8.x and later Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to update an existing ghettoVCB offline bundle installation on ESXi versions 8.x and later. The -f flag forces the update. ```bash esxcli software vib update -d /vghetto-ghettoVCB-offline-bundle-8x.zip -f ``` -------------------------------- ### Backup VMs Using Global Configuration File Source: https://github.com/lamw/ghettovcb/blob/master/README.md Utilizes a global ghettoVCB configuration file for backing up VMs listed in a file. ```bash /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -g /global/ghettoVCB.conf ``` -------------------------------- ### List VM Backup Policies Source: https://github.com/lamw/ghettovcb/blob/master/README.md Lists the VM backup policy files within the created backup configuration directory. This helps verify that policies have been correctly copied. ```bash [root@himalaya backup_config]# ls ghettoVCB-vm_backup_configuration_template scofield vCloudConnector ``` -------------------------------- ### Run ghettoVCB Build Script Source: https://github.com/lamw/ghettovcb/blob/master/build/README.md Execute the build.sh script to generate the VIB and Offline Bundle. This process utilizes a Docker container to perform the build steps. ```shell #!/bin/bash # Exit immediately if a command exits with a non-zero status. set -e # Define variables export GH_REPO="lamw/ghettoVCB" export GH_BRANCH="master" export VIB_NAME="ghettoVCB" export OFFLINE_BUNDLE_NAME="ghettoVCB" # Check if docker is installed if ! command -v docker &> /dev/null then echo "Docker is not installed. Please install Docker to build the VIB/Offline Bundle." exit 1 fi # Check if the build directory exists, if not create it if [ ! -d "build" ] then mkdir build fi # Pull the latest vibauthor image echo "Pulling the latest vibauthor image..." docker pull lamw/vibauthor # Build the VIB and Offline Bundle echo "Building the VIB and Offline Bundle..." docker run --rm -v $(pwd)/build:/build -e GH_REPO=${GH_REPO} -e GH_BRANCH=${GH_BRANCH} -e VIB_NAME=${VIB_NAME} -e OFFLINE_BUNDLE_NAME=${OFFLINE_BUNDLE_NAME} lamw/vibauthor echo "Build complete. VIB and Offline Bundle are located in the build/ directory." ``` -------------------------------- ### GhettoVCB Restore Script Usage Source: https://github.com/lamw/ghettovcb/blob/master/README.md Displays the command-line options and usage for the ghettoVCB-restore.sh script. Use this to understand how to initiate a restore operation. ```console [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 ``` -------------------------------- ### GhettoVCB Restore Script Basic Usage Source: https://github.com/lamw/ghettovcb/blob/master/README.md This is the basic command to initiate a VM restore using a list of VMs to restore. The script reads VM configurations from the specified file. ```bash /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore -d 1 ``` -------------------------------- ### Define Backup Datastore and Folder Source: https://github.com/lamw/ghettovcb/blob/master/README.md Specifies the datastore and folder for storing VM backups. The folder will be created if it doesn't exist. ```console VM_BACKUP_VOLUME=/vmfs/volumes/dlgCore-NFS-bigboi.VM-Backups/WILLIAM_BACKUPS ``` -------------------------------- ### Backup VMs with Custom Log File Path Source: https://github.com/lamw/ghettovcb/blob/master/README.md Outputs backup logs to a specified file path. Consider using a persistent datastore for logs. ```bash /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup -l /vmfs/volume/local-storage/ghettoVCB.log ``` -------------------------------- ### Backup VMs from a List Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to back up virtual machines specified in a text file. Ensure the file contains one VM name per line. ```bash [root@himalaya ~]# /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup ``` -------------------------------- ### Backup All VMs on Host Source: https://github.com/lamw/ghettovcb/blob/master/README.md This command initiates a backup of all virtual machines residing on the current host. ```bash /opt/ghettovcb/bin/ghettoVCB.sh -a ``` -------------------------------- ### Specify VMDK Files to Backup Source: https://github.com/lamw/ghettovcb/blob/master/README.md Defines which VMDK files from a VM should be backed up. Can be a list of specific VMDK names or 'all'. ```console VMDK_FILES_TO_BACKUP="myvmdk.vmdk" ``` -------------------------------- ### Execute ghettoVCB-restore.sh with logging Source: https://github.com/lamw/ghettovcb/blob/master/README.md This command executes the ghettoVCB-restore.sh script to restore VMs and directs all output to a specified log file. This is useful for capturing detailed information about the restore process. ```bash # /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore -d 1 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 ``` ```console [root@himalaya ~]# ./ghettoVCB-restore.sh -c vms_to_restore -l /tmp/ghettoVCB-restore.log Logging output to "/tmp/ghettoVCB-restore.log" ... ``` -------------------------------- ### GhettoVCB Backup Execution Log - 'scofield' Source: https://github.com/lamw/ghettovcb/blob/master/README.md A sample log output from a GhettoVCB backup execution for the 'scofield' VM, showing configuration details and the cloning process for its VMDKs. ```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! ``` -------------------------------- ### Backup List of VMs from a File Source: https://github.com/lamw/ghettovcb/blob/master/README.md Use this command to back up multiple VMs listed in a file. An optional job name can be provided for email report subjects. ```bash /opt/ghettovcb/bin/ghettoVCB.sh -f vms_to_backup [ -j myJob ] ``` -------------------------------- ### Enable Email Backup Logs Source: https://github.com/lamw/ghettovcb/blob/master/README.md Set to '1' to enable sending backup logs via email. Ensure vSphere 4.0 or later is used. ```console EMAIL_LOG=1 ``` -------------------------------- ### Check ESXi Host Date and Time Source: https://github.com/lamw/ghettovcb/blob/master/README.md Verify the current date and time settings on your ESXi host using the 'date' command. ```console [root@himalaya dlgCore-NFS-bigboi.VM-Backups]# date Fri Aug 14 23:44:47 PDT 2009 ```