Commit Graph

138 Commits

Author SHA1 Message Date
Joshua Boniface 84a905b7f0 Refactor ceph client for API 2019-07-05 00:30:03 -04:00
Joshua Boniface 6e2dfc1704 Reorganize file before refactoring
This is the largest of the function files, and unlike the others is
cleanly split into four types. Reorganize the file and function
definitions around those types to make it easier to navigate, and do so
separately before refactoring for API.
2019-07-04 23:09:16 -04:00
Joshua Boniface bcab11ee49 Refactor network.py for API usage 2019-07-04 23:01:22 -04:00
Joshua Boniface b195eb0668 Rename Information get function to match others 2019-07-04 23:00:53 -04:00
Joshua Boniface 10a0da6fdf Return strings only in extra details 2019-07-04 12:56:41 -04:00
Joshua Boniface 338af97a7a Handle message about wait locks a bit better 2019-06-27 16:20:30 -04:00
Joshua Boniface 77e215b0eb Don't queue flushes without --wait
Don't try to queue up a flush when there is already a flush lock; direct
the user to use --wait (which will actually wait before triggering the
new action), or try again later.
2019-06-27 14:36:58 -04:00
Joshua Boniface d28b1ba133 Support removing VMs (and disks) from PVC clients
Adds full support for removing a VM entirely, including its RBD disks,
via the PVC client(s). Avoids needing an undefine + manual removal.
2019-06-27 11:19:48 -04:00
Joshua Boniface b52cf01ecc Make conditionals more Pythonic 2019-06-25 12:36:37 -04:00
Joshua Boniface 93be983b39 Properly verify node inputs 2019-06-25 12:36:37 -04:00
Joshua Boniface d8dca50af4 Ensure domain is always set 2019-06-24 12:59:32 -04:00
Joshua Boniface 4922e973c7 Functionize duplicate code and fix net length bug 2019-06-24 10:10:07 -04:00
Joshua Boniface 1316b9ed59 Fix refactoring bugs 2019-06-24 09:56:06 -04:00
Joshua Boniface e097e9e8af Fix up status call 2019-06-21 16:40:12 -04:00
Joshua Boniface 60e6df4416 Increase wait on OSD add/remove a bit more 2019-06-21 16:01:08 -04:00
Joshua Boniface 9cec0c5b43 Remove extra bolding in lists 2019-06-21 15:57:50 -04:00
Joshua Boniface 808e53fe29 Increase wait on OSD add/remove 2019-06-21 15:56:37 -04:00
Joshua Boniface c63b5a8056 Handle a no-valid-nodes situation 2019-06-21 11:37:35 -04:00
Joshua Boniface f3e9082376 Simplify fromhuman byte formatting 2019-06-21 10:18:35 -04:00
Joshua Boniface 867ad1fc1b Support human-readable biconversion and in volumes 2019-06-21 09:23:52 -04:00
Joshua Boniface 3d3fa1b99f Add write-lock-wait to all other Ceph commands 2019-06-21 09:05:00 -04:00
Joshua Boniface 3dd56c55c0 Fix a few more bugs 2019-06-19 15:32:32 -04:00
Joshua Boniface 97a3dafa3b Fix bug in regex match for snapshots 2019-06-19 15:24:04 -04:00
Joshua Boniface 51256b4f0f Fix bad bolding in lists 2019-06-19 15:16:22 -04:00
Joshua Boniface 5d4ecafb03 Support listing of snapshots 2019-06-19 15:15:17 -04:00
Joshua Boniface 80de40252b Add shutdown colour to output 2019-06-19 14:28:04 -04:00
Joshua Boniface 39a45a1e0f Fix bug with daemon_state 2019-06-19 14:19:00 -04:00
Joshua Boniface bc38af774e Check that node is in run state before primary
Fixes #37
2019-06-19 12:49:34 -04:00
Joshua Boniface 5e211837ad Fix bug in output 2019-06-19 11:24:25 -04:00
Joshua Boniface e6a458f38c Support listing volumes 2019-06-19 11:22:49 -04:00
Joshua Boniface 98365b0fcf Correct bugs around snapshots 2019-06-19 09:41:33 -04:00
Joshua Boniface a4ab3075ab Correct some bugs around new code 2019-06-19 00:23:25 -04:00
Joshua Boniface 01959cb9e3 Implementation of RBD volumes and snapshots
Adds the ability to manage RBD volumes (add/remove) and RBD
snapshots (add/remove). (Working) list functions to come.
2019-06-19 00:12:44 -04:00
Joshua Boniface b50b2a827b Add forced delays after pool add/remove
Prevents returning immediately to give the cluster some breathing
room before the admin can do other commands. Keep the write lock
as well to prevent other clients from attempting this as well.
2019-06-18 21:56:24 -04:00
Joshua Boniface ee73676114 Fix bug with pool removal 2019-06-18 21:51:11 -04:00
Joshua Boniface 3ba3c339a7 Show vCPU count on CLI output
Showing the static, total number of CPUs was pointless. Instead,
show the number of allocated vCPUs. To preserve space, no longer
show the host CPU count in the list.
2019-06-02 22:30:26 -04:00
Joshua Boniface b9774bdf03 Increase wait sleeps in node flush/unflush 2019-05-26 23:21:01 -04:00
Joshua Boniface 6fd4710f7f Remove bad replacement 2019-05-21 19:51:23 -04:00
Joshua Boniface 79d0a2eafc Handle raw sorting properly with new list format 2019-05-21 14:44:45 -04:00
Joshua Boniface 73443ecbaf Update vm.py to allow API use 2019-05-20 22:15:28 -04:00
Joshua Boniface 91ea96b772 Actually send wait for unflush 2019-05-11 00:16:38 -04:00
Joshua Boniface 62a71af46e Implement locking for unflush as well
References #32
2019-05-11 00:13:03 -04:00
Joshua Boniface c19902d952 Implement flush locking for nodes
Implements a locking mechanism to prevent clobbering of node
flushes. When a flush begins, a global cluster lock is placed
which is freed once the flush completes. While the lock is in place,
other flush events queue waiting for the lock to free before
proceeding.

