Merge pull request #4641 from josedonizetti/improve-kvm-connection-error-message

Improve kvm connection error message
pull/4647/head
Medya Ghazizadeh 2019-06-30 12:08:44 -07:00 committed by GitHub
commit 037e9a5d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 21 deletions

View File

@ -88,26 +88,6 @@ const domainTmpl = `
</domain>
`
const connectionErrorText = `
Error connecting to libvirt socket. Have you set up libvirt correctly?
# Install libvirt and qemu-kvm on your system, e.g.
# Debian/Ubuntu (for older Debian/Ubuntu versions, you may have to use libvirt-bin instead of libvirt-clients and libvirt-daemon-system)
$ sudo apt install libvirt-clients libvirt-daemon-system qemu-kvm
# Fedora/CentOS/RHEL
$ sudo yum install libvirt-daemon-kvm qemu-kvm
# Add yourself to the libvirt group so you don't need to sudo
# NOTE: For older Debian/Ubuntu versions change the group to [libvirtd]
$ sudo usermod -a -G libvirt $(whoami)
# Update your current session for the group change to take effect
# NOTE: For older Debian/Ubuntu versions change the group to [libvirtd]
$ newgrp libvirt
Visit https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver for more information.
`
func randomMAC() (net.HardwareAddr, error) {
buf := make([]byte, 6)
_, err := rand.Read(buf)
@ -144,7 +124,7 @@ func (d *Driver) getDomain() (*libvirt.Domain, *libvirt.Connect, error) {
func getConnection(connectionURI string) (*libvirt.Connect, error) {
conn, err := libvirt.NewConnect(connectionURI)
if err != nil {
return nil, errors.Wrap(err, connectionErrorText)
return nil, errors.Wrap(err, "error connecting to libvirt socket.")
}
return conn, nil

View File

@ -119,6 +119,11 @@ var vmProblems = map[string]match{
URL: "http://mikko.repolainen.fi/documents/virtualization-with-kvm",
Issues: []int{2991},
},
"KVM_CONNECTION_ERROR": {
Regexp: re(`error connecting to libvirt socket`),
Advice: "Have you set up libvirt correctly?",
URL: "https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver",
},
"DRIVER_CRASHED": {
Regexp: re(`Error attempting to get plugin server address for RPC`),
Advice: "The VM driver exited with an error, and may be corrupt. Run 'minikube start' with --alsologtostderr -v=8 to see the error",