Conversation
| @@ -1049,8 +1071,13 @@ ghettoVCB() { | |||
| VM_FAILED=1 | |||
| continue | |||
| elif [ ${ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP} -eq 1 ]; then | |||
There was a problem hiding this comment.
L1073-1080 seems redundant and not very useful if we plan to support VMs w/snapshots. Basically if we get into this loop, ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP=1, so we're not longer consolidating snapshots and logging that we have a snapshot could definitely but useful but not sure what VM_WITH_SNAPSHOTS flag is checking for later on ...
There was a problem hiding this comment.
the flag VM_WITH_SNAPSHOTS boolean equivalent
VM_WITH_SNAPSHOTS = NEW_VIMCMD_SNAPSHOT == "yes" && ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP == 1
and can be replaced.
In initial script exists the check for the ability to remove snapshots by the identifier. This is probably a legacy from the old version of the ESXi. I can't check it, but I see in L312
NEW_VIMCMD_SNAPSHOT="no"
${VMWARE_CMD} vmsvc/snapshot.remove 2>&1 | grep -q "snapshotId"
[[ $? -eq 0 ]] && NEW_VIMCMD_SNAPSHOT="yes"
Based on this logic, as I understand it, snapshots are managed according to the principle - exists they are or not.
|
|
||
| CHECK_CMD="${VMWARE_CMD} vmsvc/snapshot.get ${VM_ID} | wc -l" | ||
| if [[ ${VM_WITH_SNAPSHOTS} -eq 1 ]]; then | ||
| CHECK_CMD="${VMWARE_CMD} vmsvc/snapshot.get ${VM_ID} | grep -E '(Snapshot Name|Snapshot Id)' | grep -A1 ${SNAPSHOT_NAME} | wc -l" |
There was a problem hiding this comment.
Shouldn't we just have one CHECK_CMD, which is the one searching for the name/Id? In this loop, the VM is powered on which means we have to take a snapshot and hence L1163 is going to be redefined anyhow
There was a problem hiding this comment.
L1163 This is the check condition from the base script, as I wrote above, it only controls the existence of snapshots. This is sufficient if a backup is performed without snapshots or on the old version of the hypervisor( remark upstair). If snapshots support is activated and the command syntax allows us to determine our snapshot, only then new condition used.
|
Is there any progress on this or were issues found that prohibit a merge? I'm really interested in the functionality to pull backups without touching existing snapshots. Thanks for your work! |
Add snapshot support without merging original, tested on esxi 5.1 and 6.7