Commit Graph

3293 Commits

Author SHA1 Message Date
Joshua Boniface dd0177ce10 Rework replacement procedure again
Avoid calling other functions; replicate the actual process from Ceph
docs (https://docs.ceph.com/en/pacific/rados/operations/add-or-rm-osds/)
to ensure things work out well (e.g. preserving OSD IDs).
2023-11-03 16:31:56 -04:00
Joshua Boniface ed5bc9fb43 Fix numerous formatting and function bugs 2023-11-03 14:00:05 -04:00
Joshua Boniface 94d8d2cf75 Fix skip_zap_flag anomaly and add crush rm 2023-11-03 02:35:12 -04:00
Joshua Boniface 20497cf89d Fix bugs and skip safe_to_destroy on force 2023-11-03 02:29:50 -04:00
Joshua Boniface 64e37ae963 Update OSD replacement functionality
1. Simplify this by leveraging the existing remove_osd/add_osd
functions, since its task was functionally identical to those two in
sequential order.
2. Add support for split OSDs within the command (replacing all OSDs on
the block device(s) as required).
3. Add additional configurability and flexibility around the old device,
weight, and external DB LVs.
2023-11-03 01:45:49 -04:00
Joshua Boniface 3cb8a70f04 Add forcing to OSD purge 2023-11-02 23:20:48 -04:00
Joshua Boniface 44d2f98e75 Remove Var field from OSDs
Not super duper useful and increases length
2023-11-02 22:55:39 -04:00
Joshua Boniface cb91bf18a7 Fix incorrect variables 2023-11-02 22:39:32 -04:00
Joshua Boniface a3e3fe829a Adjust helptext for osd add 2023-11-02 22:34:58 -04:00
Joshua Boniface f53af510c1 Avoid startup failures if OSD removed 2023-11-02 22:24:39 -04:00
Joshua Boniface d5d783fad3 Set proper split flag 2023-11-02 22:20:22 -04:00
Joshua Boniface 8b8957547a Adjust helptext for create-db-vg command 2023-11-02 22:14:25 -04:00
Joshua Boniface 980ea6a9e9 Adjust handling of ext_db and _count options
Avoid the use of superfluous flag options, default them to none, and add
support for fixed-size DB LVs.
2023-11-02 13:29:47 -04:00
Joshua Boniface 0f433bd5eb Add wait messages for OSD commands 2023-11-02 09:31:41 -04:00
Joshua Boniface 8780044be6 Ensure db_device is an empty string 2023-11-02 00:52:18 -04:00
Joshua Boniface f08c654f22 Fix missing fstring 2023-11-01 21:41:06 -04:00
Joshua Boniface 80a7fd6195 Improve help text messages 2023-11-01 21:38:55 -04:00
Joshua Boniface 8b93f9a80e Handle OSD index errors during stats collection 2023-11-01 21:33:40 -04:00
Joshua Boniface 526a5f4a74 Add support for split OSD adds
Allows creating multiple OSDs on a single (NVMe) block device,
leveraging the "ceph-volume lvm batch" command. Replaces the previous
method of creating OSDs.

Also adds a new ZK item for each OSD indicating if it is split or not.
2023-11-01 21:31:35 -04:00
Joshua Boniface aa0b1f504f Fix output bug 2023-11-01 15:46:38 -04:00
Joshua Boniface bc425b9224 Avoid duplicate confirmations in a safer way
This version instead still requires --yes with --restart to avoid the
confirmation option, but avoids duplicate prompts.

This might be slightly more cumbersome, but ensures consistency: every
situation that could cause a restart is confirmed even if --restart is
given.
2023-11-01 12:05:52 -04:00
Joshua Boniface 79e5c098cd Revert "Remove duplicate confirmation for VM restart"
This reverts commit 3c61a3ac03.
2023-11-01 12:04:34 -04:00
Joshua Boniface 3c61a3ac03 Remove duplicate confirmation for VM restart
Having both restart_opt and confirm_opt resulted in a duplicate
confirmation message, at least if neither --restart/--no-restart is
specified. This is not necessary as the confirmation is already given by
the restart_opt or the relevant --restart/--no-restart flag.
2023-11-01 12:02:34 -04:00
Joshua Boniface 988c777912 Properly handle live state with restart confirm
If "--live" is passed (the default), we shouldn't confirm to restart the
VM as this is not required. Instead only confirm if "--no-live" was
passed or if the flag doesn't exist.
2023-11-01 11:46:59 -04:00
Joshua Boniface 5b4dd61754 Bump version to 0.9.80 2023-10-27 09:56:31 -04:00
Joshua Boniface 2fccbcda89 Add enhancements to autobackup
1. Add a cron mode to avoid exit(1) during cronjobs/timers
2. Revamp the remote_mount settings into auto_mount
   This removes a lot of unnecessary complexity while giving the
   administrator more flexibility in what they want to execute to mount
   a filesystem and how. The naming reflects the goal but the possible
   commands are arbitrary.
2023-10-27 02:07:24 -04:00
Joshua Boniface 6ad51ea4bb Handle store exceptions in cli() function
Avoids having an unsuppressable error message in some contexts, and
provides a cleaner module.
2023-10-26 23:30:22 -04:00
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