[openstack-dev] [magnum][heat] spawn a group of nodes on different availability zones

Qiming Teng tengqim at linux.vnet.ibm.com
Fri Mar 4 05:18:50 UTC 2016


On Fri, Mar 04, 2016 at 01:09:26PM +0800, Qiming Teng wrote:
> Another option is to try out senlin service. What you need to do is
> something like below:
> 
> 1. Create a heat template you want to deploy as a group, say,
> node_template.yaml
> 
> 2. Create a senlin profile spec (heat_stack.yaml) which may look
> like, for example:
> 
>   type: os.heat.stack
>   version: 1.0
>   properties:
>     name: node_template
>     template: node_template.yaml
>     environment: shared_env.yaml
> 
> 3. Register the profile to senlin:
> 
>    $ senlin profile-create -s heat_stack.yaml stack_profile
> 
>    After this step, you can create individual instances (nodes) out of
> this profile.
> 
> 4. Create a cluster using the profile:
> 
>   $ senlin cluster-create -p stack_profile my_cluster
> 
> 5. Create a zone placement policy spec (zone_placement.yaml), which
> may look like:
> 
>   type: senlin.policy.zone_placement
>   version: 1.0
>   properties:
>     zones:
>       - name: zone1
>         weight: 100
>       - name: zone2
>         weight: 50
> 
> 6. Initialize a policy object, which can be attaced to any clusters:
> 
>   $ senlin policy-create -s zone_placement.yaml zone_policy
> 
> 7. Attach the above policy to your cluster:
> 
>   $ senlin cluster-policy-attach -p zone_policy my_cluster

Oh, forgot to mention, this won't work at the moment because we are not
so sure that a stack as a whole can be placed into a single NOVA
AVAILABILITY ZONE, there are other availability zones as well. The above
example works if the profile is about an os.nova.server type.

Anyway, this example hopefully showed you how things are done with
senlin service.

Regards,
  Qiming
 
> Now, you can change your clusters size at will, and the zone placement
> policy will be enforced when new nodes are added or existing nodes are
> removed. For example:
> 
>   $ senlin cluster-scale-out -c 10 my_cluster
> 
> This will add 10 nodes to your cluster and the nodes will be spread
> across the availability zones based on the weight you specified. When
> you scale in your cluster, the zone distribution is also evaluated.
> 
> If any help needed, please stop by the #senlin channel IRC. We are more
> than happy to provide supports.
> 
> Regards,
>   Qiming
> 
 




More information about the OpenStack-dev mailing list