Heat-API (cloudformation in openstack) cfntools notes

Source: Internet
Author: User

In the heat-API architecture, the external virtual machine needs to communicate with the Virtual Machine and customize the Virtual Machine in detail. Write down the specific architecture later.

Today we will focus on the functions of several scripts in cfntools. Https://github.com/heat-api/heat-jeos)

Cfntools Introduction

Cfntools is a bunch of auxiliary scripts running in virtual machines. It is generally used to obtain metadata and perform some automated configuration based on metadata.

Cfntools directory structure

── CFN-get-Metadata
── Cfn_helper.py
├ ── CFN-Hup
── CFN-init
── CFN-push-Stats
── CFN-Signal
── _ Init _. py

Cfn_helper includes the main implementationCodeThe other scripts only depend on this.

CFN-init

Initialize some virtual machines, such as reading the configuration of AWS: cloudformation: init in metadata, and then perform some actions, such as installation packages and starting services. See: http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html#aws-resource-init-services

CFN-get-Metadata

Obtain metadata and save it to the/tmp/last_metadata directory. In fact, this part of work CFN-init has already been done.

CFN-push-Stats

Call psutil to obtain the internal information (CPU and memory usage) of the VM and send the information to the metadata server.

CFN-Signal

It also sends data to the metadata server, but it only sends information such as whether the cfntool operation is complete and whether an error occurs.

For example, in general, the virtual machine user-data in the template of the CFN will write:

 
CFN-signal-E 0-r \ "Wiki Server SETUP complete \"

-E -- exit code

-R -- reson

CFN-Hup

This is complicated. It is a daemon process that monitors metadata and performs corresponding actions based on the updated metadata. The main usage can be used to update the configuration file, such as the configuration of haproxy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.