Heat support querying autoscaling Group virtual machine list

Source: Internet
Author: User

Introduction
There is a message in the OpenStack mailing list that reads:
[Openstack] Heat autoscaling Group instance relationshipsI ' m trying to figure out how to determine all instances that were createdAs part of a given autoscaling group. I want to take a given autoscalingGroup and list all of the its instances. So far I can ' t figure out what to doThis . The instances themselves has a tag called "Autoscalinggroupname"(MYSTACK-MYSERVERGROUP-F3R72IFSJ2JQ for example) and the value of thatdoesn ' t seem to map to anything. A Resource-show on the autoscaling groupdoesn ' t seem to show no identifier that maps to the AutoScaling groupname.
Any ideas in how can I? thanks!
 The postal message generally means how to get a list of virtual machines in the AutoScaling Group via the Heat API. 

I. Requirements
As an example of the hot template of autoscaling Group recommended by Heat, after creating a stack with this template, query the stack containing the resource as follows, and ASG is Autoscalinggroup resource.
Query Nova Discovery autoscaling Group has two virtual machines. continue to query the ASG for details without any virtual machine-related information, in fact, AutoScaling Group as a collection of virtual machines, users very much want to get the number of virtual machines under the AutoScaling group, the name of the virtual machine M and so on. If the API is not provided by Heat, then users can only query the relevant virtual machines via the Nova API, which undoubtedly increases the complexity of the operation for the user.
Two. About Nested_stack
Before explaining the Nested_stack, ask the reader a question: how many stacks have just been created?
One! There is only one! Its name is called Fuck! ...... seems to make sense, and then query the database to see, wonderful appeared, I ran out of four stacks, and four stacks of the names are fuck beginning, with a few similarities and some laws. Then look at the relationship between owner_id and ID:
1. Stack-list query to the stack, its owner_id are not NULL.
2. Nested_stack's owner_id is the ID of the parent stack.

The relationship of this four stack is shown in the




Look, the familiar virtual machine appears. It is not difficult to find another rule, Nested_stack's ID is exactly the same as a resource ID of the parent stack. In fact, Heat has the following resources to support Nested_stack:
Os::heat::instancegroup
Os::heat::resourcegroup
Os::heat::autoscalinggroup
Aws::autoscaling::autoscalinggroup.
for the initial understanding of heat students, nested_stack more unfamiliar obscure, more information please visit wiki:https://wiki.openstack.org/wiki/Heat/NestedStacks.
Three. Solution
we can follow the above method to query the virtual machine information autoscaling Group, but the frequent CLI query operation cumbersome, inefficient, the user experience is very poor. The best way to do this is to query the AutoScaling Group resource and return to its list of virtual machines. as followsThe core code isfor complete code, see:https://github.com/DeliangFan/heat/commit/63d35793c47784b4ff0e980a0148eaf96139c853


Heat support querying autoscaling Group virtual machine list

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.