Heat Template to create Multiple VM on different compute node

asked 2019-05-21 07:21:03 -0500

anonymous user



Is it possible to create multiple vm on Multiple Compute node with Single heat template.

Eg: On compute 1,i have to create 10 vm and on compute 2,i want to create 8 vm

If possible then please share,how i will achieve it.

edit retag flag offensive close merge delete


As a normal user, you don’t have control over the compute nodes on which instances run. Except if an administrator has exposed compute nodes to you via host aggregates and flavors.

If the cloud has flavors that are linked to aggregates, use those flavors to launch VMs on the desired aggregates.

Bernd Bausch gravatar imageBernd Bausch ( 2019-05-21 07:32:51 -0500 )edit

I have admin right,want to create 10 vm on server1(Compute1) and 8 vm to server2(Compute2).I want to do this with the help of single heat template.if it is possible then how i will define compute1/compute2 ip address in heat temp. for 10/8 vm creation in compute1 and compute2 respectively.

Sumit1269 gravatar imageSumit1269 ( 2019-05-21 08:17:00 -0500 )edit

If possible then please share one referral doc.

Or,i have to create two different heat template as compute are different.

Sumit1269 gravatar imageSumit1269 ( 2019-05-21 08:17:54 -0500 )edit

I don‘t see this documented on docs.openstack.org anymore [EDIT: I found it], but this page looks good (though it uses the old nova client instead of the openstack client): https://support.metacloud.com/hc/en-u....

Bernd Bausch gravatar imageBernd Bausch ( 2019-05-21 09:03:10 -0500 )edit

As admin, you declare two host aggregates, add compute1 and 2 to aggregate 1 and 2 and create flavors linked to the aggregates.

Then, in the template, you launch instances using those flavors.

Bernd Bausch gravatar imageBernd Bausch ( 2019-05-21 09:05:33 -0500 )edit

2 answers

Sort by » oldest newest most voted

answered 2019-05-21 10:06:17 -0500

Mohit gravatar image

You can use affinity/anti-affinity rules to achieve this, Refer the guide for using them via Heat -


edit flag offensive delete link more

answered 2019-05-23 04:50:23 -0500

jsm gravatar image

Not tested but heat OS::Nova::Server has availability_zone. At least the CLI allows use of availability_zone:targetcomputehost. For instance --availability-zone nova:compute01. Perhaps since you are admin you can do this in heat as well.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2019-05-21 07:21:03 -0500

Seen: 498 times

Last updated: May 23 '19