Skip to content

Latest commit

 

History

History
99 lines (76 loc) · 2.13 KB

0011-draft-deploy-instances-using-heat.md

File metadata and controls

99 lines (76 loc) · 2.13 KB
Title Date Status Category Tags
Deployment using OpenStack Heat
2016-09-11
draft
OpenStack
heat, openstack

Prerequisites

If installing with PackStack, you can install OpenStack Heat by specifying --os-heat-install=y on the command-line as parameter, or setting CONFIG_HEAT_INSTALL=y in your answers file.

On the client node, you need the following tools:

$ yum install -y python-virtualenv
$ virtualenv venv
$ source venv/bin/activate
(venv) $ pip install python-heatclient

Example deployment

Use the file create-instance.yml

heat_template_version: 2016-04-08

description: A simple template to deploy Cirros as a single compute instance

parameters:
  image:
    type: string
    label: Image name or ID
    description: Image to be used for compute instance
    default: cirros
  flavor:
    type: string
    label: Flavor
    description: Type of instance (flavor) to be used
    default: m1.small
  key:
    type: string
    label: Key name
    description: Name of key-pair to be used for compute instance
    default: my_key
  private_network:
    type: string
    label: Private network name or ID
    description: Network to attach instance to.
    default: private

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      image: { get_param: image }
      flavor: { get_param: flavor }
      key_name: { get_param: key }
      networks:
        - network: { get_param: private_network }

outputs:
  instance_ip:
    description: IP address of the instance
    value: { get_attr: [my_instance, first_address] }

and create the stack:

(venv) $ heat stack-create my_stack -f create-instance.yaml -P "key=gbraad;image=Fedora-23"

To see the output of the heat stack:

(venv) $ heat stack-show my_stack

Resource Group

(venv) $ heat stack-create my_group -f create-instance-group.yaml -e environment-create-instance.yaml

Templates

The templates used in this hands-on-labs are available at:

References