On Dec 3, 2013, at 5:40 PM, Markos Gogoulos <[email protected]> wrote:

> 
> 
> We've run into this issue while creating nodes for HP Cloud
> (OpenStack). While the nodes were successfully being created, deploy
> node would fail, with an error "Bad authentication type
> (allowed_types=['publickey'])". After digging more into this, it turns
> that libcloud ssh (libcloud/compute/ssh.py) tries to ssh with password,
> despite the fact that we specify ssh key on deploy_node.

I don't know about the openstack driver but I believe it should work fine.

With the cloudstack driver I deploy node that use ssh keys (no password) like 
this:

node=conn.deploy_node(name='test000',image=image,size=size,ssh_key="~/.ssh/id_rsa_",ex_keyname='exoscale',deploy=msd)

so you need to set the keypair with ex_keyname (I think it's the same in OS).
but also set the ssh_key path, otherwise it will try to use the password…

just 2 cents

> 
> 
> libcloud/compute/ssh.py 
> 
> def connect(self):
> ...
> 
> if
> self.password:
> conninfo['password'] = self.password
> elif self.key:
> 
> conninfo['key_filename'] = self.key
> else:
> conninfo['allow_agent'] =
> True
> conninfo['look_for_keys'] = True
> 
> So seems that passwords have a
> priority. I'd like to know if there's a reason for this, because we had
> to change it and give priority to keys (HP Cloud does not allow
> passwords, so it fails to connect and deploy the node). After we change
> the above code and allow it to try with ssh keys, deploy node completes
> without issues! 
> 
> Cheers 

Reply via email to