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

Start virtual machines in paused state if offline to allow full/incremental/differential backup #164

Closed
abbbi opened this issue Mar 21, 2024 · 1 comment
Labels
enhancement New feature or request fixed-in-master Fixed in master
Milestone

Comments

@abbbi
Copy link
Owner

abbbi commented Mar 21, 2024

Currently the backup utility performs an fallback to copy backup if a virtual machine is offline because its not possible to create checkpoints for offline virtual machines (no qemu process running ..)

Libvirt allows to start the virtual machine in paused state, where the qemu process for the virtual machine is executed but the CPU's of the virtual machine are halted. The Virtual domain is then in "paused" state. However, as the qemu process is running, backup and checkpoint operations are possible.

A special option -S (--start-domain) could be introduced which starts the domain with PAUSE and AUTODESTROY Flags: it is then possible to perform full/inc/diff backups on virtual machines that are offline, too.

@abbbi abbbi added the enhancement New feature or request label Mar 21, 2024
abbbi added a commit that referenced this issue Mar 21, 2024
@abbbi abbbi added the Needs-testing Feature needs testing label Mar 21, 2024
@abbbi
Copy link
Owner Author

abbbi commented Mar 21, 2024

Branch contains first draft of implementation where it is attempted to start the virtual machine if option is specified:

 ./virtnbdbackup -l inc -d vm1 -o /tmp/paused -S
[2024-03-21 21:33:04] INFO lib common - printVersion [main]:  Version: 2.2 Arguments: ./virtnbdbackup -l inc -d vm1 -o /tmp/paused -S
[2024-03-21 21:33:04] INFO root virtnbdbackup - main [main]:  Backup level: [inc]
[2024-03-21 21:33:05] INFO root virtnbdbackup - main [main]:  Libvirt library version: [9000000]
[2024-03-21 21:33:05] INFO root virtnbdbackup - main [main]:  Starting offline VM in paused state
[..]

Still TODO:

  • think about possible corner cases where mixing option -S and fallback could lead to data loss?
  • update README
  • add tests

@abbbi abbbi added this to the v2.3 milestone Mar 21, 2024
@abbbi abbbi added the wip work in progress label Mar 21, 2024
abbbi added a commit that referenced this issue Mar 22, 2024
@abbbi abbbi added fixed-in-master Fixed in master and removed Needs-testing Feature needs testing wip work in progress labels Mar 22, 2024
@abbbi abbbi closed this as completed Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed-in-master Fixed in master
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant