<div>Thank you Scott for your answer</div><div>Now I think I have full understanding  of this case.</div><div><br></div><div>Without keys openssh server would reset ssh session immediately.</div><div> </div><div><br><br><div class="gmail_quote">
On Fri, May 25, 2012 at 6:01 PM, Scott Moser <span dir="ltr"><<a href="mailto:smoser@ubuntu.com" target="_blank">smoser@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, 25 May 2012, Anton Haldin wrote:<br>
<br>
> Thank you very much guys  Sébastien and Leander<br>
><br>
> It was very interesting case.<br>
><br>
> I thought if I see this lines in compute.log then sshkey  injection was<br>
> successfully<br>
<br>
</div>Given functional metadata service,<br>
ssh key injection from the host is not necessary for ubuntu images.<br>
<div class="im"><br>
><br>
> And I was sure I have few vms  with metadata server access issue and<br>
> without ssh connection issue .<br>
<br>
</div>Ubuntu cloud images do not have any ssh HostKey generated inside them<br>
(/etc/ssh/ssh_host_{ecdsa,dsa,rsa}_key). The keys are generated by<br>
cloud-init after it finds a metadata service.  Without a metadata service,<br>
they do not get generated.  ssh will drop your connections immediately<br>
without HostKeys.<br>
<br>
This is arguably a bug, and there is an open bug to have the keys<br>
generated independent of ability to find a metadata service<br>
(<a href="http://pad.lv/906669" target="_blank">http://pad.lv/906669</a>).<br>
<div class="im"><br>
> It looks like I need some additional tests and need more time for code<br>
> reading : - )<br>
<br>
</div>Fix the metadata issue, you're going to want it.<br>
<br>
Alternatively, use configdrive<br>
(<a href="http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/configdrive/README" target="_blank">http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/configdrive/README</a>)<br>

</blockquote></div><br></div>