Wish to script starting nodes in staggered fashion

Before posting something, READ the changelog, WATCH the videos, howto and provide following:
Your install is: Bare metal, ESXi, what CPU model, RAM, HD, what EVE version you have, output of the uname -a and any other info that might help us faster.

Moderator: mike

Post Reply
nick.williams5
Posts: 4
Joined: Thu Dec 13, 2018 7:45 am

Wish to script starting nodes in staggered fashion

Post by nick.williams5 » Sun Jan 20, 2019 6:23 am

First, I spent quite a bit of time looking for an answer before posting here, but I have no experience with what is going on under the hood with EVE-NG. It seems that what I want to do must be possible with the REST API, but I could be barking up the wrong tree entirely.

I have a topology with 14 nodes (10 routers + 4 switches) running on an EVE-NG instance with 6 vCPUs. If I try to start everything at once, it takes *forever* to boot everything. If I boot up the devices in three groups (5 routers + 5 routers + 4 switches), waiting for the previous group to finish, then the lab starts up no problem and performs just fine. Throwing more vCPUs at the problem does "fix" it, but it seems wasteful to pay for more vCPUs just to make booting the lab more convenient (I am using Google Compute).

How can I script EVE-NG to boot up a group of nodes, wait for some specified amount of time, then boot up another group, etc.? It'd be really nice to just run a script and come back when my lab is ready to go instead of coming back to start up more nodes every 5 minutes or so.

I am imagining something like this (pseudocode):

boot.nodes(1,2,3,4,5)
sleep(300)
boot.nodes(6,7,8,9,10)
sleep(300)
boot.nodes(11,12,13,14)

Any help would be greatly appreciated!

Uldis (UD)
Posts: 2522
Joined: Wed Mar 15, 2017 4:44 pm
Location: London
Contact:

Re: Wish to script starting nodes in staggered fashion

Post by Uldis (UD) » Sun Jan 20, 2019 8:39 am

Boot delay.
We always had such option in the EVE.
This feature is useful in conjunction with the “Start all nodes” function if your lab requires certain nodes to start up before others or to avoid a mass-start of very heavy nodes.

right click on node/edit and set delay time in seconds. It means that node after start, will trigger waiting time before boot.
Example
your first 5 nodes in lab leave delay 0;
next 5 nodes set delay 300;
next 5 nodes set delay to 600.

First 5 nodes will start and boot immediately,
Next 5 nodes will start, but boot only after 5 mins. (300sec)
Next portion of 5 will start and boot after 10 mins. (600sec)

You can vary this delay time to achieve required result :)
BTW it is described in our cookbook as well.
https://www.eve-ng.net/images/EVE-COOK-BOOK-1.7.pdf
Section 9.1.1.1 table p17

Uldis

P.S.
Your lab:
boot.nodes(1,2,3,4,5)
delay 0
boot.nodes(6,7,8,9,10)
delay 300
boot.nodes(11,12,13,14)
delay 600
You do not have the required permissions to view the files attached to this post.

nick.williams5
Posts: 4
Joined: Thu Dec 13, 2018 7:45 am

Re: Wish to script starting nodes in staggered fashion

Post by nick.williams5 » Sun Jan 20, 2019 3:50 pm

Thank you much Uldis! This is even easier than what I was thinking.
I did look through the cookbook, but apparently not carefully enough :)

Post Reply