canonical / canonical/cloud-init

cloud-init v19.1 fails to read user-data if a VM on CloudSigma doesn't have a ssh public key in VM properties/SSH keys

Open
#3,396 6 comments 0 reactions 0 assignees View on GitHub
bug launchpad
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

This bug was originally filed in Launchpad as [LP: #1834065](https://bugs.launchpad.net/cloud-init/+bug/1834065)

Launchpad details

affected_projects = []

assignee = None
assignee_name = None
date_closed = None
date_created = 2019-06-24T16:29:19.521858+00:00
date_fix_committed = None
date_fix_released = None
id = 1834065
importance = medium
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1834065
milestone = None
owner = akik
owner_name = Aki Ketolainen
private = False
status = triaged
submitter = akik
submitter_name = Aki Ketolainen
tags = []
duplicates = []

_Launchpad user **Aki Ketolainen(akik)** wrote on 2019-06-24T16:29:19.521858+00:00_

I'm using python 3 to access CloudSigma resources.

There are two python libraries that can be used to access CloudSigma, libcloud and pycloudsigma.
Neither have functions to deal with VM instance ssh public keys. There are REST API paths
/api/2.0/keypairs/ and /api/2.0/pubkeys/ but they are not in either of the libraries' code)

I can't add the ssh_public_key to the VM metadata because it's a reserved word.
"! Reserved meta keys are: Description, ssh_public_key, optimize_for."
If I try to add it, it just disappears in the web dashboard.

The only choice for me seems to be using CloudSigma's web dashboard to attach the ssh public key
to the VM instance and that's not what I would like to do.

rharper on irc suggested to patch DataSourceCloudSigma.py to change

self.ssh_public_key = server_meta['ssh_public_key'] to
self.ssh_public_key = server_meta.get('ssh_public_key', '')

and it seems to work.

I've included the cloud-init collect-logs tar package.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.