Connecting to KVM does not support using ssh keys

Bug #1852405 reported by Frode Nordahl
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Alberto Donato
2.7
Fix Released
High
Alberto Donato
2.8
Fix Released
High
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@10.219.3.1/system'

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/defer.py", line 500, in errback
     self._startRunCallbacks(fail)
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 567, in _startRunCallbacks
     self._runCallbacks()
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 653, in _runCallbacks
     current.result = callback(current.result, *args, **kw)
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1442, in gotResult
     _inlineCallbacks(r, g, deferred)
 --- <exception caught here> ---
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1384, in _inlineCallbacks
     result = result.throwExceptionIntoGenerator(g)
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/python/failure.py", 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/virsh.py", line 1398, in discover
     conn = yield self.get_virsh_connection(context)
   File "/snap/maas/4649/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
     result = g.send(result)
   File "/snap/maas/4649/lib/python3.6/site-packages/provisioningserver/drivers/pod/virsh.py", 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

Revision history for this message
Alberto Donato (ack) wrote :

Hi, are you specifying a password for ssh?

Changed in maas:
status: New → Incomplete
Revision history for this message
Frode Nordahl (fnordahl) wrote :

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

Changed in maas:
status: Incomplete → New
Revision history for this message
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)
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)
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
Revision history for this message
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)
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.