Commit Graph

408 Commits

Author SHA1 Message Date
Joshua Boniface d68f6a945e Add auditing to local syslog from PVC client
This ensures that any client command is logged by the local system.
Helps ensure Accounting for users of the CLI. Currently logs the full
command executed along with the $USER environment variable contents.
2021-12-10 16:17:33 -05:00
Joshua Boniface a2fa6ed450 Fix bugs with legacy benchmark format 2021-11-26 11:42:35 -05:00
Joshua Boniface 02a2f6a27a Bump version to 0.9.45 2021-11-25 09:34:20 -05:00
Joshua Boniface a75b951605 Ensure echo always has an argument 2021-11-25 09:33:26 -05:00
Joshua Boniface 3aa20fbaa3 Bump version to 0.9.44 2021-11-11 16:20:38 -05:00
Joshua Boniface be6a3992c1 Add 0.05s to connection timeout
This is recommended by the Python Requests documentation:

> It’s a good practice to set connect timeouts to slightly larger than a
  multiple of 3, which is the default TCP packet retransmission window.
2021-11-08 03:11:41 -05:00
Joshua Boniface d76da0f25a Use separate connect and data timeouts
This allows us to keep a very low connect timeout of 3 seconds, but also
ensure that long commands (e.g. --wait or VM disable) can take as long
as the API requires to complete.

Avoids having to explicitly set very long single-instance timeouts for
other functions which would block forever on an unreachable API.
2021-11-08 03:10:09 -05:00
Joshua Boniface 6febcfdd97 Bump version to 0.9.43 2021-11-08 02:29:17 -05:00
Joshua Boniface 459485c202 Allow American spelling for compatibility 2021-11-08 00:09:59 -05:00
Joshua Boniface 9f92d5d822 Shorten help messages slightly to fit 2021-11-08 00:07:21 -05:00
Joshua Boniface 947ac561c8 Add forced colour support
Allows preserving colour within e.g. watch, where Click would normally
determine that it is "not a terminal". This is done via the wrapper echo
which filters via the local config.
2021-11-08 00:04:20 -05:00
Joshua Boniface 0639b16c86 Apply more granular timeout formatting
We don't need to wait forever if state changes aren't waiting or disable
(which does a shutdown before returning).
2021-11-06 13:34:03 -04:00
Joshua Boniface 1cf8706a52 Up timeout when setting VM state
Ensures the API won't time out immediately especially during a
wait-flagged or disable action.
2021-11-06 04:15:10 -04:00
Joshua Boniface 5a5e5da663 Add disable forcing to CLI
References #148
2021-11-06 04:02:50 -04:00
Joshua Boniface 66230ce971 Fix linting errors F522/F523 unused args 2021-11-06 03:24:50 -04:00
Joshua Boniface 2083fd824a Reformat code with Black code formatter
Unify the code style along PEP and Black principles using the tool.
2021-11-06 03:02:43 -04:00
Joshua Boniface c7a5b41b1e Fix ordering to show correct message 2021-10-27 13:37:52 -04:00
Joshua Boniface 48b0091d3e Support adding the same network to a VM again
This is a supported configuration for some edge cases and should be
allowed.
2021-10-27 13:33:27 -04:00
Joshua Boniface d7f26b27ea More gracefully handle restart + live
Instead of erroring, just use the implication that restarting a VM does
not want a live modification, and proceed from there. Update the help
text to match.
2021-10-27 13:23:39 -04:00
Joshua Boniface 872f35a7ee Support removing VM interfaces by MAC
Provides a way to handle multiple interfaces in the same network
gracefully, while making the previous behaviour explicit.
2021-10-27 13:20:05 -04:00
Joshua Boniface 23165482df Bump version to 0.9.42 2021-10-12 15:25:42 -04:00
Joshua Boniface e9dea4d2d1 Add explicit 3 second timeout to requests 2021-10-11 16:31:18 -04:00
Joshua Boniface 39fd85fcc3 Add version function support to CLI 2021-10-11 15:34:41 -04:00
Joshua Boniface d1f2ce0b0a Bump version to 0.9.41 2021-10-09 19:39:21 -04:00
Joshua Boniface f1b4ee02ba Fix bad header length in network list 2021-10-09 18:50:32 -04:00
Joshua Boniface 7f074847c4 Add MTU support to network add/modify commands
Addresses #144
2021-10-09 18:06:21 -04:00
Joshua Boniface ee348593c9 Bump version to 0.9.40 2021-10-07 14:42:04 -04:00
Joshua Boniface e79d200244 Bump version to 0.9.39 2021-10-07 11:52:38 -04:00
Joshua Boniface 5501586a47 Add limit negation to VM list
When using the "state", "node", or "tag" arguments to a VM list, add
support for a "negate" flag to look for all VMs *not in* the state,
node, or tag state.
2021-10-07 11:50:52 -04:00
Joshua Boniface 3449069e3d Bump version to 0.9.38 2021-10-03 22:32:41 -04:00
Joshua Boniface cb66b16045 Correct latency units and format name 2021-10-03 17:06:34 -04:00
Joshua Boniface 8edce74b85 Revamp test result display
Instead of showing CLAT percentiles, which are very hard to interpret
and understand, instead use the main latency buckets.
2021-10-03 15:49:01 -04:00
Joshua Boniface a09578fcf5 Add benchmark format to list 2021-10-03 15:05:58 -04:00
Joshua Boniface 73be807b84 Adjust ETA for benchmarks 2021-10-02 04:51:01 -04:00
Joshua Boniface 4a9805578e Add format parsing for format 1 storage benchmarks 2021-10-02 04:46:44 -04:00
Joshua Boniface f70f052df1 Add version 2 benchmark list formatting 2021-10-02 02:47:17 -04:00
Joshua Boniface 8de63b2785 Fix handling of array of information
With a benchmark info we only ever want test one, so pass only that to
the formatter. Simplifies the format function.
2021-10-02 01:28:39 -04:00
Joshua Boniface 8f8f00b2e9 Avoid versioning benchmark lists
This wouldn't work since each individual test is versioned. Instead add
a placeholder for later once additional format(s) are defined.
2021-10-02 01:25:18 -04:00
Joshua Boniface 1daab49b50 Add format option to benchmark info
Allows specifying of raw json or json-pretty formats in addition to the
"pretty" formatted option.
2021-10-02 01:13:50 -04:00
Joshua Boniface 9f6041b9cf Add benchmark format function support
Allows choosing different list and info functions based on the benchmark
version found. Currently only implements "legacy" version 0 with more to
be added.
2021-10-02 01:07:25 -04:00
Joshua Boniface 3e8a85b029 Load benchmark results as JSON
Load the JSON at the API side instead of client side, because that's
what the API doc says it is and it just makes more sense.
2021-09-30 23:40:24 -04:00
Joshua Boniface 19ac1e17c3 Bump version to 0.9.37 2021-09-30 02:08:14 -04:00
Joshua Boniface 252175fb6f Revamp benchmark tests
1. Move to a time-based (60s) benchmark to avoid these taking an absurd
amount of time to show the same information.

