canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.77k stars 642 forks source link

libvirt: Need to pass VM creation and start errors back to the client #240

Closed Saviq closed 11 months ago

Saviq commented 6 years ago

Not sure what happened:

$ snap set multipass driver=LIBVIRT
$ multipass launch -n snapcraft-subsurface -c 4 -m 4G -d 10G
failed to launch: End of file while reading data: Input/output error            
$ multipass list
Name                    State       IPv4             Release
snapcraft-subsurface    STOPPED     --               Ubuntu 16.04 LTS

This seems related:

maj 09 10:36:51 michal-laptop libvirtd[25033]: Failed to probe capabilities for /usr/bin/kvm: internal error: QEMU / QMP failed: Failed to open module: /usr/lib/x86_64-linux-gnu/qemu/block-iscsi.so: undefined symbol: scsi_sense_to_errno
                                               Failed to open module: /usr/lib/x86_64-linux-gnu/qemu/block-curl.so: undefined symbol: qcrypto_secret_lookup_as_utf8
                                               Failed to open module: /usr/lib/x86_64-linux-gnu/qemu/block-rbd.so: undefined symbol: aio_bh_schedule_oneshot
                                               ioctl(KVM_CREATE_VM) failed: 12 Cannot allocate memory
                                               failed to initialize KVM: Cannot allocate memory
maj 09 10:36:51 michal-laptop libvirtd[25033]: failed to connect to monitor socket: No such process
townsend2010 commented 6 years ago
ioctl(KVM_CREATE_VM) failed: 12 Cannot allocate memory
failed to initialize KVM: Cannot allocate memory

This is the real issue here...your machine does not have enough free memory to create the VM.

We need to bubble up this error to the client to give the user a better message about what the problem is.

townsend2010 commented 6 years ago

After looking at this some more, the End of file while reading data: Input/output error message displayed is in fact coming from libvirt, so we're doing the right thing here. It seems libvirt sends this message if qemu unexpectedly disappears along with its qmp monitor. I'm not a fan of catching exact strings and redisplaying a new string, so I'm not sure what else we can do here.

townsend2010 commented 11 months ago

This is a long opened bug and haven't gotten another issue like this in may years. Also, libvirt is hardly used to launch instances, and as such, it no longer makes sense for us to put efforts into fixing this. Will close...