I would do something like this:
-
Create a Service that represents the "deployment-wide task."
-
Add the post-creation task under this service instead of under each VM.
-
Configure all VM services to depend on this "control service."
-
The control service task will execute once, after all VM services are up.
Hey @mariakalendarova
If it’s still relevant, I would try to help you.
Is the post-creation task -- a specific service (VM) related?
Example 1: you have a 3-tier blueprint for 1 backend server, 1 frontend server and 1 DB server.
So you have to create 3 services, where each one has a post-create section. It is a different one for each type of server, so you control which one will run this task, and it will only run once.
Example 2: you want to create 3 identical VMs in one blueprint. In that case you only use one service and set n as the number of VMs to create. You also want the post-create to be ran just once upon an application creation.
In my post-create task I will do this:
if ("@@{calm_array_index}@@" -eq "0") {
# execute the post-create code you wanted
}
What will happen is that it will only be executed for the first VM
Good luck on that
@Avico