Installing the Heat OpenStack Orchestration service

Heat is the OpenStack Orchestration service and provides a template-based system to define environments and resources in OpenStack. It is said that the Dragon Operator only ever needed OpenStack Heat and the nascent energies of the Universe to deploy on OpenStack. With Heat, you can describe Compute resources, the installation of software, and the relationship with Load Balancers and databases.

Getting ready

Ensure that you have a suitable server running the OpenStack components. If you are using the accompanying Vagrant environment, as described in the Preface, we will use the same controller node.

Ensure that you are logged into the controller node in our environment. If you created this node with Vagrant, you can execute the following command:

vagrant ssh controller

How to do it...

To install Heat, carry out the following steps on the controller node:

  1. We create a heat database using the following commands:
    MYSQL_ROOT_PASS=openstack
    
    mysql -uroot 
        -p$MYSQL_ROOT_PASS
        -e 'CREATE DATABASE heat;'
    
  2. We create a heat user with the password openstack and with privileges to use this database:
    MYSQL_HEAT_PASS=openstack
    
    mysql -uroot -p${MYSQL_ROOT_PASS} 
        -e "GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' IDENTIFIED BY '${MYSQL_HEAT_PASS}';"
    
    mysql -uroot -p${MYSQL_ROOT_PASS} 
        -e "GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' IDENTIFIED BY '${MYSQL_HEAT_PASS}';"
    
  3. Keystone needs to be aware of Heat, so first ensure that there are Keystone credentials for the Heat service by executing the following commands:
    keystone user-create 
        --name=heat 
        --pass=heat 
        --email=heat@localhost
    
    keystone user-role-add 
        --user=heat 
        --tenant=service 
        --role=admin
    
  4. We then add the following two services and endpoints for Heat in Keystone by executing the following commands:
    keystone service-create 
        --name=heat 
        --type=orchestration 
        --description="Heat Orchestration API"
    
    ORCHESTRATION_SERVICE_ID=$(keystone service-list 
        | awk '/ orchestration / {print $2}')
    
    keystone endpoint-create 
      --region RegionOne 
      --service-id=${ORCHESTRATION_SERVICE_ID} 
      --publicurl=http://172.16.0.200:8004/v1/$(tenant_id)s 
      --internalurl=http://172.16.0.200:8004/v1/$(tenant_id)s 
      --adminurl=http://172.16.0.200:8004/v1/$(tenant_id)s
    
    keystone service-create 
        --name=heat-cfn 
        --type=cloudformation 
        --description="Heat CloudFormation API"
    
    CLOUDFORMATION_SERVICE_ID=$(keystone service-list 
        | awk '/ cloudformation / {print $2}')
    
    keystone --insecure endpoint-create 
      --region RegionOne 
      --service-id=${CLOUDFORMATION_SERVICE_ID} 
      --publicurl=http://172.16.0.200:8000/v1/ 
      --internalurl=http://172.16.0.200:8000/v1 
      --adminurl=http://172.16.0.200:8000/v1
    
  5. We can now install the packages required for Heat using apt:
    sudo apt-get install heat-api heat-api-cfn heat-engine
    
  6. The Heat configuration file is /etc/heat/heat.conf. Edit this file to include the following lines:
    [DEFAULT]
    rabbit_host=172.16.0.200
    rabbit_port=5672
    rabbit_userid=guest
    rabbit_password=guest
    rabbit_virtual_host=/
    rabbit_ha_queues=false
    log_dir=/var/log/heat
    
    [database]
    backend=sqlalchemy
    connection = mysql://heat:[email protected]/heat
    
    [keystone_authtoken]
    auth_uri = https://192.168.100.200:35357/v2.0
    identity_uri = https://192.168.100.200:5000
    admin_tenant_name = service
    admin_user = heat
    admin_password = heat
    insecure = True
    heat_watch_server_url = http://192.168.100.200:8003
    heat_waitcondition_server_url = http://192.168.100.200:8000/v1/waitcondition
    heat_metadata_server_url = http://192.168.100.200:8000
    
    [clients]
    endpoint_type = internalURL
    
    [clients_ceilometer]
    endpoint_type = internalURL
    
    [clients_cinder]
    endpoint_type = internalURL
    
    [clients_heat]
    endpoint_type = internalURL
    
    [clients_keystone]
    endpoint_type = internalURL
    
    [clients_neutron]
    endpoint_type = internalURL
    
    [clients_nova]
    endpoint_type = internalURL
    
    [clients_swift]
    endpoint_type = internalURL
    
    [clients_trove]
    endpoint_type = internalURL
    
    [ec2authtoken]
    auth_uri = https://192.168.100.200:5000/v2.0
    
    [heat_api]
    bind_port = 8004
    
    [heat_api_cfn]
    bind_port = 8000
    
    [heat_api_cloudwatch]
    bind_port = 8003
  7. Before we can start the services, we must create the Heat database tables and initial entries with the following command:
    heat-manage db_sync
    
  8. We finally restart the services with the following commands:
    service heat-api restart
    service heat-api-cfn restart
    service heat-engine restart
    

How it works...

Heat, just as with any other OpenStack Service, requires credentials to be present in our database backend, with credentials and service endpoints defined in Keystone. We then use these credentials in the /etc/heat/heat.conf file that describes the service.

It is important to note that the initialization of the database with the heat-manage db_sync command is done before starting the services. This process prepares the table structure in our database for Heat to use.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset