Heat - Orchestration asennus

controller.foo.bar



1. Luodaan heat-tunnus.

# keystone user-create --name heat --pass heat
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|  email   |                                  |
| enabled  |               True               |
|    id    | 014a4d2e2fee4453b3c33cbcb2f7f8b6 |
|   name   |               heat               |
| username |               heat               |
+----------+----------------------------------+

2. Lisätään heat-tunnukselle admin-rooli ja lisätään tunnus service tenant-ryhmään.

# keystone user-role-add --user heat --tenant service --role admin
(Tämä komento ei oikeinkirjoitettuna tulosta mitään)

3. Luodaan heat_stack_owner -rooli.

# keystone role-create --name heat_stack_owner
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | 817e32d9c95e4ba4a3f0af08b09d35bb |
|   name   |         heat_stack_owner         |
+----------+----------------------------------+

4. Lisätään demo-tunnukselle heat_stack_owner rooli.

# keystone user-role-add --user demo --tenant demo --role heat_stack_owner
(Tämä komento ei oikeinkirjoitettuna tulosta mitään)

5. Luodaan heat_stack_user -rooli.

# keystone role-create --name heat_stack_user
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | a539e7bbf41f44b6a21a4e80bd87fbdb |
|   name   |         heat_stack_user          |
+----------+----------------------------------+

6. Luodaan heat-service ja servicen tyypiksi orchestration.

# keystone service-create --name heat --type orchestration --description "Orchestration"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |          Orchestration           |
|   enabled   |               True               |
|      id     | f3e628d57e92498fa26366e9616c994b |
|     name    |               heat               |
|     type    |          orchestration           |
+-------------+----------------------------------+

7. Luodaan heat-cfn -service ja servicen tyypiksi cloudformation.

# keystone service-create --name heat-cfn --type cloudformation --description "Orchestration"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |          Orchestration           |
|   enabled   |               True               |
|      id     | 0b1aaa80c799470083e78f7da4b55d06 |
|     name    |             heat-cfn             |
|     type    |          cloudformation          |
+-------------+----------------------------------+

8. Luodaan orchestration endpoint.

# keystone endpoint-create --service-id $(keystone service-list | awk '/ orchestration / {print $2}') \
--publicurl 'http://10.0.0.11:8004/v1/%(tenant_id)s' \
--internalurl 'http:// 10.0.0.11:8004/v1/%(tenant_id)s' \
--adminurl 'http://10.0.0.11:8004/v1/%(tenant_id)s' --region regionOne
+-------------+-----------------------------------------+
|   Property  |                  Value                  |
+-------------+-----------------------------------------+
|   adminurl  |  http://10.0.0.11:8004/v1/%(tenant_id)s |
|      id     |     37c983072eed409888cdfdd30b8963d0    |
| internalurl | http:// 10.0.0.11:8004/v1/%(tenant_id)s |
|  publicurl  |  http://10.0.0.11:8004/v1/%(tenant_id)s |
|    region   |                regionOne                |
|  service_id |     f3e628d57e92498fa26366e9616c994b    |
+-------------+-----------------------------------------+

9. Luodaan cloudformation endpoint.

# keystone endpoint-create --service-id $(keystone service-list | awk '/ cloudformation / {print $2}') \
--publicurl http://10.0.0.11:8000/v1 \
--internalurl http://10.0.0.11:8000/v1 \
--adminurl http://10.0.0.11:8000/v1 --region regionOne
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |     http://10.0.0.11:8000/v1     |
|      id     | 4bdbd1e4fcf34d47b973fc84f5bc6ef7 |
| internalurl |     http://10.0.0.11:8000/v1     |
|  publicurl  |     http://10.0.0.11:8000/v1     |
|    region   |            regionOne             |
|  service_id | 0b1aaa80c799470083e78f7da4b55d06 |
+-------------+----------------------------------+

10. Asennetaan Heat.

# apt-get install heat-api heat-api-cfn heat-engine python-heatclient

11. Muokataan /etc/heat/heat.conf -tiedostoa:

[database]
connection = mysql://heat:heatdb@10.0.0.11/heat

[DEFAULT]
rpc_backend = heat.openstack.common.rpc.impl_kombu
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = openstack
heat_metadata_server_url = http://10.0.0.11:8000
heat_waitcondition_server_url = http://10.0.0.11:8000/v1/waitcondition
verbose = True

[filter:authtoken]
auth_uri = http://10.0.0.11:5000/v2.0
identity_uri = http://10.0.0.11:35357
admin_tenant_name = service
admin_user = heat
admin_password = heat

[ec2authtoken]
auth_uri = http://10.0.0.11:5000/v2.0


12. Synkronoidaan heat -tietokanta.

# heat-manage db_sync

13. Uudelleenkäynnistetään heat-api, cfn, ja engine.

# service heat-api restart
# service heat-api-cfn restart
# service heat-engine restart


14. Luodaan heat-template heat-stack.yaml

heat_template_version: 2014-10-16
description: A simple server.
parameters:
ImageID:
type: string
description: Image use to boot a server
NetID:
type: string
description: Network ID for the server
resources:
server:
type: OS::Nova::Server
properties:
image: { get_param: ImageID }
flavor: m1.tiny
networks:
- network: { get_param: NetID }
outputs:
private_ip:
description: IP address of the server in the private network
value: { get_attr: [ server, first_address ] }


15. Luodaan testi-stack.

# heat stack-create -f heat-stack.yaml -P "ImageID=cirros-0.3.3-x86_64;NetID=$(nova net-list | awk '/ demo-net / { print $2 }')" testStack
+--------------------------------------+------------+--------------------+----------------------+
| id                                   | stack_name | stack_status       | creation_time        |
+--------------------------------------+------------+--------------------+----------------------+
| de69c4bb-e3e2-4aed-8c8b-3875f2ea7f78 | testStack  | CREATE_IN_PROGRESS | 2016-10-15T08:48:19Z |
+--------------------------------------+------------+--------------------+----------------------+

16. Tarkastetaan instanssin tila.

# heat stack-list
+--------------------------------------+------------+-----------------+----------------------+
| id                                   | stack_name | stack_status    | creation_time        |
+--------------------------------------+------------+-----------------+----------------------+
| 8216712c-6899-4a43-bce9-034744509d37 | testStack  | CREATE_COMPLETE | 2016-10-15T08:50:06Z |
+--------------------------------------+------------+-----------------+----------------------+