Heat Orchestration 服務是為了 OpenStack 雲,提供一種基於樣板的編制工程方式,用於建立、管理雲端架構資源!
Hear Orchestration 服務,由下列幾項元件組成:
- heat-cfn
- heat-api
- heat-api-cfn
- heat-engine
- heat-api-cloudwatch
- heat-cfntools 以及 cloud-init 套件
- # source /root/keystonerc_admin
- # yum list openstack-heat* python-heatclient heat-cfntools
- # grep 10.1.1.1 /etc/heat/heat.conf
- # keystone user-get heat
- # keystone service-get heat
- # keystone catalog --service orchestration
- # keystone user-get heat-cfn
- # keystone service-get heat-cfn
- # keystone catalog --service cloudformation
- # keystone user-role-list --user heat --tenant services
- # openstack-service status heat
設定Heat Orchestration 服務
設定檔包含項目:
- 建立預設的 Nova 浮動IP池,Heat 將會從這個池分配浮動IP
- 指定預設的浮動IP池
- 設定 DNS 轉址
- 建立各式 Nova 樣板,管理員可以用於 Heat 樣板中
- 建立 Heat 可用的 Keystone 使用者
- # source /root/keystonerc_admin
- # nova floating-ip-pool-list
- # crudini --get /etc/nova/nova.conf DEFAULT default_floating_pool
- # crudini --set /etc/nova/nova.conf DEFAULT default_floating_pool public
- # openstack-service restart nova
- # crudini --set /etc/neutron/dhcp_agent.ini DEFAULT dnsmasq_dns_servers 10.1.1.254
- # openstack-service restart neutron --> 另一部主機也需要做
- # nova flavor-create web.tiny auto 1024 20 1
- # keystone tenant-create --name heatproject
- # keystone user-create --name heatuser --pass redhat
- # keystone user-role-add --user heatuser --role _member_ --tenant heatproject
- # keystone user-role-add --user heatuser --tenant heatproject --role heat_stack_owner
- # vim /root/keystonerc_heatuser
- # source /root/keystonerc_heatuser
- # glance image-list
- # neutron net-list
- # neutron net-create net1
- # neutron subnet-create --name subnet1 net1 192.168.0.0/24
- # neutron router-create router1
- # neutron router-gateway-set router1 public
- # neutron router-interface-add router1
- # nova keypair-add --pub-key /root/.ssh/id_rsa.pub heatkey
- # nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
- # nova secgroup-add-rule default tcp 80 80 0.0.0.0/0
- # nova secgroup-add-rule default tcp 443 443 0.0.0.0/0
- # nova secgroup-add-rule default tcp 3306 3306 0.0.0.0/0
- # nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
啟動與驗證 Stack
太複雜,先跳過...
練習3:
- 先編好一個檔案:multi.template
- # source /root/keystonerc_heatuser
- # neutron subnet-list
- # neutron net-list
- # vim /root/env.yaml
parameters:
key_name: heatkey
public_net_id: <上一項指令的ID>
private_net_id: <上一項指令的ID>
private_subnet_id: <上兩項指令的ID>
- # heat stack-create -r -f multi.tempate -e /root/env.yaml multi
- # heat stack-list
- 在一部主機上 # virsh list
- # heat stack-show multi
- # heat event-list multi
- # nova list
- # ssh root@10.1.1.10
- # ssh ec2-user@10.1.1.10
- $ su -
- # systemctl status httpd.service
- # exit
- $ exit
- # ssh ec2-user@10.1.1.11
- $ sudo systemctl status mariadb.service
- $ exit
- 移除 Stack
- # heat stack-delete multi
練習4: