Commit Graph

997 Commits

Author SHA1 Message Date
Joshua Boniface a480048d36 Add flask dependency to API client 2019-07-05 23:24:27 -04:00
Joshua Boniface f5644e53bf Add unit file for API client daemon 2019-07-05 22:25:07 -04:00
Joshua Boniface 0a96e26bc6 Clean up Debian control and add API package 2019-07-05 22:22:28 -04:00
Joshua Boniface 2ce08b6369 Implement API for Ceph functions 2019-07-05 22:14:58 -04:00
Joshua Boniface 4e94331d1a Implement API for network functions 2019-07-05 21:39:04 -04:00
Joshua Boniface 7d56ecb13d Apply tweak to rule direction handling 2019-07-05 21:38:47 -04:00
Joshua Boniface b7480b3bbc Implement all VM API functions 2019-07-05 18:24:14 -04:00
Joshua Boniface 5ac3d55b8d Always use the passed domain in messages
Don't ever output an ugly UUID unless that's what was actually sent to
the function. Makes output much much nicer, especially on errors.
2019-07-05 16:38:54 -04:00
Joshua Boniface 18520d6c77 Support disabling fuzzy limit matching
Used for the APIs when they filter by name but we don't want a fuzzy
limit since we specified an exact name.
2019-07-05 16:30:20 -04:00
Joshua Boniface dc16f51b2a Fix variable naming bug 2019-07-05 14:18:18 -04:00
Joshua Boniface 061b4eb61e Refactor API into separate files
Make it easier to separate the model (i.e. API endpoints) from the
controller (i.e. the actual functions which talk to ZK). Helps to keep
the main API file smaller and more regular.
2019-07-05 14:11:01 -04:00
Joshua Boniface 6ee3c91a63 Use None instead of all in ceph.py
Make it like other optional args (like direction in net ACLs) and use
None instead of 'all' when specifying any option
2019-07-05 13:59:29 -04:00
Joshua Boniface e31e1264e5 RESTify the API removing specific list endpoints 2019-07-05 13:20:06 -04:00
Joshua Boniface c7269a092e Use request.values instead of request.args 2019-07-05 13:05:33 -04:00
Joshua Boniface 193567f965 Further work on API client
Add list and info endpoints for all areas; add dummy endpoints for all
remaining endpoints.
2019-07-05 01:19:39 -04:00
Joshua Boniface d755a80fe8 Fix bugs with refactoring 2019-07-05 00:44:40 -04:00
Joshua Boniface 80ea54d40f Make bracketing and indenting consistent 2019-07-05 00:32:04 -04:00
Joshua Boniface 82bf8a8406 Remove superfluous comment 2019-07-05 00:30:11 -04:00
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 8d5549c68f Implement better arg handling and lists 2019-07-04 12:56:41 -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 1f4b5a6d65 Add little deploy script for testing purposes 2019-06-27 14:37:42 -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 3e591bd09e Remove extra whitespaces on blank lines 2019-06-25 22:33:23 -04:00
Joshua Boniface 08cb16bfbc Revamp VM migration handling
This was very old code that was hard to follow and quite fragile, with
failures and infinite loops occurring fairly frequently. These changes
make the code more robust, including the addition of timeouts, some code
cleanup, and some improvements to the logical flow.

Also forces the libvirt migration to occur on the cluster network, which
couples to changes in the libvirtd listen (via pvc-ansible) and in
Daemon.py via the previous commit.
2019-06-25 22:23:48 -04:00
Joshua Boniface d336fce253 Connect to actual IP not localhost for Libvirt 2019-06-25 22:09:32 -04:00
Joshua Boniface 75d0e7f989 Revert "Only perform fencing duties on primary"
This reverts commit 464c69aac6.

Actually, yea, this made sense - if the primary fails, it can't
fence itself.
2019-06-25 12:36:48 -04:00
Joshua Boniface 85a5a8a0c9 Disable tx offloading on bridge interfaces
Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717215#68

Without this, DHCP fails when traversing only the local bridge, for
Debian Jessie or earlier (and possibly other OSes as well), due to the
missing UDP checksums. This disables the offload and hence reenables
the checksums even on the software-only bridge.

Also rearranged the steps and added comments arround this section to
better clarify what each command is doing.
2019-06-25 12:36:37 -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 464c69aac6 Only perform fencing duties on primary
There was really no need for this to be shared among all the
coordinators, which seemed more fragile. This way only the primary will
try to fence dead nodes.
2019-06-24 20:17:51 -04:00
Joshua Boniface 249611b161 Remove duplicate import 2019-06-24 20:14:43 -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 d5e5ed4b69 Add hostname into confirmation 2019-06-21 15:54:54 -04:00
Joshua Boniface ef272b0b7d Add removal confirmations and zap disk before add 2019-06-21 15:52:28 -04:00
Joshua Boniface 26a4b3b757 Fix logic error in init 2019-06-21 15:38:32 -04:00
Joshua Boniface 519203d7fd Fix bad flag value 2019-06-21 15:09:15 -04:00
Joshua Boniface 93d2e0da6f Improve handling of init 2019-06-21 14:16:32 -04:00
Joshua Boniface c63b5a8056 Handle a no-valid-nodes situation 2019-06-21 11:37:35 -04:00