Monday, October 9, 2017

Initial things with the OpenStack Heat Orchestration

Initial things with the OpenStack Heat Orchestration



This assumes that the heat orchestration is installed and up and running on the OpenStack setup.


Ensure that the heat openstack services are up and running 


[root@controllero HeatOrchestrationTemplates(keystone_admin)]# openstack-service status | grep -i heat
MainPID=10107 Id=openstack-heat-api-cfn.service ActiveState=active
MainPID=9979 Id=openstack-heat-api.service ActiveState=active
MainPID=10040 Id=openstack-heat-engine.service ActiveState=active
[root@controllero HeatOrchestrationTemplates(keystone_admin)]#


The heat services are listed as in the openstack service list 


[root@controllero HeatOrchestrationTemplates(keystone_admin)]# openstack service list | grep -i heat
| 0de6cc86e884484d9c3a3d8ad21ca3cd | heat-cfn   | cloudformation |
| ce6620cdc68a4d0eb55c114496fbfe39 | heat       | orchestration  |
[root@controllero HeatOrchestrationTemplates(keystone_admin)]#



Ensure that the heat endpoints are available 

[root@controllero HeatOrchestrationTemplates(keystone_admin)]# openstack endpoint list | grep -i heat
| 0a9750e5702f45f0918a2f0e30c3e7c9 | RegionOne | heat-cfn     | cloudformation | True    | public    | http://11.11.1.158:8000/v1                 |
| 1538c41f21b4457c8f70a7c713d133fd | RegionOne | heat         | orchestration  | True    | internal  | http://11.11.1.158:8004/v1/%(tenant_id)s   |
| 50fae48042eb4670bed2528c1ba92346 | RegionOne | heat-cfn     | cloudformation | True    | admin     | http://11.11.1.158:8000/v1                 |
| 542a7341f9fa483288a1e0ff663e49c8 | RegionOne | heat         | orchestration  | True    | admin     | http://11.11.1.158:8004/v1/%(tenant_id)s   |
| 718d545742f349db83aedde62306220b | RegionOne | heat         | orchestration  | True    | public    | http://11.11.1.158:8004/v1/%(tenant_id)s   |
| ab9e670036c74e4fa477ed3ed1e70436 | RegionOne | heat-cfn     | cloudformation | True    | internal  | http://11.11.1.158:8000/v1                 |
[root@controllero HeatOrchestrationTemplates(keystone_admin)]#


It is important to note the Tenant ID in the heat endpoint URL.

Also ensure that the heat services are up and running 


[root@controllero HeatOrchestrationTemplates(keystone_admin)]# heat service-list
WARNING (shell) "heat service-list" is deprecated, please use "openstack orchestration service list" instead
+----------------------------+-------------+--------------------------------------+----------------------------+--------+----------------------------+--------+
| hostname                   | binary      | engine_id                            | host                       | topic  | updated_at                 | status |
+----------------------------+-------------+--------------------------------------+----------------------------+--------+----------------------------+--------+
| controllero.netx.sujit.com | heat-engine | 86f052f1-8aef-4f28-a881-abea2b5fbc51 | controllero.netx.sujit.com | engine | 2017-10-09T08:36:36.000000 | up     |
| controllero.netx.sujit.com | heat-engine | a6ccfe68-50d9-4910-b09a-204b54fd971e | controllero.netx.sujit.com | engine | 2017-10-09T08:36:36.000000 | up     |
| controllero.netx.sujit.com | heat-engine | b90e8883-81af-4180-b56d-25db2229848c | controllero.netx.sujit.com | engine | 2017-10-09T08:36:35.000000 | up     |
| controllero.netx.sujit.com | heat-engine | cdc1bd91-e114-4aec-be23-35421ec83b92 | controllero.netx.sujit.com | engine | 2017-10-09T08:36:36.000000 | up     |
+----------------------------+-------------+--------------------------------------+----------------------------+--------+----------------------------+--------+

[root@controllero HeatOrchestrationTemplates(keystone_admin)]#




  • To list resource types that can be used with the Orchestration heat stack.
  • To write the orchestration templates in YAML format, it is needed to know which are the resource types supported by the given version of the Heat Orchestration of OpenStack and how would the YAML syntax for the same would look like.


So the steps are 

1) get all the orchestration type resources supported by the heat orchestration 
2) get information about a particular resource type to know the YAML format that will go in the template for the same resource.



