You can use heat to create large number of instances.
How to use heat? I start from the cli.
Heat use template file. I create template file to create 3 instances:
heat_template_version: 2013-05-23
parameters:
image_name:
type: string
label: Image Name
default: centos7
network_id:
type: string
default: 80bcc12b-b546-47be-8a24-0c0e278e57dd
resources:
my_instance1:
type: OS::Nova::Server
properties:
image: { get_param: image_name }
flavor: min
networks:
- network : { get_param : network_id }
my_instance2:
type: OS::Nova::Server
properties:
image: { get_param: image_name }
flavor: min
networks:
- network : { get_param : network_id }
my_instance3:
type: OS::Nova::Server
properties:
image: { get_param: image_name }
flavor: min
networks:
- network : { get_param : network_id }
I save this file as template.yaml.
I use here flavor min, image centos7 and network id 80bcc12b-b546-47be-8a24-0c0e278e57dd.
Now I create 3 instances. I exec
# heat stack-create --template-file template.yaml test
+--------------------------------------+------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+----------------------+
| e39c8d65-b135-4d75-a800-2c35715ce792 | test | CREATE_IN_PROGRESS | 2015-12-31T20:39:23Z |
+--------------------------------------+------------+--------------------+----------------------+
# heat stack-list
+--------------------------------------+------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+-----------------+----------------------+
| e39c8d65-b135-4d75-a800-2c35715ce792 | test | CREATE_COMPLETE | 2015-12-31T20:39:23Z |
+--------------------------------------+------------+-----------------+----------------------+
Stack test was created. Next images was created:
# nova list
+--------------------------------------+--------------------------------+---------+------------+-------------+-------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+--------------------------------+---------+------------+-------------+-------------------+
| 81b3ef22-f993-4ba0-bc9d-804afdf2ab5d | test-my_instance1-u3qmm73wlmtd | ACTIVE | - | Running | net1=192.168.0.18 |
| a6bf0400-8ec9-4d7e-867b-5e3238f48943 | test-my_instance2-5275ytbk33dj | ACTIVE | - | Running | net1=192.168.0.17 |
| 7f52fdb1-7414-45bd-aa9e-293d45ee22c4 | test-my_instance3-i2mynv5p6tq5 | ACTIVE | - | Running | net1=192.168.0.19 |
+--------------------------------------+--------------------------------+---------+------------+-------------+-------------------+
You can change template file and add more instances. All instances will be created by 1 call: use heat stack-create.
Now remove instances you can use heat stack-delete call:
# heat stack-delete test
+--------------------------------------+------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+----------------------+
| e39c8d65-b135-4d75-a800-2c35715ce792 | test | DELETE_IN_PROGRESS | 2015-12-31T20:39:23Z |
+--------------------------------------+------------+--------------------+----------------------+
It's from cli. How we can use dashboard?
You can open http://ip_address/dashboard/project/stacks/ page.
Stack page was open. Launch stack button click: select template form was opened. Select template source: direct input. Into the template data set content of the template.json file. Press next button, into the next page enter the stack name, admin password and press launch button. New heat stack will be created. It's the same as heat stack-create call.