Ask Your Question
0

Problem to login with ssh key using heat template [closed]

asked 2016-07-06 16:59:48 -0500

Eduardo Stephan gravatar image

updated 2016-07-06 23:08:26 -0500

uts9 gravatar image

Hi guys,

I am new with OpenStack and I don't know how to solve this problem. I checked here and didn't find anything similar.

I created two VMs using the same Linux image. One using the HEAT template and another manually.

Both using the same key pair. the VM that I created manually, I am able to login using key pair (ubuntu and fedora account), but the one that I used the heat template does not allow me to login. I got a message "Server refuse our key"

I am trying to connect using putty

This is my template:

heat_template_version: 2013-05-23
description: Heat template to spin up small VM + floating ip using existing network
parameters:
  public_network:
    type: string
    label: ext-net
    description: Public network with floating IP addresses.
    default: 

  private_net_id:
    type: string
    description: ID of the internal network
    default: 

  private_subnet_id:
    type: string
    description: ID of private sub network into which servers get deployed
    default: 1e169801-f902-4b2d-9f5f-c6ad14c1c189

resources:
  server_port:
    type: OS::Neutron::Port
    properties:
      network_id: { get_param: private_net_id }
      fixed_ips:
        - subnet_id: { get_param: private_subnet_id }
      security_groups:
        - 0093ad96-0fca-42d2-beee-61e80488e7ed

  instance0:
    type: OS::Nova::Server
    properties:
      name: ubuntu01
      image: 0ac1ac59-f5d2-4e55-8c09-73c8adaf19eb
      flavor: m1.small
      key_name: cloud
      networks:
        - port: { get_resource: server_port }

  floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network: { get_param: public_network }

  floating_ip_assoc:
    type: OS::Neutron::FloatingIPAssociation
    properties:
      floatingip_id: { get_resource: floating_ip }
      port_id: { get_resource: server_port }

outputs:
  instance0_ip:
    description: IP address of instance0 in provider network
    value: { get_attr: [ instance0, first_address ] }
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by zaneb
close date 2016-07-29 11:31:29.431262

Comments

2 answers

Sort by ยป oldest newest most voted
1

answered 2016-07-08 12:42:13 -0500

Eduardo Stephan gravatar image

Thanks guys,

I found the solution in this post:

https://ask.openstack.org/en/question/31249/heat-virtual-machines-inaccessible/?answer=61157#post-id-61157 (https://ask.openstack.org/en/question...)

edit flag offensive delete link more
1

answered 2016-07-07 03:46:52 -0500

dbaxps gravatar image

updated 2016-07-07 04:08:46 -0500

Try to follow steps suggested by larsks in his post http://blog.oddbit.com/2013/12/06/an-...

parameters:
  key_name:
    type: string
    default: lars
    description: Name of an existing key pair to use for the instance
  flavor:
    type: string
    description: Instance type for the instance to be created
    default: m1.small
    constraints:
      - allowed_values: [m1.nano, m1.tiny, m1.small, m1.large]
        description: Value must be one of 'm1.tiny', 'm1.small' or 'm1.large'
  image:
    type: string
    default: cirros
    description: ID or name of the image to use for the instance
  private_net_id:
    type: string
    description: Private network id
  private_subnet_id:
    type: string
    description: Private subnet id
  public_net_id:
    type: string
    description: Public network id

With the template in a file called template.yml and the parameters in a file called environment.yml, we could deploy an instance like this:

heat stack-create -f template.yml \
  -e environment.yml mystack
edit flag offensive delete link more

Comments

Hi dbaxps,

I used this site as a reference when I was creating my template, but I will try again. Thanks.

The weird thing is that I can make the key pair works when I creating VMs manually.

Eduardo Stephan gravatar imageEduardo Stephan ( 2016-07-08 12:00:19 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-07-06 16:59:48 -0500

Seen: 980 times

Last updated: Jul 08 '16