Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snapshot support without merging #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

wolfic
Copy link

@wolfic wolfic commented Jan 10, 2019

Add snapshot support without merging original, tested on esxi 5.1 and 6.7

@@ -1049,8 +1071,13 @@ ghettoVCB() {
VM_FAILED=1
continue
elif [ ${ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP} -eq 1 ]; then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@346L3
Copy link

346L3 commented Jan 3, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants