虚机all in one环境测试安装heat
[root@armstrong ~]# tmux at -t mysql
MariaDB [(none)]> CREATE DATABASE heat;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' \
-> IDENTIFIED BY 'HEAT_DBPASS';
Query OK, rows affected (0.01 sec) MariaDB [(none)]> GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' \
-> IDENTIFIED BY 'HEAT_DBPASS';
Query OK, rows affected (0.00 sec) [root@armstrong ~]# source keystonerc_admin 创建heat用户
[root@armstrong ~(keystone_admin)]# openstack user create --domain default --password-prompt heat
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 0952d5ebdcaa43c288020364987503bf |
| name | heat |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
将heat用户加入amdin角色
[root@armstrong ~(keystone_admin)]# openstack role add --project services --user heat admin 创建heta和heat-cfb服务实体
[root@armstrong ~(keystone_admin)]# openstack service create --name heat --description "Orchestration" orchestration
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Orchestration |
| enabled | True |
| id | 3a423bcb425f4b0b814d53352eb2e16e |
| name | heat |
| type | orchestration |
+-------------+----------------------------------+
[root@armstrong ~(keystone_admin)]# openstack service create --name heat-cfn --description "Orchestration" cloudformation
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Orchestration |
| enabled | True |
| id | 56672ffcfef14ffbbb041287e16bb0dd |
| name | heat-cfn |
| type | cloudformation |
+-------------+----------------------------------+ [root@armstrong ~(keystone_admin)]# openstack service list
+----------------------------------+-----------+----------------+
| ID | Name | Type |
+----------------------------------+-----------+----------------+
| 0bf0839f5a2a4a8d99450f0473403b32 | keystone | identity |
| 3a423bcb425f4b0b814d53352eb2e16e | heat | orchestration |
| 4542364e029e4a2cb7320b0338a21177 | cinderv2 | volumev2 |
| 50144c64d7bd44a5a3d0e9fb8473da37 | cinder | volume |
| 56672ffcfef14ffbbb041287e16bb0dd | heat-cfn | cloudformation |
| 602a478cc2584269b24f7c0e9dda5c36 | glance | image |
| 807e8d2d91cc426cad435f907eb52601 | cinderv3 | volumev3 |
| 86d499b6413d4328969c82765f1f5044 | neutron | network |
| a4934bdd925f4cf9be7be020206c9751 | placement | placement |
| e3c14c540fb54031a84ee2a5689c34ab | nova | compute |
+----------------------------------+-----------+----------------+ 创建Orchestration endpoint
[root@armstrong nova(keystone_admin)]# openstack endpoint create --region RegionOne orchestration public http://192.168.122.209:8004/v1/%\(tenant_id\)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | 04710a3160c74386825b11595e13b10b |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 3a423bcb425f4b0b814d53352eb2e16e |
| service_name | heat |
| service_type | orchestration |
| url | http://192.168.122.209:8004/v1/%(tenant_id)s |
+--------------+----------------------------------------------+
[root@armstrong nova(keystone_admin)]# openstack endpoint create --region RegionOne orchestration internal http://192.168.122.209:8004/v1/%\(tenant_id\)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | 3da6845f138f416196c420ee4a8c94bc |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 3a423bcb425f4b0b814d53352eb2e16e |
| service_name | heat |
| service_type | orchestration |
| url | http://192.168.122.209:8004/v1/%(tenant_id)s |
+--------------+----------------------------------------------+
[root@armstrong nova(keystone_admin)]# openstack endpoint create --region RegionOne orchestration admin http://192.168.122.209:8004/v1/%\(tenant_id\)s
+--------------+----------------------------------------------+
| Field | Value |
+--------------+----------------------------------------------+
| enabled | True |
| id | f1bceb3152f747fb8e1244398a157090 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 3a423bcb425f4b0b814d53352eb2e16e |
| service_name | heat |
| service_type | orchestration |
| url | http://192.168.122.209:8004/v1/%(tenant_id)s |
+--------------+----------------------------------------------+ [root@armstrong nova(keystone_admin)]# openstack endpoint list |grep orchestration
+----------------------------------------------------------------------------------------------------------------------------------------------------+
| 04710a3160c74386825b11595e13b10b | RegionOne | heat | orchestration | True | public | http://192.168.122.209:8004/v1/%(tenant_id)s |
| 3da6845f138f416196c420ee4a8c94bc | RegionOne | heat | orchestration | True | internal | http://192.168.122.209:8004/v1/%(tenant_id)s |
| f1bceb3152f747fb8e1244398a157090 | RegionOne | heat | orchestration | True | admin | http://192.168.122.209:8004/v1/%(tenant_id)s |
+----------------------------------------------------------------------------------------------------------------------------------------------------+ 创建cloudformation endpoint
[root@armstrong nova(keystone_admin)]# openstack endpoint create --region RegionOne cloudformation public http://192.168.122.209:8000/v1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | d6c3d5a7e57749d6a6e769d4fea77c67 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 56672ffcfef14ffbbb041287e16bb0dd |
| service_name | heat-cfn |
| service_type | cloudformation |
| url | http://192.168.122.209:8000/v1 |
+--------------+----------------------------------+
[root@armstrong nova(keystone_admin)]# openstack endpoint create --region RegionOne cloudformation internal http://192.168.122.209:8000/v1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 4a7dd256dd044f37849ba08cdb12abf6 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 56672ffcfef14ffbbb041287e16bb0dd |
| service_name | heat-cfn |
| service_type | cloudformation |
| url | http://192.168.122.209:8000/v1 |
+--------------+----------------------------------+
[root@armstrong nova(keystone_admin)]# openstack endpoint create --region RegionOne cloudformation admin http://192.168.122.209:8000/v1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 173892f7410a4dc4976ffe2a5adfb005 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 56672ffcfef14ffbbb041287e16bb0dd |
| service_name | heat-cfn |
| service_type | cloudformation |
| url | http://192.168.122.209:8000/v1 |
+--------------+----------------------------------+
[root@armstrong nova(keystone_admin)]# openstack endpoint list |grep cloudformation
173892f7410a4dc4976ffe2a5adfb005 | RegionOne | heat-cfn | cloudformation | True | admin | http://192.168.122.209:8000/v1 4a7dd256dd044f37849ba08cdb12abf6 | RegionOne | heat-cfn | cloudformation | True | internal | http://192.168.122.209:8000/v1 d6c3d5a7e57749d6a6e769d4fea77c67 | RegionOne | heat-cfn | cloudformation | True | public | http://192.168.122.209:8000/v1 创建包含堆栈项目和用户的域
[root@armstrong nova(keystone_admin)]# openstack domain create --description "Stack projects and users" heat
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Stack projects and users |
| enabled | True |
| id | 22388bd950cb495caf0b666dde11333e |
| name | heat |
| tags | [] |
+-------------+----------------------------------+ 创建heat_domain_admin用户来管理域中的项目和用户
[root@armstrong nova(keystone_admin)]# openstack user create --domain heat --password-prompt heat_domain_admin
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | 22388bd950cb495caf0b666dde11333e |
| enabled | True |
| id | 0c858402292a4a8480715a213d563ccb |
| name | heat_domain_admin |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+ 将admin角色添加到域中的heat_domain_admin用户,通过heat_domain_admin用户启用管理堆栈管理权限
[root@armstrong nova(keystone_admin)]# openstack role add --domain heat --user-domain heat --user heat_domain_admin admin 创建heat_stack_owner角色
[root@armstrong nova(keystone_admin)]# openstack role create heat_stack_owner
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | None |
| id | e7523e56d0c14d8588c600567a8e95c8 |
| name | heat_stack_owner |
+-----------+----------------------------------+ 向demo项目和demo用户添加heat_stack_owner角色以启用演示用户的堆栈管理
[root@armstrong nova(keystone_admin)]# openstack role add --project demo --user demo heat_stack_owner 创建heat_stack_user角色
[root@armstrong nova(keystone_admin)]# openstack role create heat_stack_user
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | None |
| id | 49908672b7bc4d5699d053174b102ce1 |
| name | heat_stack_user |
+-----------+----------------------------------+ 安装和配置组件
[root@armstrong nova(keystone_admin)]#yum install openstack-heat-api openstack-heat-api-cfn openstack-heat-engine 编辑heat配置文件
cat /etc/heat/heat.conf
[DEFAULT]
transport_url = rabbit://guest:[email protected]:5672
heat_metadata_server_url = http://192.168.122.209:8000
heat_waitcondition_server_url = http://192.168.122.209:8000/v1/waitcondition
stack_domain_admin = heat_domain_admin
stack_domain_admin_password = heat
stack_user_domain_name = heat [database]
connection = mysql+pymysql://heat:[email protected]/heat [keystone_authtoken]
auth_uri = http://192.168.122.209:5000
auth_url = http://192.168.122.209:35357
memcached_servers = 192.168.122.209:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = services
username = heat
password = heat [trustee]
auth_type = password
auth_url = http://192.168.122.209:35357
username = heat
password = heat
user_domain_name = default [clients_keystone]
auth_uri = http://192.168.122.209:5000 同步数据库
[root@armstrong nova(keystone_admin)]# su -s /bin/sh -c "heat-manage db_sync" heat
-- ::42.367 WARNING oslo_config.cfg [-] Option "db_backend" from group "DEFAULT" is deprecated. Use option "backend" from group "database".-- ::42.495 INFO migrate.versioning.api [-] -> ...
-- ::42.727 INFO migrate.versioning.api [-] done
-- ::42.727 INFO migrate.versioning.api [-] -> ...
-- ::42.761 INFO migrate.versioning.api [-] done
-- ::42.762 INFO migrate.versioning.api [-] -> ...
-- ::42.804 INFO migrate.versioning.api [-] done
-- ::42.804 INFO migrate.versioning.api [-] -> ...
-- ::42.810 INFO migrate.versioning.api [-] done
-- ::42.810 INFO migrate.versioning.api [-] -> ...
-- ::42.815 INFO migrate.versioning.api [-] done
-- ::42.815 INFO migrate.versioning.api [-] -> ...
-- ::42.821 INFO migrate.versioning.api [-] done
-- ::42.821 INFO migrate.versioning.api [-] -> ...
-- ::42.826 INFO migrate.versioning.api [-] done
-- ::42.826 INFO migrate.versioning.api [-] -> ...
-- ::42.833 INFO migrate.versioning.api [-] done
-- ::42.834 INFO migrate.versioning.api [-] -> ...
-- ::42.940 INFO migrate.versioning.api [-] done
-- ::42.940 INFO migrate.versioning.api [-] -> ...
-- ::42.992 INFO migrate.versioning.api [-] done
-- ::42.992 INFO migrate.versioning.api [-] -> ...
-- ::42.997 INFO migrate.versioning.api [-] done
-- ::42.997 INFO migrate.versioning.api [-] -> ...
-- ::43.002 INFO migrate.versioning.api [-] done
-- ::43.002 INFO migrate.versioning.api [-] -> ...
-- ::43.007 INFO migrate.versioning.api [-] done
-- ::43.007 INFO migrate.versioning.api [-] -> ...
-- ::43.012 INFO migrate.versioning.api [-] done
-- ::43.013 INFO migrate.versioning.api [-] -> ...
-- ::43.017 INFO migrate.versioning.api [-] done 启动服务
[root@armstrong nova(keystone_admin)]# systemctl enable openstack-heat-api.service openstack-heat-api-cfn.service openstack-heat-engine.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-heat-api.service to /usr/lib/systemd/system/openstack-heat-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-heat-api-cfn.service to /usr/lib/systemd/system/openstack-heat-api-cfn.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-heat-engine.service to /usr/lib/systemd/system/openstack-heat-engine.service.
[root@armstrong nova(keystone_admin)]# systemctl start openstack-heat-api.service openstack-heat-api-cfn.service openstack-heat-engine.service 验证服务状态
[root@armstrong heat(keystone_admin)]#source keystonerc_admin
[root@armstrong ~(keystone_admin)]# openstack orchestration service list
+-----------+-------------+--------------------------------------+-----------+--------+----------------------------+--------+
| Hostname | Binary | Engine ID | Host | Topic | Updated At | Status |
+-----------+-------------+--------------------------------------+-----------+--------+----------------------------+--------+
| armstrong | heat-engine | 7953d573-ebb6-4bc9-804a-5fff4f44a71a | armstrong | engine | --13T03::28.000000 | up |
| armstrong | heat-engine | 88b6c902-09fe-46fb-87a0-6baf762a8ad3 | armstrong | engine | --13T03::01.000000 | down |
| armstrong | heat-engine | c81c847b-45e3-46ec-8c6a-d32b61dcfe11 | armstrong | engine | --13T03::28.000000 | up |
| armstrong | heat-engine | ab960cdb--4ab2-a93d-86f74bfb7179 | armstrong | engine | --13T03::01.000000 | down |
| armstrong | heat-engine | 0b7a2c59-7cdf-47e8-a58b-06aa11556682 | armstrong | engine | --13T03::01.000000 | down |
| armstrong | heat-engine | 6cf3b8df-391b--b37e-856b9d7cd0ef | armstrong | engine | --13T03::01.000000 | down |
| armstrong | heat-engine | 6fbad63a-e6fa--9c04-7e6c0cca2b2e | armstrong | engine | --13T03::28.000000 | up |
| armstrong | heat-engine | b55005dc-cf1e-455c-b5b0-20aa46bf1340 | armstrong | engine | --13T03::28.000000 | up |
+-----------+-------------+--------------------------------------+-----------+--------+----------------------------+--------+ 验证支持的resource type
[root@armstrong ~(keystone_admin)]# openstack orchestration resource type list
+------------------------------------------+
| Resource Type |
+------------------------------------------+
| AWS::AutoScaling::AutoScalingGroup |
| AWS::AutoScaling::LaunchConfiguration |
| AWS::AutoScaling::ScalingPolicy |
| AWS::CloudFormation::Stack |
| AWS::CloudFormation::WaitCondition |
| AWS::CloudFormation::WaitConditionHandle |
| AWS::CloudWatch::Alarm |
| AWS::EC2::EIP |
| AWS::EC2::EIPAssociation |
| AWS::EC2::Instance |
| AWS::EC2::InternetGateway |
| AWS::EC2::NetworkInterface |
| AWS::EC2::RouteTable |
| AWS::EC2::SecurityGroup |
| AWS::EC2::Subnet |
| AWS::EC2::SubnetRouteTableAssociation |
| AWS::EC2::VPC |
| AWS::EC2::VPCGatewayAttachment |
| AWS::EC2::Volume |
| AWS::EC2::VolumeAttachment |
| AWS::ElasticLoadBalancing::LoadBalancer |
| AWS::IAM::AccessKey |
| AWS::IAM::User |
| AWS::RDS::DBInstance |
| OS::Cinder::EncryptedVolumeType |
| OS::Cinder::QoSAssociation |
| OS::Cinder::QoSSpecs |
| OS::Cinder::Quota |
| OS::Cinder::Volume |
| OS::Cinder::VolumeAttachment |
| OS::Cinder::VolumeType |
| OS::Glance::Image |
| OS::Heat::AccessPolicy |
| OS::Heat::AutoScalingGroup |
| OS::Heat::CloudConfig |
| OS::Heat::DeployedServer |
| OS::Heat::InstanceGroup |
| OS::Heat::MultipartMime |
| OS::Heat::None |
| OS::Heat::RandomString |
| OS::Heat::ResourceChain |
| OS::Heat::ResourceGroup |
| OS::Heat::ScalingPolicy |
| OS::Heat::SoftwareComponent |
| OS::Heat::SoftwareConfig |
| OS::Heat::SoftwareDeployment |
| OS::Heat::SoftwareDeploymentGroup |
| OS::Heat::Stack |
| OS::Heat::StructuredConfig |
| OS::Heat::StructuredDeployment |
| OS::Heat::StructuredDeploymentGroup |
| OS::Heat::TestResource |
| OS::Heat::UpdateWaitConditionHandle |
| OS::Heat::Value |
| OS::Heat::WaitCondition |
| OS::Heat::WaitConditionHandle |
| OS::Keystone::Domain |
| OS::Keystone::Endpoint |
| OS::Keystone::Group |
| OS::Keystone::GroupRoleAssignment |
| OS::Keystone::Project |
| OS::Keystone::Region |
| OS::Keystone::Role |
| OS::Keystone::Service |
| OS::Keystone::User |
| OS::Keystone::UserRoleAssignment |
| OS::Neutron::AddressScope |
| OS::Neutron::ExtraRoute |
| OS::Neutron::FloatingIP |
| OS::Neutron::FloatingIPAssociation |
| OS::Neutron::FlowClassifier |
| OS::Neutron::MeteringLabel |
| OS::Neutron::MeteringRule |
| OS::Neutron::Net |
| OS::Neutron::NetworkGateway |
| OS::Neutron::Port |
| OS::Neutron::PortPair |
| OS::Neutron::ProviderNet |
| OS::Neutron::QoSBandwidthLimitRule |
| OS::Neutron::QoSDscpMarkingRule |
| OS::Neutron::QoSPolicy |
| OS::Neutron::Quota |
| OS::Neutron::RBACPolicy |
| OS::Neutron::Router |
| OS::Neutron::RouterInterface |
| OS::Neutron::SecurityGroup |
| OS::Neutron::SecurityGroupRule |
| OS::Neutron::Subnet |
| OS::Neutron::SubnetPool |
| OS::Neutron::Trunk |
| OS::Nova::Flavor |
| OS::Nova::FloatingIP |
| OS::Nova::FloatingIPAssociation |
| OS::Nova::HostAggregate |
| OS::Nova::KeyPair |
| OS::Nova::Quota |
| OS::Nova::Server |
| OS::Nova::ServerGroup |
| OS::Senlin::Cluster |
| OS::Senlin::Node |
| OS::Senlin::Policy |
| OS::Senlin::Profile |
| OS::Senlin::Receiver |
+------------------------------------------+ 验证模板版本
[root@armstrong ~(keystone_admin)]# openstack orchestration template version list
+--------------------------------------+------+------------------------------+
| Version | Type | Aliases |
+--------------------------------------+------+------------------------------+
| AWSTemplateFormatVersion.-- | cfn | |
| HeatTemplateFormatVersion.-- | cfn | |
| heat_template_version.-- | hot | |
| heat_template_version.-- | hot | |
| heat_template_version.-- | hot | |
| heat_template_version.-- | hot | |
| heat_template_version.-- | hot | |
| heat_template_version.-- | hot | heat_template_version.newton |
| heat_template_version.-- | hot | heat_template_version.ocata |
| heat_template_version.-- | hot | heat_template_version.pike |
| heat_template_version.-- | hot | heat_template_version.queens |
+--------------------------------------+------+------------------------------+