我要评分
获取效率
正确性
完整性
易理解

Installing Heat

Heat provides template-based orchestration services. Install Heat on the controller node.

  1. Create a database, a service credential, and API endpoints.
    1. Log in to the database as the root user.
      mysql -u root -p
    2. In the database, create a Heat database and grant permissions.
      CREATE DATABASE heat; 
      GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' IDENTIFIED BY 'HEAT_DBPASS'; 
      GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' IDENTIFIED BY 'HEAT_DBPASS'; 

      Replace HEAT_DBPASS with the password of the Heat database user. The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()

    1. Exit the database.
      exit
    2. Create a service credential and a Heat user, and add the admin role to the user.
      source ~/.admin-openrc 
      openstack user create --domain default --password-prompt heat
      openstack role add --project service --user heat admin 

      The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()

    3. Create the Heat and heat-cfn services and their corresponding API endpoints.
      openstack service create --name heat --description "Orchestration" orchestration
      openstack service create --name heat-cfn --description "Orchestration"  cloudformation
      openstack endpoint create --region RegionOne orchestration public http://controller:8004/v1/%\(tenant_id\)s
      openstack endpoint create --region RegionOne orchestration internal http://controller:8004/v1/%\(tenant_id\)s
      openstack endpoint create --region RegionOne orchestration admin http://controller:8004/v1/%\(tenant_id\)s
      openstack endpoint create --region RegionOne cloudformation public http://controller:8000/v1
      openstack endpoint create --region RegionOne cloudformation internal http://controller:8000/v1
      openstack endpoint create --region RegionOne cloudformation admin http://controller:8000/v1
    4. Create additional information about stack management, including heat domain and its admin user heat_domain_admin, heat_stack_owner role, and heat_stack_user role.
      openstack domain create --description "heat stack" heat
      openstack user create --domain heat --password-prompt heat_domain_admin
      openstack role add --domain heat --user-domain heat --user heat_domain_admin admin
      openstack role create heat_stack_owner
      openstack role create heat_stack_user

      The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()

  2. Install the Heat software package.
    yum install openstack-heat-api openstack-heat-api-cfn openstack-heat-engine
  3. Modify the Heat configuration file.
    1. Open the file.
      vi /etc/heat/heat.conf
    2. Press i to enter the insert mode and add the following content:
      [DEFAULT]
      transport_url = rabbit://openstack:RABBIT_PASSWORD@controller
      heat_metadata_server_url = http://controller:8000
      heat_waitcondition_server_url = http://controller:8000/v1/waitcondition
      stack_domain_admin = heat_domain_admin
      stack_domain_admin_password = HEAT_DOMAIN_PASSWORD
      stack_user_domain_name = heat
      [database]
      connection = mysql+pymysql://heat:HEAT_DBPASS@controller/heat
      # Configure Keystone authentication information. The configuration file does not contain the [keystone_authtoken] module parameters by default. You need to add them.
      [keystone_authtoken]
      www_authenticate_uri = http://controller:5000
      auth_url = http://controller:5000
      memcached_servers = controller:11211
      auth_type = password
      project_domain_name = default
      user_domain_name = default
      project_name = service
      username = heat
      password = HEAT_PASSWORD
      [trustee]
      auth_type = password
      auth_url = http://controller:5000
      username = heat
      password = HEAT_PASSWORD
      user_domain_name = default
      [clients_keystone]
      auth_uri = http://controller:5000

      Modify the following parameters as required:

      • Replace HEAT_DBPASS with the password of the Heat database.
      • Replace HEAT_PASSWORD with the password of the Heat user.
      • Replace HEAT_DOMAIN_PASSWORD with the password of the heat_domain_admin user.
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  4. Initialize the Heat database table.
    su -s /bin/sh -c "heat-manage db_sync" heat
  5. Start the Heat service.
    systemctl enable openstack-heat-api.service openstack-heat-api-cfn.service openstack-heat-engine.service
    systemctl start openstack-heat-api.service openstack-heat-api-cfn.service openstack-heat-engine.service