ssh_key_pair in HOT template

asked 2014-11-19 02:18:32 -0600

Pradip gravatar image

updated 2014-11-19 03:11:54 -0600


Here is a snippet of my HOT template:

# The compute (nova inst)
    type: OS::Nova::Server
      flavor: {get_param: flavor}
      image: {get_param: imageId}
      key_name: {get_param: ssh_key_pair}
      name: {get_param: VMname}

I am passing the ssh_key_pair as: ssh_key_pair=oskey in the input

heat stack-create my_stack_1 -f my_templates/t4.yml -P "imageId=f66d11c7-cebd-447c-95af-a4573248945a;ssh_key_pair=oskey"

However it does not work.

In CLI when I am using it as follows:

nova boot --flavor 2 --key_name oskey --image 666d3e94-0e16-416a-bb94-325ee081fd1e myvm1

It is working correct.

This is how I created the key-pair:

 o  nova keypair-add oskey > oskey.priv
 o  chmod 600 oskey.priv

Please suggest.

edit retag flag offensive close merge delete


I guess you don't need to give imageId infact give LinuxDistribution name because image is already in glance and change ssh_key_pair to KeyName

Syed Awais Ali gravatar imageSyed Awais Ali ( 2014-11-19 03:36:53 -0600 )edit

What error do you get when calling:

heat stack-create my_stack_1 -f my_templates/t4.yml -P "imageId=f66d11c7-cebd-447c-95af-a4573248945a;ssh_key_pair=oskey"

I see that your template contains also "flavor" as parameter but I don't see that you pass it in the "stack-create"

ZJ gravatar imageZJ ( 2014-11-19 11:32:47 -0600 )edit


I am not getting any error. The thing is: after creating the nova instance as compute, when I am trying to login the VM, the login is failing telling SSH key not found. I created the OS::Nova::Server inside the template. However using nova boot CLI, I can able to login to the myvm1. --pradip

Pradip gravatar imagePradip ( 2014-11-19 21:26:48 -0600 )edit

Ali, KeyName, I guess is oskey which I am passing. Or you meant the FingerPrint:

stack@localhost:~/devstack$ nova keypair-list +-------+-------------------------------------------------+ | Name | Fingerprint | +-------+-------------------------------------------

Pradip gravatar imagePradip ( 2014-11-19 21:29:55 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2014-11-20 01:22:53 -0600

ZJ gravatar image


how you try to log-in? from dashboard console or from CLI mode? Can you paste error and command which you are using? Additional you can check your instance log (on dashboard or from CLI (command "nova console-log <instance_id>") and check for erros connected with SSH key injection.

edit flag offensive delete link more

answered 2014-11-19 03:22:32 -0600

First you need to see whether your template is valid, run this command heat template-validate --template-file /PATH_TO_HEAT_TEMPLATES/t4.yml, lets see if its valid

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2014-11-19 02:18:32 -0600

Seen: 480 times

Last updated: Nov 19 '14