GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
811 stars 263 forks source link

Request: Add node start delay in seconds #1300

Open g1augusto opened 6 years ago

g1augusto commented 6 years ago

Hi Everyone,

I remember in older versions of GNS3 it could be set a delay between nodes start, this is useful often for nodes that are cpu intensive at boot time and when the topology has many nodes.

This should be a per project setting to override a default general setting.

Now I cannot see this option anywhere unfortunately.

Najihel commented 6 years ago

It would be very useful.

Maybe it's possible to define order node by node too ?

grossmj commented 4 years ago

This could be added via a query parameter for the following endpoints:

ghost commented 4 years ago

My computer has not much compute power, so I'm also interested in this issue and PR https://github.com/GNS3/gns3-server/pull/1735.

But I have some doubts, that a delay will help much. There are a lot of VMs (Docker, Dynamips, IOU) that start fast and need few CPU power. Others need quite some time, sometimes even minutes, and need considerables resources during startup. So what delay do you want to use? A small one doesn't help much with these CPU demanding VMs, a large one adds unnecessary long delays for the fast booting VMs.

I've created and tested some scripts for a smooth start of VMs. My current favorite uses the following algorithm:

  1. Get the CPU usage of the compute, the node will use
  2. If the usage is above a certain limit (for example 60%) wait some seconds, then try again
  3. Start the VM

To minimize the start time, run this algorithm in parallel for each compute.

grossmj commented 4 years ago

But I have some doubts, that a delay will help much. There are a lot of VMs (Docker, Dynamips, IOU) that start fast and need few CPU power. Others need quite some time, sometimes even minutes, and need considerables resources during startup. So what delay do you want to use? A small one doesn't help much with these CPU demanding VMs, a large one adds unnecessary long delays for the fast booting VMs.

Indeed, we should have something smarter that just a dumb start delay that cannot be uniformly applied to all nodes.

I've created and tested some scripts for a smooth start of VMs. My current favorite uses the following algorithm:

  1. Get the CPU usage of the compute, the node will use
  2. If the usage is above a certain limit (for example 60%) wait some seconds, then try again
  3. Start the VM

I like the idea, I think the new VIRL (CML 2.0) has something similar where it actively monitors the amount of CPU/RAM before deciding to start one or more nodes, the author briefly described the process in this video: https://www.youtube.com/watch?v=5xUvqDMxH3g&t=555s