Ask Your Question
0

Heat Template installation are not happening

asked 2015-02-26 23:30:20 -0600

anonymous user

Anonymous

updated 2015-04-10 14:04:43 -0600

zaneb gravatar image

Hi All

I have created a heat template which is as follows :


heat_template_version: 2013-05-23

description: >
  Heat template to generate Logstash installation .Our Logstash / Kibana setup has four main components:Logstash,Elasticsearch,Kibana,Logstash    Forwarder.



parameters:

  instance_type:
    type: string
    description: Instance type for Logstash server
    default: m1.small
    constraints:
      - allowed_values: [m1.small, m1.medium, m1.large]
        description: instance_type must be one of m1.small, m1.medium or m1.large  
      key:
    type: string
    description: SSH key to connect to the servers




  image_id:
    type: string
    description: ID of the image to use for the Logstash server
    default: fedora_cloud 
    constraints:
      - allowed_values: [ fedora_cloud ]
        description: >
          Image ID must be fedora_cloud  
  Logstash_server_cidr:
    type: string
    description: Logstash app network address (CIDR notation)
    default: 13.13.1.0/24
  Logstash_server_gateway:
    type: string
    description: app network gateway address
    default: 13.13.1.1
  Logstash_server_pool_start:
    type: string
    description: Start of Logstash app network IP address allocation pool
    default: 13.13.1.4
  Logstash_server_pool_end:
    type: string
    description: End of  Logstash app network IP address allocation pool
    default: 13.13.1.34
  Logstash_client_cidr:
    type: string
    description: Logstash client network address (CIDR notation)
    default: 14.14.5.0/24
  Logstash_client_pool_start:
    type: string
    description: Start of Logstash client app network IP address allocation pool
    default: 14.14.5.4
  Logstash_client_pool_end:
    type: string
    description: End of Logstash client app network IP address allocation pool
    default: 14.14.5.20

  public_net_id:
    type: string
    description: The ID of the public network. You will need to replace it with your DevStack public network ID
    default: 8da258bb-0546-4654-bec9-10e6e58b684e
  Logstash_server_name:
    type: string
    label: Logstash account username
    description: Username of the Logstash account to use for notifications.
  Logstash_client_name:
    type: string
    label: Logstash client account username
    description: Username of the Logstash account to use for notifications.
  Logstash_server_ip:
    type: string
    label: Logstash server ip so that client can access it.
    description: Server Ip of the Logstash server to use for client.






resources:

  Logstash_server_network:
      type: OS::Neutron::Net
      properties:
        admin_state_up: true
        name: Logstash_server_network
        shared: true
        tenant_id: admin

  Logstash_server_network_subnet:
      type: OS::Neutron::Subnet
      properties:
        network_id: { get_resource: Logstash_server_network}
        cidr: { get_param: Logstash_server_cidr} 
        gateway_ip: { get_param: Logstash_server_gateway}
        dns_nameservers: [8.8.8.8, 8.8.4.4]
        allocation_pools:
          - start: { get_param: Logstash_server_pool_start }
            end: { get_param: Logstash_server_pool_end }

  Logstash_client_network:
      type: OS::Neutron::Net
      properties:
        admin_state_up: true
        name: Logstash_client_network
        shared: true
        tenant_id: admin

  Logstash_client_subnet:
      type: OS::Neutron::Subnet
      properties:
        network_id: { get_resource: Logstash_client_network }
        cidr: { get_param: Logstash_client_cidr} 
        allocation_pools:
          - start: { get_param: Logstash_client_pool_start }
            end: { get_param: Logstash_client_pool_end }
  router:
      type: OS::Neutron::Router

  router_gateway:
      type: OS::Neutron::RouterGateway
      properties:
        router_id: { get_resource: router }
        network_id: { get_param: public_net_id }

  router_interface:
      type: OS::Neutron::RouterInterface
      properties:
        router_id: { get_resource: router }
        subnet_id: { get_resource: Logstash_server_network_subnet}

  Logstash_server_instance:
    type: OS::Nova::Server
    properties:
      image: { get_param: image_id }      
                key_name: {get_param: key}
      flavor: { get_param: instance_type }
      networks:
        - port: { get_resource: Logstash_server_app_port }
        - network: { get_resource: Logstash_client_network}
      user_data:
        str_replace:
          params:
            Logstash_server_name: { get_param: Logstash_server_name }



          template: |
            #!/bin/bash -ex

            # install dependencies
            # Install java 7 as elastic search recommends it. Plus prerequisites
            mkdir logstash











  Logstash_client_instance:
    type: OS::Nova::Server
    properties:
      image: { get_param: image_id }
      key_name: {get_param: key}
      flavor: { get_param: instance_type }
      networks:
        - network: { get_resource: Logstash_server_network}
      user_data:
        str_replace:
          params:
            Logstash_client_name: { get_param: Logstash_client_name }
            Logstash_server_ip: { get_param: Logstash_server_ip }



          template: |
            #!/bin/bash -ex

            # Generate SSL certificates
            sudo mkdir -p /etc/pki ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-03-23 00:48:19 -0600

Qiming gravatar image

There are quite some questions.

The default devstack installation will create routers and rules that allow VMs to access the public network. If your VM cannot access Internet or public network, you may want to start with booting a VM using nova and try if that works.

To do some past-launch configurations, you may want to start with some basic templates in the heat-templates project. Those templates show you how to do software installation/configuration using cloud-init, cfntools, software-config etc.

As for image for testing, you may want to check if this image can help save you some time: http://tarballs.openstack.org/heat-te...

For most cloud images, the user/password authentication is by default disabled. You will need some ssh key mechanism for logging into those VMs. The default username could be 'ec2-user', 'cloud-user', 'fedora', depending on the image you are using.

edit flag offensive delete link more
0

answered 2015-04-11 16:19:34 -0600

pas-ha gravatar image

updated 2015-04-11 16:20:47 -0600

1) boot a simplest cirros image (it has a local login and password configured, you can access it via vnc console from the Horizon), log into it and try pinging say Google by IP or name, if it works it is ok (most package managers work with names, not with IPs, so this check is important). If some part of the check fails - you have to figure out what is the routing or DNS lookup problem in your DC (or are you on DevStack? there is a specific trick for that). To access the VM via SSH generally you need a floating IP on it, and a security group that is assigned to this instance must allow incoming traffic on ssh port.

2) About user_data - you do not specify the "user_data_format" property in the server template. The default in Heat is HEAT_CFNTOOLS, which accepts data only in a very specific, CFN CloudInit-compatible structured data format (Heat can provide it via "AWS::CloudFormation::Init" section in the metadata). If you want to pass raw shell scripts to the instance, you should use "user_data_format: RAW".

3) generally you do not need a cfntools-enabled image, only an image with cloud-init (most of stock cloud images like Ubuntu, Fedora etc are such), and see my previous answer, use "user_data_format: RAW" in your templates. The cloud images are generally to be accessed via ssh, with the key that you have created in /uploaded to Nova and specified to be put on instance with nova boot or in the Heat template, with user name depending on the actual image used.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-02-26 23:30:20 -0600

Seen: 389 times

Last updated: Apr 11 '15