In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
HEAT service
The orchestration service provides template-based orchestration for describing cloud applications by running calls to generate OpenStack API for running cloud applications. The software integrates other OpenStack core components into a single file template system. Templates allow you to create many kinds of OpenStack resources, such as instances, floating-point IP, cloud disks, security groups and users. It also provides advanced features such as instance high availability, instance auto scaling, and nesting stacks. This makes OpenStack's core project have a large user base.
The service enables the deployer to integrate with the orchestration service either directly or through customized plug-ins. To put it simply, the user can predefine a task template in which a series of related tasks are defined, and the tasks defined in the heat template will be executed in a certain order when assigned to heat.
Architecture
The user submits a request containing the template and parameter input in horizon or on the command line, which is converted into an api call in REST format. Heat-api and heat-api-cfn verify the correctness of the template, and then queue up the message to heat engine for processing.
The template in heat is a collection of openstack resources. By defining a template, the resources you need to create can be described in the template, and the resources you need can be created many times with this template.
module
Heat-api: provides REST API services, is the entry point for exchange with other components, receives api requests and sends them to heat-engine
Heat-api-cfn: provides an AWS CloudFormation-compatible api that receives requests and forwards them to heat-engine
Heat-engine: core component, which mainly implements resource scheduling, resource lifecycle management and other functions. It does not provide resource creation function, but is only responsible for arranging resources and handing them over to other components.
Heat Engine architecture
Template
Heat template default writing language is YAML, about the definition of yaml language and the use of https://yaml.org/start.html
Resource ID: resource ID, which must be unique in the resources section of the template
Type: resource type: for example, OS::Nova::Server or OS::Neutron::Port, required attribute
Properties: a list of attributes for a specific resource, optional attributes
Metadata: metadata for a specific resource, optional
Depends_on: optional attributes on one or more resources in the resource dependency template
Update_policy: policy for deleting resources (optional)
Deletion_policy: the policy for deleting resources. The allowed deletion policies are delete,retain and snapshot, optional. The default policy is to delete physical resources when they are deleted from stack.
External_id: allows resource_id to be specified for existing external (to stack) resources, optional attributes
Condition: the condition of the resource, which determines whether to create the resource
Heat Stack
Stack: the collection of resources, the basic unit for managing a group of resources, and the smallest unit for user operations. Through the life cycle management of stack, the deployment of applications and the management of resources are completed.
Common command
Stack list
Stack create
Stack show
Stack delete
Stack output list
Stack resource list
Stack event show
Arrange the scene
Infrastructure resource orchestration: orchestrating basic resources such as computing, storage, and network to support user-defined scripts to configure virtual machines
Application resource choreography: implement complex configuration of virtual machines, such as software installation, configuration software
Advanced orchestration: such as load balancing and automatic scaling of applications
Third-party tool integration choreography: reuse existing Ansible Playbook configurations
Infrastructure orchestration
For different openstack resources, heat provides different resource types.
For example, for a virtual machine, heat provides OS::Nova::Server and parameters, (key,image,flavor), which can be specified in the template or when the stack is created
Choreography of software configuration and deployment
OS::Heat::SoftwareConfig and OS::Heat::SoftwareDeployment are commonly used.
Automatic stretching arrangement
Arrangement of load balancing
Configuration management tool integration
Arrangement management
Write a HOT template to create a simple virtual machine instance
HOT templates can be written by creating yaml files in Openstack, or you can import completed HOT templates from outside
Log in to the controller node and import the administrator environment variables
. Admin-openrc.sh
Install python-heatclient
Sudo apt install python-heatclient
Then enter the following command to view the currently available images, specifications, and key peering information
Openstack image listopenstack flavor listopenstack keypair list
Create a demo-template.yaml file as a HOT template
Touch demo-template.yamlvi demo-tempalte.yaml
Write as follows. Note that each ":" should be followed by a space, even if there are no characters.
You can use notpad++ to upload the file after it has been written, to avoid writing mistakes
Heat_template_version: 2015-10-15parameters: NetID: type: string description: server: type: OS::Nova::Server properties: image: Img_cli flavor: Flavor_cli key_name: KeyPairCli networks:-network: {get_param: NetID} outputs: instance_name: description: Name of the instance. Value: {get_attr: [server,name]} instance_ip: description: IP address of the instance. Value: {get_attr: [server,first_address]}
Image,flavor,key_name in resources.server is the available image, specification and key pair in the environment.
View the current network
Openstack network list
Record the id of provider
Execute the following command to set the NET_ID of the environment variable
Export NET_ID=
Create a stack Stack_demo using the HOT template demo-template.yaml
Openstack stack create-t demo-template.yaml-- parameter "NetID=$NET_ID" Stack_demo
After waiting a few minutes, view the stack creation process
Openstack stack event list Stack_demo
Check the stack list. If the status changes to CREATE_COMPLETE, the creation is successful.
Openstack stack list
View the details of the stack
Openstack stack show Stack_demo
View the virtual machine instance name and IP output after the stack is created
Openstack stack output show-all Stack_demo
Check the list of virtual machine instances for confirmation
Openstack server list
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.