Modifies the CLI output flow when the `--wait` option is specified.
First, if a lock exists when running the command, the message is
tweaked to indicate this, and the client will wait first for the
lock to free, and then for the flush as normal. Second, the wait
depends on the active lock rather than the domain_status for
consistency purposes.

Closes #32
2019-05-10 23:52:24 -04:00
Joshua Boniface 045ad131af Update node.py to allow API use
Addresses #33
2019-05-10 23:27:34 -04:00
Joshua Boniface b6ecd36588 Implement domain log watching
Implements the ability for a client to watch almost-live domain
console logs from the hypervisors. It does this using a deque-based
"tail -f" mechanism (with a configurable buffer per-VM) that watches
the domain console logfile in the (configurable) directory every
half-second. It then stores the current buffer in Zookeeper when
changed, where a client can then request it, either as a static piece
of text in the `less` pager, or via a similar "tail -f" functionality
implemented using fixed line splitting and comparison to provide a
generally-seamless output.

Enabling this feature requires each guest VM to implement a Libvirt
serial log and write its (text) console to it, for example using the
default logging directory:

```
<serial type='pty'>
    <log file='/var/log/libvirt/vmname.log' append='off'/>
<serial>
```

The append mode can be either on or off; on grows files unbounded,
off causes the log (and hence the PVC log data) to be truncated on
initial VM startup from offline. The administrator must choose how
they best want to handle this until Libvirt implements their own
clog-type logging format.
2019-05-10 23:26:59 -04:00
Joshua Boniface 1126382ac9 Initial API including fixes to common functons
Some functions were doing `click.echo` inside themselves; don't
do that as it's not API compatible, just return everything.
2019-03-21 11:19:28 -04:00
Joshua Boniface 9f0d7c5bf8 Support VM list filtering by state 2019-03-20 11:31:54 -04:00
Joshua Boniface eec14ff177 Don't set unmigrated VMs to start 2019-03-20 10:19:01 -04:00
Joshua Boniface 15c832650d Don't block stopping on non-start state 2019-03-16 23:32:13 -04:00
Joshua Boniface 946442ae38 Add support for bridge-only VNIs 2019-03-15 13:54:11 -04:00