dilluns, 17 d’abril del 2017

Open Stack Orchrestation HEAT

HEAT is the OpenStack Module to provide rapid creation with templates. Whith temaplates you can build a ylm file whit all the specification neeeded to launch a complete tenant user whit all the components that a Open stack has such us networinkn, Load Balancers etc alll in a simple configuration file.

Heat allow to put parameters to be full filled for the end user once he launch a Open Stack.

REVERSE ENGINERING

However a very common user case is when a user already has a Open Stack tenant created and he want to redeploy the same envirotmetn or just to have a backup envirtoment file. Open Stack does not have a way to export as a Heat file directly. For that we can use a flame utlity to create the heat file yaml

sudo pip install python-flameclient
source xx-openrc.sh
flame --insecure >> yourfile.heat

The file created can be imported using horizont. The only issue we have detected is the allocation of the floats ips.

Sample file

### Heat Template ###
description: Generated template
heat_template_version: 2013-05-23
parameters:
  external_network_for_floating_ip_0:
    default: 1fd0a21e-e700-46ae-9f05-0b3164daafcc
    description: Network to allocate floating IP from
    type: string
  router_0_external_network:
    default: 1fd0a21e-e700-46ae-9f05-0b3164daafcc
    description: Router external network
    type: string
  server_0_flavor:
    default: m1.smaller
    description: Flavor to use for server server_0
    type: string
  server_0_image:
    default: 76f5f4aa-a78f-4703-b738-cab967957431
    description: Image to use to boot server server_0
    type: string
resources:
  floatingip_0:
    properties:
      floating_network_id:
        get_param: external_network_for_floating_ip_0
    type: OS::Neutron::FloatingIP
  floatingip_association_0:
    properties:
      floating_ip:
        get_resource: floatingip_0
      server_id:
        get_resource: server_0
    type: OS::Nova::FloatingIPAssociation
  key_0:
    properties:
      name: jordi
      public_key: ssh-rsa AAAAB3 ...
        Generated-by-Nova
    type: OS::Nova::KeyPair
  network_0:
    properties:
      admin_state_up: true
      name: jordinet
      shared: false