Skip to content

VMware Plugin: improve snapshot cleanup#1484

Merged
pstorz merged 2 commits intomasterfrom
dev/sduehr/master/vmware-snapshot-cleanup
Jun 26, 2023
Merged

VMware Plugin: improve snapshot cleanup#1484
pstorz merged 2 commits intomasterfrom
dev/sduehr/master/vmware-snapshot-cleanup

Conversation

@sduehr
Copy link
Member

@sduehr sduehr commented Jun 12, 2023

If leftover snapshots exist from previous backups, they are now cleaned up before taking a new snapshot. Additionally, the snapshot cleanup after backup now works more reliable by reconnecting to the vCenter server if necessary. Code refactored to consequently use methods from pyVim.task. Also fixes a bug when folder=/ is used.

Fixes: #1533: Restoring vmware vms keeps failing, can't restore the data.

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)

Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

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

Good work!
Please see comments.

@bruno-at-bareos bruno-at-bareos requested a review from pstorz June 26, 2023 09:26
@bruno-at-bareos
Copy link
Contributor

@pstorz I've committed the suggestions, do we want to squash the 4 commits to one, so easier to backport ?

@bruno-at-bareos bruno-at-bareos force-pushed the dev/sduehr/master/vmware-snapshot-cleanup branch from 3affcfa to 0e7f740 Compare June 26, 2023 12:10
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

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

Good work!

@pstorz pstorz force-pushed the dev/sduehr/master/vmware-snapshot-cleanup branch from 0e7f740 to 177bfd3 Compare June 26, 2023 12:37
sduehr and others added 2 commits June 26, 2023 14:38
If leftover snapshots exist from previous backups, they are now cleaned
up before taking a new snapshot. Additionally, the snapshot cleanup
after backup now works more reliable by reconnecting to the vCenter
server if necessary. Code refactored to consequently use methods from
pyVim.task.

- fix a bug when folder=/ is used.

Fixes: #1533: Restoring vmware vms keeps failing, can't restore the data

- Fix restore when bootOrder was set

When bootOrder was set to a virtualDisk at backup time, ensure the
restore works by setting the bootOrder now after disks were added to
the recreated VM.

- Fix restore when virtualCdrom path is invalid

Restore fails when recreating a VM and the backing file of a virtual
CDROM is inaccessible, this can occur when it was connected to an ISO
file on a NFS datastore which is not accessible at restore time.
This change will then create a disconnected virtual CDROM to allow
the restore to finish successfully.

Co-authored-by: Philipp Storz <philipp.storz@bareos.com>
@pstorz pstorz force-pushed the dev/sduehr/master/vmware-snapshot-cleanup branch from 9d5535b to ff1eac8 Compare June 26, 2023 12:38
@pstorz pstorz merged commit c6ce79d into master Jun 26, 2023
@pstorz pstorz deleted the dev/sduehr/master/vmware-snapshot-cleanup branch June 26, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants