ghettoVCB: Backups now failing when using VMDK_FILES_TO_BACKUP

It looks like recently PR #198 was merged in. I wonder how throughly this was tested, as I now have multiple VMs failing that used to backup just fine before.

Here is a snippet from the log:

...
2021-01-08 00:30:12 -- info: CONFIG - VMDK_FILES_TO_BACKUP = Disk-0.vmdk
...
2021-01-08 00:30:15 -- debug: 
2021-01-08 00:30:15 -- debug: getVMDKs() - Disk-2.vmdk###250:Disk-0.vmdk###32:
2021-01-08 00:30:15 -- info: WARNING: Disk-0.vmdk not found in VMDKs for MonoVM
2021-01-08 00:30:15 -- info: ERROR: No valid VMDKs in list of VMDKs to backup for MonoVM
2021-01-08 00:30:15 -- info: ERROR: Failed to backup MonoVM!

2021-01-08 00:30:15 -- debug: VM_OK:0, VM_FAILED:1, VMDK_FAILED:0
2021-01-08 00:30:15 -- info: ###### Final status: ERROR: All VMs failed! ######

It looks like the call to getVMDKs returns a colon separated string:

https://github.com/lamw/ghettoVCB/blob/42b119f9dad9f08109c581de6efe9e785e91287a/ghettoVCB.sh#L500

But in the new function to iterate over this to check, there is no code that attempts to loop over this colon, but rather it is looking for a “,”:

https://github.com/lamw/ghettoVCB/blob/42b119f9dad9f08109c581de6efe9e785e91287a/ghettoVCB.sh#L1127-L1131

I am not sure how this is supposed to work at all.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Folks - Has anyone who experience this particular issue been able to verify the fixed put forth by @NotAProfessionalDeveloper?

Can verify it works. Had the same issue this week after rebuilding our esxi. Backup only worked when just one vmdk was present in the $VMDKS as the list wasn’t properly separated.

Tested on two VMs.

It worked with your suggestion. I also tried it with the system generated symlink (for the datastore name) and that did not work. Is there going to be any fix for using the symlink or not having to use the full path? Otherwise, I’m sure to forget to change this when the VMDKs get moved.

thx for your help

On Sat, Aug 7, 2021 at 2:40 AM DAN @.***> wrote:

2021_07_09 still does not work for me. If I specify 2 of 3 vmdk’s to backup in VMDK_FILES_TO_BACKUP, it only backs up the vmdk that is stored on the physical disk that is hosting the VM. So in this case it successfully backs up vmdks on Disk 1 but not on 551389f0-e395abae-ad2f-00e081ce99bd Scenario VM with 3 disks. Disk 1 is the same disk that hosts the VM. … <#m_565234830204327472_> –Physical disk 1: ls /vmfs/volumes/disk1/EmergencyVM2/ *.vmdk /vmfs/volumes/disk1/EmergencyVM2/EmergencyVM2_1-flat.vmdk /vmfs/volumes/disk1/EmergencyVM2/EmergencyVM2_2-flat.vmdk /vmfs/volumes/disk1/EmergencyVM2/EmergencyVM2_1.vmdk /vmfs/volumes/disk1/EmergencyVM2/EmergencyVM2_2.vmdk --Physical disk 2: ls /vmfs/volumes/551389f0-e395abae-ad2f-00e081ce99bd/EmergencyVM2/EmergencyVM2.vmdk /vmfs/volumes/551389f0-e395abae-ad2f-00e081ce99bd/EmergencyVM2/EmergencyVM2.vmdk ghettovcb.sh and the VM backup config file are located on physical disk 1): VMDK_FILES_TO_BACKUP=“EmergencyVM2_2.vmdk”,“EmergencyVM2.vmdk” Results: 2021-08-07 03:49:07 – info: CONFIG - VMDK_FILES_TO_BACKUP = EmergencyVM2_2.vmdk,EmergencyVM2.vmdk 2021-08-07 03:49:07 – info: CONFIG - VM_SHUTDOWN_ORDER = 2021-08-07 03:49:07 – info: CONFIG - VM_STARTUP_ORDER = 2021-08-07 03:49:07 – info: CONFIG - RSYNC_LINK = 0 2021-08-07 03:49:07 – info: CONFIG - BACKUP_FILES_CHMOD = 2021-08-07 03:49:07 – info: CONFIG

  • EMAIL_LOG = 1 2021-08-07 03:49:07 – info: CONFIG - EMAIL_SERVER = xxxxx 2021-08-07 03:49:07 – info: CONFIG - EMAIL_SERVER_PORT = 25 2021-08-07 03:49:07 – info: CONFIG - EMAIL_DELAY_INTERVAL = 1 2021-08-07 03:49:07 – info: CONFIG - EMAIL_FROM = @.*** 2021-08-07 03:49:07 – info: CONFIG - EMAIL_TO = xxxxx 2021-08-07 03:49:07 – info: CONFIG - WORKDIR_DEBUG = 0 2021-08-07 03:49:07 – info: CONFIG - ENABLE_NFS_IO_HACK = 0 2021-08-07 03:49:08 – debug: Storage Information before backup: 2021-08-07 03:49:08 – debug: SRC_DATASTORE: disk1 2021-08-07 03:49:08 – debug: SRC_DATASTORE_CAPACITY: 63488.0 7452.0 GB 2021-08-07 03:49:08 – debug: SRC_DATASTORE_FREE: 3061.9 GB 2021-08-07 03:49:08 – debug: SRC_DATASTORE_BLOCKSIZE: 1 2021-08-07 03:49:08 – debug: SRC_DATASTORE_MAX_FILE_SIZE: 256 GB 2021-08-07 03:49:08 – debug: 2021-08-07 03:49:08 – debug: DST_DATASTORE: disk1 2021-08-07 03:49:08 – debug: DST_DATASTORE_CAPACITY: 63488.0 7452.0 GB 2021-08-07 03:49:08 – debug: DST_DATASTORE_FREE: 3061.9 GB 2021-08-07 03:49:08 – debug: DST_DATASTORE_BLOCKSIZE: 1 2021-08-07 03:49:08 – debug: DST_DATASTORE_MAX_FILE_SIZE: 256 GB 2021-08-07 03:49:08 – debug: 2021-08-07 03:49:08 – debug: getVMDKs() - EmergencyVM2_2.vmdk###1 https://github.com/lamw/ghettoVCB/pull/1:EmergencyVM2_1.vmdk###20 https://github.com/lamw/ghettoVCB/issues/20 :/vmfs/volumes/551389f0-e395abae-ad2f-00e081ce99bd/EmergencyVM2/EmergencyVM2.vmdk## #20 https://github.com/lamw/ghettoVCB/issues/20: 2021-08-07 03:49:08 – info: WARNING: EmergencyVM2.vmdk not found in VMDKs for EmergencyVM2 2021-08-07 03:49:09 – info: Initiate backup for EmergencyVM2 2021-08-07 03:49:09 – info: Creating Snapshot “ghettoVCB-snapshot-2021-08-07” for EmergencyVM2 2021-08-07 03:49:10 – debug: Waiting for snapshot “ghettoVCB-snapshot-2021-08-07” to be created 2021-08-07 03:49:10 – debug: Snapshot timeout set to: 900 seconds 2021-08-07 03:49:10 – debug: findVMDK() - Searching for VMDK: “EmergencyVM2_2.vmdk” to backup 2021-08-07 03:49:10 – debug: findVMDK() - Found VMDK! - “EmergencyVM2_2.vmdk” to backup 2021-08-07 03:49:10 – debug: /sbin/vmkfstools -i “/vmfs/volumes/disk1/EmergencyVM2/EmergencyVM2_2.vmdk” -d thin “/vmfs/volumes/disk1/Backups/daily/EmergencyVM2/EmergencyVM2-2021-08-07_03-49-06/EmergencyVM2_2.vmdk” Destination disk format: VMFS thin-provisioned Cloning disk ‘/vmfs/volumes/disk1/EmergencyVM2/EmergencyVM2_2.vmdk’… Clone: 97% done. 2021-08-07 03:49:26 – debug: findVMDK() - Searching for VMDK: “EmergencyVM2_1.vmdk” to backup 2021-08-07 03:49:26 – debug: findVMDK() - Searching for VMDK: “/vmfs/volumes/551389f0-e395abae-ad2f-00e081ce99bd/EmergencyVM2/EmergencyVM2.vmdk” to backup 2021-08-07 03:49:31 – info: Removing snapshot from EmergencyVM2 … 2021-08-07 03:49:31 – debug: Removing /vmfs/volumes/disk1/Backups/daily/EmergencyVM2/EmergencyVM2-2021-08-07_03-24-45 2021-08-07 03:49:31 – info: Backup Duration: 22 Seconds 2021-08-07 03:49:31 – info: ERROR: Unable to backup EmergencyVM2 due to error in VMDK backup! 2021-08-07 03:49:31 – debug: VM_OK:0, VM_FAILED:0, VMDK_FAILED:1 2021-08-07 03:49:31 – info: ###### Final status: ERROR: All VMs experienced at least a partial failure! ###### 2021-08-07 03:49:31 – debug: Succesfully removed lock directory - /tmp/ghettoVCB.work 2021-08-07 03:49:31 – info: ============================== ghettoVCB LOG END ================================ thx scott On Fri, Jul 9, 2021 at 4:15 PM William Lam @.***> wrote: Closed #221 https://github.com/lamw/ghettoVCB/issues/221 <#221 https://github.com/lamw/ghettoVCB/issues/221> via #224 https://github.com/lamw/ghettoVCB/pull/224 <#224 https://github.com/lamw/ghettoVCB/pull/224>. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#221 (comment) https://github.com/lamw/ghettoVCB/issues/221#event-5002267785>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS5SNKJ56WGI3S3TSUYHIQDTW5RHRANCNFSM4VZXSTWA .

You should specify in VMDK_FILES_TO_BACKUP a full path to a VMDK if it is not located in the same directory with the VM: VMDK_FILES_TO_BACKUP=“EmergencyVM2_2.vmdk,/vmfs/volumes/551389f0-e395abae-ad2f-00e081ce99bd/EmergencyVM2/EmergencyVM2.vmdk” And don’t use quotes for each VMDK filename.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lamw/ghettoVCB/issues/221#issuecomment-894619880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS5SNKKNTVEHFUP36MKESALT3TPQXANCNFSM4VZXSTWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .