Connecting to KVM does not support using ssh keys

Bug #1852405 reported by Frode Nordahl on 2019-11-13
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Alberto Donato
Alberto Donato
Alberto Donato

Bug Description

# snap info maas
[ snip ]
installed: 2.7.0-8135-g.321fadfe8 (4649) 130MB -

Adding KVM to a snap installed MAAS does not appear to work, example address: 'qemu+ssh://maas@'

Excerpt from /var/snap/maas/common/log/rackd.log:
2019-11-13 09:15:20 provisioningserver.rpc.pods: [critical] Failed to discover pod.
 Traceback (most recent call last):
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/", line 500, in errback
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/", line 567, in _startRunCallbacks
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/", line 653, in _runCallbacks
     current.result = callback(current.result, *args, **kw)
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/", line 1442, in gotResult
     _inlineCallbacks(r, g, deferred)
 --- <exception caught here> ---
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/", line 1384, in _inlineCallbacks
     result = result.throwExceptionIntoGenerator(g)
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/python/", line 408, in throwExceptionIntoGenerator
     return g.throw(self.type, self.value, self.tb)
   File "/snap/maas/4649/lib/python3.6/site-packages/provisioningserver/drivers/pod/", line 1398, in discover
     conn = yield self.get_virsh_connection(context)
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/", line 1386, in _inlineCallbacks
     result = g.send(result)
   File "/snap/maas/4649/lib/python3.6/site-packages/provisioningserver/drivers/pod/", line 1389, in get_virsh_connection
     raise VirshError("Failed to login to virsh console.")
 provisioningserver.drivers.pod.virsh.VirshError: Failed to login to virsh console.

This happens if no ssh password is provided, as ssh keys are currently not supported in the snap

Related branches

Alberto Donato (ack) wrote :

Hi, are you specifying a password for ssh?

Changed in maas:
status: New → Incomplete
Frode Nordahl (fnordahl) wrote :

No, I would want it to use SSH key based authentication.

Changed in maas:
status: Incomplete → New
Alberto Donato (ack) wrote :

currently the snap only supports password authentication for ssh. This is probably why it's failing for you (the message could be more explcit about it but that's what we get from virsh)

Alberto Donato (ack) on 2019-11-13
summary: - [snap] Connect to KVM does not work, missing `virsh` in snap?
+ [snap] Connecting to KVM does not support using ssh keys
description: updated
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
Alberto Donato (ack) on 2020-02-26
Changed in maas:
assignee: nobody → Alberto Donato (ack)
status: Triaged → In Progress
milestone: none → 2.7.1
summary: - [snap] Connecting to KVM does not support using ssh keys
+ Connecting to KVM does not support using ssh keys
Changed in maas:
importance: Medium → High
Alberto Donato (ack) wrote :

With the change from the linked branch, ssh keys can be placed in /var/snap/maas/current/root/.ssh

no longer affects: maas/trunk
Alberto Donato (ack) on 2020-04-17
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers