Port VM autobackups into pvcworkerd with snaps

Moves VM autobackups from being in-CLI to being handled by the
pvcworkerd system on the primary coordinator. Turns the CLI autobackup
command into an actual API client endpoint rather than having its logic
in the CLI.

In addition, modifies the new autobackup to leverage the new "pvc vm
snapshot" function set, just with special snapshot names. This helps
automate this within the new snapshot scaffolding.
This commit is contained in:
2024-08-23 17:01:31 -04:00
parent fd199f405b
commit 0d918d66fe
7 changed files with 686 additions and 504 deletions

View File

@ -47,6 +47,9 @@ from daemon_lib.benchmark import (
from daemon_lib.vmbuilder import (
worker_create_vm,
)
from daemon_lib.autobackup import (
worker_cluster_autobackup,
)
# Daemon version
version = "0.9.98"
@ -101,6 +104,21 @@ def storage_benchmark(self, pool=None, run_on="primary"):
return run_storage_benchmark(self, pool)
@celery.task(name="cluster.autobackup", bind=True, routing_key="run_on")
def cluster_autobackup(self, force_full=False, email_recipients=None, run_on="primary"):
@ZKConnection(config)
def run_cluster_autobackup(
zkhandler, self, force_full=False, email_recipients=None
):
return worker_cluster_autobackup(
zkhandler, self, force_full=force_full, email_recipients=email_recipients
)
return run_cluster_autobackup(
self, force_full=force_full, email_recipients=email_recipients
)
@celery.task(name="vm.flush_locks", bind=True, routing_key="run_on")
def vm_flush_locks(self, domain=None, force_unlock=False, run_on="primary"):
@ZKConnection(config)