Commit Graph

3266 Commits

Author SHA1 Message Date
Joshua Boniface 5954feaa31 Add autobackup functionality to CLI
Adds autobackup (integrated, managed VM backups with automatic remote
filesystem mounting, included backup expiry/removal and automatic
full/incremental selection, independent from the manual "pvc vm backup"
commands) to the CLI client.

This is a bit of a large command to handle only inside the CLI client,
but this was chosen as it's the only real place for it aside from an
external script.

There are several major restrictions on this command, mainly that it
must be run from the primary coordinator using the "local" connection,
and that it must be run as "root".

The command is designed to run in a cron/systemd timer installed by
pvc-ansible when the appropriate group_vars are enabled, and otherwise
not touched.
2023-10-26 21:25:23 -04:00
Joshua Boniface e63d8e59e9 Install sample configs to /usr/share/pvc instead
Also clean up the old versions in the postinst as they are obsolete and
not needed going forward. These only ever served as reference for a
manual installation which itself is long-obsoleted, and thus can be put
somewhere less "important".
2023-10-26 13:00:54 -04:00
Joshua Boniface 82b0301c0e Improve audit log output
Show the full command path in the actual audit log message, but still
only show the command name in the prefix.
2023-10-25 09:48:48 -04:00
Joshua Boniface 2ee2b2cb33 Avoid loading pkg_resources until needed
This import took forever (0.2s) and was used only for the version
command, so don't import it except where it's needed.
2023-10-25 01:51:08 -04:00
Joshua Boniface 198d083ea6 Remove old CLI code 2023-10-25 01:40:26 -04:00
Joshua Boniface 1306054a98 Readd images for README 2023-10-24 10:59:40 -04:00
Joshua Boniface 221af3f241 Bump version to 0.9.79 2023-10-24 02:10:24 -04:00
Joshua Boniface 35f80e544c Use more hierarchical backup path structure 2023-10-24 02:04:16 -04:00
Joshua Boniface 83b937654c Avoid removing nonexistent snapshots
Store retain_snapshot in JSON and use that to check during delete.
2023-10-24 01:35:00 -04:00
Joshua Boniface 714bde89e6 Fix incorrect variable ref 2023-10-24 01:25:01 -04:00
Joshua Boniface c87736eb0a Use consistent path name and format 2023-10-24 01:20:44 -04:00
Joshua Boniface 63d0a85e29 Add backup deletion command 2023-10-24 01:18:27 -04:00
Joshua Boniface 43e8cd3b07 Clarify restore help text 2023-10-24 00:32:53 -04:00
Joshua Boniface 55ca131c2c Handle snapshots on restore and provide options
Also rename the retain option to remove superfluous plural.
2023-10-24 00:25:06 -04:00
Joshua Boniface 0769f1ea52 Increase service start time to 10s 2023-10-23 22:24:03 -04:00
Joshua Boniface c858ae8fed Improve waiting in build-and-deploy 2023-10-23 22:23:48 -04:00
Joshua Boniface 8d256a1737 Complete VM restore functionality 2023-10-23 22:23:17 -04:00
Joshua Boniface d3b3fdfc80 Revert "Export backup images to a tar archive"
This reverts commit 38abd078af.
2023-10-23 11:01:16 -04:00
Joshua Boniface f1b29ea94e Initial VM restore work 2023-10-23 11:00:54 -04:00
Joshua Boniface 38abd078af Export backup images to a tar archive
This helps ensure an easier restore as the tar archive(s) can be sent
directly to the API via the normal process of image uploading, instead
of individual disks.
2023-10-23 09:56:50 -04:00
Joshua Boniface fabb97cf48 Only split a command_string if its not a list 2023-10-23 09:50:58 -04:00
Joshua Boniface 50aabde320 Ensure bond count is compared with actual qty 2023-10-22 02:28:04 -04:00
Joshua Boniface 68124db323 Remove extra spaces 2023-10-17 13:01:38 -04:00
Joshua Boniface 8921efd269 Fix incorrect tuple construct 2023-10-17 12:55:44 -04:00
Joshua Boniface 3e259bd926 Add state confirmation to newline 2023-10-17 12:53:20 -04:00
Joshua Boniface 3d12915989 Further improve return messages 2023-10-17 12:53:08 -04:00
Joshua Boniface 67b0b19bca Use better time functionality 2023-10-17 12:39:37 -04:00
Joshua Boniface 5d0c674d1d Add runtime and adjust ordering 2023-10-17 12:32:40 -04:00
Joshua Boniface f3bc4dee04 Fix ordering of empty line 2023-10-17 12:27:06 -04:00
Joshua Boniface f441b0d823 Improve missing parent message 2023-10-17 12:17:29 -04:00
Joshua Boniface fd2331faa6 Add waiting message during backup 2023-10-17 12:16:31 -04:00
Joshua Boniface a5d0f219e4 Improve return messages 2023-10-17 12:10:55 -04:00
Joshua Boniface 0169510df0 Fix up datestring generation 2023-10-17 12:05:45 -04:00
Joshua Boniface a58c1d5a8c Fix bad snapshot removals 2023-10-17 12:02:24 -04:00
Joshua Boniface a8e4b01b67 Handle return data even better 2023-10-17 11:51:03 -04:00
Joshua Boniface 45c4c86911 Handle extra return variable 2023-10-17 11:47:01 -04:00
Joshua Boniface 6448b31d2c Improve VM list arguments
Use kwargs here instead of fixed args to allow default None values.
2023-10-17 11:01:38 -04:00
Joshua Boniface 4fc9b15652 Fix bad function name 2023-10-17 10:56:32 -04:00
Joshua Boniface 75b839692b Fix missing comma 2023-10-17 10:51:30 -04:00
Joshua Boniface 751cfe0b29 Use consistent shebangs in scripts 2023-10-17 10:35:38 -04:00
Joshua Boniface b997c6f31e Add support for full VM backups
Adds support for exporting full VM backups, including configuration,
metainfo, and RBD disk images, with incremental support.
2023-10-17 10:15:06 -04:00
Joshua Boniface 6e83300d78 Increase ipmi plugin timeout 2023-10-04 19:21:59 -04:00
Joshua Boniface 522da3fd95 Adjust wording for volume create too 2023-10-03 09:42:23 -04:00
Joshua Boniface 3a1bf0724e Mention file_size as bytes 2023-10-03 09:39:19 -04:00
Joshua Boniface ee494fb1c0 Adjust the help text of storage pools
Makes some places clearer, cleans up cruft, and adds references to the
main documentation as required.
2023-10-02 11:46:12 -04:00
Joshua Boniface c6c44bf775 Bump version to 0.9.78 2023-09-30 12:57:55 -04:00
Joshua Boniface bbb940da65 Remove spurious comments 2023-09-30 12:37:58 -04:00
Joshua Boniface a0b45a2bcd Always create RBDs with bytes value
Converting into human results in imprecise values when specifying bytes
directly, which in turn breaks VMDK image uploads. Instead, just use the
raw bytes value when creating the volume instead of converting it back.
2023-09-30 12:37:43 -04:00
Joshua Boniface 35e27f79ef Fix uploading of non-raw image files
Adds a new API query parameter to define the file size, which is then
used for the temporary image. This is required for, at least VMDK, files
to work properly in qemu-img convert.
2023-09-29 16:19:22 -04:00
Joshua Boniface ad2e7750ff Fix output path and print message 2023-09-21 02:32:53 -04:00