[root@controllero HeatOrchestrationTemplates(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::ElasticLoadBalancing::LoadBalancer      |
| AWS::IAM::AccessKey                          |
| AWS::IAM::User                               |
| AWS::RDS::DBInstance                         |
| OS::Aodh::Alarm                              |
| OS::Aodh::CombinationAlarm                   |
| OS::Aodh::CompositeAlarm                     |
| OS::Aodh::EventAlarm                         |
| OS::Aodh::GnocchiAggregationByMetricsAlarm   |
| OS::Aodh::GnocchiAggregationByResourcesAlarm |
| OS::Aodh::GnocchiResourcesAlarm              |
| OS::Glance::Image                            |
| OS::Heat::AccessPolicy                       |
| OS::Heat::AutoScalingGroup                   |
| OS::Heat::CloudConfig                        |
| OS::Heat::DeployedServer                     |
| OS::Heat::HARestarter                        |
| 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::LBaaS::HealthMonitor            |
| OS::Neutron::LBaaS::L7Policy                 |
| OS::Neutron::LBaaS::L7Rule                   |
| OS::Neutron::LBaaS::Listener                 |
| OS::Neutron::LBaaS::LoadBalancer             |
| OS::Neutron::LBaaS::Pool                     |
| OS::Neutron::LBaaS::PoolMember               |
| OS::Neutron::MeteringLabel                   |
| OS::Neutron::MeteringRule                    |
| OS::Neutron::Net                             |
| OS::Neutron::NetworkGateway                  |
| OS::Neutron::Port                            |
| OS::Neutron::PortPair                        |
| OS::Neutron::ProviderNet                     |
| 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::Nova::Flavor                             |
| OS::Nova::FloatingIP                         |
| OS::Nova::FloatingIPAssociation              |
| OS::Nova::HostAggregate                      |
| OS::Nova::KeyPair                            |
| OS::Nova::Quota                              |
| OS::Nova::Server                             |
| OS::Nova::ServerGroup                        |
+----------------------------------------------+
[root@controllero HeatOrchestrationTemplates(keystone_admin)]#




# to see the YAML format specification for any resource as a reference you can use 

openstack orchestration resource type show <Heat Resource Stack Name>

# for example if I need to know the syntax for writing the template for the OS::Neutron::Router type resource 

openstack orchestration resource type show OS::Neutron::Router

[root@controllero HeatOrchestrationTemplates(keystone_admin)]# openstack orchestration resource type show OS::Neutron::Router
support_status:
  message: null
  previous_status: null
  status: SUPPORTED
  version: null
attributes:
  admin_state_up:
    description: Administrative state of the router.
    type: string
  external_gateway_info:
    description: Gateway network for the router.
    type: map
  name:
    description: Friendly name of the router.
    type: string
  show:
    description: Detailed information about resource.
    type: map
  status:
    description: The status of the router.
    type: string
  tenant_id:
    description: Tenant owning the router.
    type: string
properties:
  admin_state_up:
    default: true
    description: The administrative state of the router.
    immutable: false
    required: false
    type: boolean
    update_allowed: true
  distributed:
    description: 'Indicates whether or not to create a distributed router. NOTE: The
      default policy setting in Neutron restricts usage of this property to administrative
      users only. This property can not be used in conjunction with the L3 agent ID.'
    immutable: false
    required: false
    type: boolean
    update_allowed: false
  external_gateway_info:
    description: External network gateway configuration for a router.
    immutable: false
    required: false
    schema:
      enable_snat:
        description: 'Enables Source NAT on the router gateway. NOTE: The default
          policy setting in Neutron restricts usage of this property to administrative
          users only.'
        immutable: false
        required: false
        type: boolean
        update_allowed: true
      external_fixed_ips:
        description: External fixed IP addresses for the gateway.
        immutable: false
        required: false
        schema:
          '*':
            immutable: false
            required: false
            schema:
              ip_address:
                constraints:
                - custom_constraint: ip_addr
                description: External fixed IP address.
                immutable: false
                required: false
                type: string
                update_allowed: false
              subnet:
                constraints:
                - custom_constraint: neutron.subnet
                description: Subnet of external fixed IP address.
                immutable: false
                required: false
                type: string
                update_allowed: false
            type: map
            update_allowed: false
        type: list
        update_allowed: true
      network:
        description: ID or name of the external network for the gateway.
        immutable: false
        required: true
        type: string
        update_allowed: true
    type: map
    update_allowed: true
  ha:
    description: 'Indicates whether or not to create a highly available router. NOTE:
      The default policy setting in Neutron restricts usage of this property to administrative
      users only. And now neutron do not support distributed and ha at the same time.'
    immutable: false
    required: false
    type: boolean
    update_allowed: false
  l3_agent_ids:
    description: 'ID list of the L3 agent. User can specify multi-agents for highly
      available router. NOTE: The default policy setting in Neutron restricts usage
      of this property to administrative users only.'
    immutable: false
    required: false
    schema:
      '*':
        immutable: false
        required: false
        type: string
        update_allowed: false
    type: list
    update_allowed: true
  name:
    description: The name of the router.
    immutable: false
    required: false
    type: string
    update_allowed: true
  value_specs:
    default: {}
    description: Extra parameters to include in the creation request.
    immutable: false
    required: false
    type: map
    update_allowed: true

    
    
    
# Hence if there is a need to write an orchestration template to create the Router, you can see how the YAML file has to be and what parameters you choose in the YAML file to write a template for a resource type

No comments:

Post a Comment