2. Eliminate the 256k random benchmarks, since they don't really add
anything.

3. Add in a 4k single-queue benchmark as this might provide valuable
insight into latency.

4. Adjust the output to reflect the above changes.

While this does change the benchmarking, this should not invalidate any
existing benchmarks since most of the test suit is unchanged (especially
the most important 4M sequential and 4K random tests). It simply removes
an unused entry and adds a more helpful one. The time-based change
should not significantly affect the results either, just reduces the
total runtime for long-tests and increase the runtime for quick tests to
provide a better picture.
2021-09-29 20:51:30 -04:00
Joshua Boniface 7a8eee244a Tweak CLI helptext around OSD actions
Adds some more detail about OSD commands and their values.
2021-09-26 01:29:23 -04:00
Joshua Boniface 7a3a44d47c Fix OSD creation for partition paths and fix gdisk
The previous implementation did not work with /dev/nvme devices or any
/dev/disk/by-* devices due to some logical failures in the partition
naming scheme, so fix these, and be explicit about what is supported in
the PVC CLI command output.

The 'echo | gdisk' implementation of partition creation also did not
work due to limitations of subprocess.run; instead, use sgdisk which
allows these commands to be written out explicitly and is included in
the same package as gdisk.
2021-09-26 00:12:28 -04:00
Joshua Boniface 44491dd988 Add support for configurable OSD DB ratios
The default of 0.05 (5%) is likely ideal in the initial implementation,
but allow this to be set explicitly for maximum flexibility in
space-constrained or performance-critical use-cases.
2021-09-24 01:06:39 -04:00
Joshua Boniface eba142f470 Bump version to 0.9.36 2021-09-23 14:01:38 -04:00
Joshua Boniface 6cef68d157 Add separate OSD DB device support
Adds in three parts:

1. Create an API endpoint to create OSD DB volume groups on a device.
Passed through to the node via the same command pipeline as
creating/removing OSDs, and creates a volume group with a fixed name
(osd-db).

2. Adds API support for specifying whether or not to use this DB volume
group when creating a new OSD via the "ext_db" flag. Naming and sizing
is fixed for simplicity and based on Ceph recommendations (5% of OSD
size). The Zookeeper schema tracks the block device to use during
removal.

3. Adds CLI support for the new and modified API endpoints, as well as
displaying the block device and DB block device in the OSD list.

While I debated supporting adding a DB device to an existing OSD, in
practice this ended up being a very complex operation involving stopping
the OSD and setting some options, so this is not supported; this can be
specified during OSD creation only.

Closes #142
2021-09-23 13:59:49 -04:00
Joshua Boniface 3e3776a25b Bump version to 0.9.35 2021-09-13 02:20:46 -04:00
Joshua Boniface 73c96d1e93 Add VM device hot attach/detach support
Adds a new API endpoint to support hot attach/detach of devices, and the
corresponding client-side logic to use this endpoint when doing VM
network/storage add/remove actions.

The live attach is now the default behaviour for these types of
additions and removals, and can be disabled if needed.

Closes #141
2021-09-12 19:33:00 -04:00