-
Notifications
You must be signed in to change notification settings - Fork 727
Implement backend healthcheck #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Tests are segfaulting...will look tomorrow. |
b4a68ed
to
b8dcc74
Compare
Also, only run the check if there are no instances running.
Also, run check on any CPU type
This will check if /dev/kvm is already in use before trying to launch/start an instance. Fixes #6
On any calls into the Libvirt backend, try a connection to libvirtd to ensure it is there instead of keeping a presistent connection that can become stale. Also, modify the whole state machine to better get the actual current state from libvirt. Modify and add new tests as seen fit for these modifications.
b8dcc74
to
b6d0ae7
Compare
Codecov Report
@@ Coverage Diff @@
## master #948 +/- ##
==========================================
+ Coverage 69.49% 69.63% +0.14%
==========================================
Files 192 192
Lines 6788 6790 +2
==========================================
+ Hits 4717 4728 +11
+ Misses 2071 2062 -9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #948 +/- ##
=========================================
+ Coverage 69.49% 69.7% +0.21%
=========================================
Files 192 192
Lines 6788 6852 +64
=========================================
+ Hits 4717 4776 +59
- Misses 2071 2076 +5
Continue to review full report at Codecov.
|
I'm working on a fix for #325 and was going to include it in this PR, but that should be in its own PR. So this is good for review 😁 |
Having broken KVM (renamed the module files), I'm getting this:
Could we wrap this in a better error message? |
Having disabled VT, qemu behaves nice:
But after switching to libvirt:
|
Yeah, I need to redirect
Hmm, seems |
- check_kvm_support: Output "modprobe" to /dev/null - libvirt: Run check_kvm_support in health check - check_if_kvm_is_in_use: Use "virtual machine manager" instead of "hypervisor"
I addressed your concerns and pushed. |
So that's now (both qemu and libvirt):
meh. |
Oh right, I have the script set to stop execution on errors, so it doesn't get to the output of not being able to load the module. I'll fix that 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of niggles inline. Still testing
check_kvm_module | ||
|
||
echo "Unable to load '$kvm_mod'." | ||
echo "Unable to load kvm support. Please ensure kvm is installed on your machine." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: you capitalize KVM in other messages above. Why not here? Also, can KVM actually be installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking the return code of the modprobe, and if failure, printing its error message would help people debug the issue. And us, if people paste that output into a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you capitalize KVM in other messages above. Why not here?
Oops, I will do that.
Also, can KVM actually be installed?
Well, it's a kernel module, so perhaps it's not compiled in the kernel being used? I'm not sure how else to word that without being too technical.
Checking the return code of the modprobe, and if failure, printing its error message would help people debug the issue. And us, if people paste that output into a bug.
I originally had the output of modprobe
, but @Saviq pointed out that it's not what we want in #811 and #948 (comment). So I'm not sure how else to handle that other to be generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, pushed the change for capitalizing 'KVM'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean @Saviq 's comment "Could we wrap this in a better error message?" ?
Could we compromise by printing the modprobe error to stderr, and setting QProcess::ForwardedErrorChannel
so that it'll end up in the journal?
I just hate throwing away a useful error message.
- check_kvm_support: Capitalize 'KVM' - backend::check_for_kvm_support(): Detect if check_kvm_support() is in multipassd's PATH
@gerboland, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it as much as I can, and healthcheck appears to do the job for both backends. libvirt improvements welcome!
bors r=Saviq,gerboland |
948: Implement backend healthcheck r=Saviq,gerboland a=townsend2010 This enables the backends to define how they check if their prerequisites are met before running and to also handle error conditions better and surface those to the user, Fixes #6, Fixes #770, Fixes #775, Fixes #811 Co-authored-by: Chris Townsend <[email protected]>
Build failed |
This enables the backends to define how they check if their prerequisites are met before running and to also handle error conditions better and surface those to the user,
Fixes #6, Fixes #770, Fixes #775, Fixes #811