/srv/irclogs.ubuntu.com/2013/12/24/#cloud-init.txt

=== harlowja is now known as harlowja_away
=== shardy_afk is now known as shardy
kwadronautprobably a more common situation:13:22
kwadronautdebian vm (in an openstack environment) gets launched from a base image, generates new sshd keys, so far so good.13:22
kwadronautbut when snapshotting and resetting, it generates new keys again, but shouldn't.13:23
kwadronaut(it gets a new instance-id)13:23
harmwif it wouldn't do that, you'd endup with multiple hosts using the same sshd keys13:23
kwadronautwhat'd be the recommended way to deal with that?13:23
harmwwhich would be insecure13:24
kwadronauttrue, but snapshot → revert, means we also remove the original one.13:24
harmwhm, so reverting an instance would endup destroying it and creating a new one?13:29
kwadronautlet me put it differently13:29
kwadronauti have a base image, from which i launch new instances. they always get fresh sshd keys. That's good.13:30
kwadronautnow, i want to snapshot an instance from some known 'good' state, then I give access to someone so she can play with it, make modifications by hand, make mistakes,...13:31
kwadronautso we end up with a vm with lots of hand-labor, and want to go back to the first 'good' state. but keeping the sshd_keys.13:31
kwadronautbasically, we boot from the snapshot and destroy the original one.13:32
kwadronautso yes, that means a new instance-id from openstacks pov, but not from the developers point of view.13:32
kwadronautAm I making myself more clear?13:33
harmwyes :)13:35
kwadronautam i making sense? ;-)13:36
harmwhm, so cloudinit should keep its hands off the sshd keys13:36
kwadronauti could of course purge cloud-init after the first run ;-)13:36
harmwunless it's already capable of doing just that, it shouldn't be that hard to built13:37
kwadronautbut then, there are other modules…13:37
harmwthat'll work, ofc :)13:37
harmwfor now I'd suggest looking through the docs on cloud-init.cfg13:37
harmwhttp://cloudinit.readthedocs.org/en/latest/topics/examples.html#configure-instances-ssh-keys13:38
harmwthis will force the instance to come up with the specified keys13:38
kwadronautyes, but that means getting them off the instances first in the admins computers.13:40
kwadronautopening extra attack vectors :-(13:40
harmwno, instead of having cloud-init generate keys for you, you do that for cloud-init13:41
kwadronauthmmmmm so you suggest that i do that with user-data on the first run?13:42
harmweg. cloud-init (or even sshd startupscripts) have logic to run ssh-key-gen (?) which generates the keys found in /etc/ssh/13:42
kwadronautcorrect13:42
harmwyep, cloud-init will see -you- want to have specific sshd keys assigned with this instance and as such it will configure those (instead of generating random keys)13:43
kwadronauthmhm 13:45
kwadronautnot entirely happy13:46
harmwwhy not :)13:50
=== harlowja_away is now known as harlowja
=== harlowja is now known as harlowja_away

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!