Ask Your Question
0

Installing application using HEAT template

asked 2014-05-16 04:38:48 -0500

Manikantan gravatar image

I am able to launch instance in openstack using HEAT template. Would like to know if we can launch+install app on top of it. For ex: Using heat template to launch a CentOS instance and perform MySQL Server installation in it and revert. Most of the examples I see - talks about launching instance and installing APP on AWS. But would like to know whether it can be done on openstack (KVM hyperviser).

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2014-05-17 00:39:45 -0500

OldCrowEW gravatar image

sure. just issue the commands needed. yum install or apt-get.

edit flag offensive delete link more
3

answered 2014-05-17 02:56:52 -0500

Main Aim of Heat is to orchestrate complex deployments on openstack. Not just that you can install any app but you can also write user-data scripts to perform required configurations after installation of app. For example if you install mysql you can also make a user and assign any privileges to it. Just use the proper commands according to the flavor of Linux that you are using and you are done. No need to login to instance for configurations.

You can edit/make your template in order to get more parameters and place them in proper places in template to have configurations done.

hope that helps!!

edit flag offensive delete link more

Comments

Yes, even I am looking for such examples in the net. When I try to write a template and use it - wondering how it will take the source of the application and use it - for example: on KVM - how the stack install MySQL package in the CentOS instance launched?. Looking for help on this.

Manikantan gravatar imageManikantan ( 2014-05-22 03:29:38 -0500 )edit

The template follows a certain syntax and rules like first part indicates the description of template then comes parameters and so on. So Heat basically is the answer to your question "how stack install MySQL package in CentOS". Heat is specialized for the purpose of automatically configuring and an instance so that you no longer need to configure it manually.

Syed Awais Ali gravatar imageSyed Awais Ali ( 2014-05-26 00:37:47 -0500 )edit
0

answered 2014-07-17 05:50:35 -0500

Hi,

There are several ways to achieve a good working configuration, this is the method I use the most. "User_data" can take multiple formats but using 'raw' is simple to use.

Here in my example I build a server called PS and run what is essentially a bash script. This template also uses 'str_replace' to substitute values from the 'parameters' section of the Heat template.

PS:
    type: OS::Nova::Server
    properties:
      name: PS
      image: RGB_CloudImage_Build_6.3
      flavor: m1.RGB_large
      key_name: { get_param: Key_name }
      user_data: 
        str_replace:
           template: |
              #!/bin/bash -v
              yum -y install aim
              echo "oss_ip_address  OSS  OSS.rgbnetworks.com" >> /etc/hosts
              echo "ads_ip_address  ADS  ADS.rgbnetworks.com" >> /etc/hosts
              echo "10.5.0.20  AWE  AWE.rgbnetworks.com" >> /etc/hosts
              ip link set dev eth0 mtu 1450
              current_ip=`curl -s http://169.254.169.254/1.0/meta-data/local-ipv4`
              echo "$current_ip $current_hostname $current_hostname.rgbnetworks.com" >> /etc/hosts
              sed -i "s/client_host = ADS/client_host = AWE/" /opt/rgb/etc/abrain.config
              service aim restart
           params:
              ads_ip_address: { get_param: ADS_address }
              oss_ip_address: { get_param: OSS_address }
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-05-16 04:38:48 -0500

Seen: 1,933 times

Last updated: Jul 17 '14