Corn Job to stop running all lab's Nodes

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
prasath1017
Posts: 4
Joined: Thu May 04, 2017 1:52 pm

Corn Job to stop running all lab's Nodes

Post by prasath1017 » Fri Jul 12, 2019 8:15 am

I have provisioned community edition and provided multiple user PODs. This is killing my server resources when the lab is left running and idle.
Could you pleaes help me with a simple script on eve-ng community version using to stop all idle nodes using "script / Cron tab" to kill all idle nodes.

prasath1017
Posts: 4
Joined: Thu May 04, 2017 1:52 pm

Re: Corn Job to stop running all lab's Nodes

Post by prasath1017 » Tue Jul 16, 2019 9:34 am

Hi,
I am running crontab everyday to reboot the VM for now.

0 0 * * * root /sbin/shutdown -r now # reboot every day at 00:00 am

Will explore to identify how to kill "dynamips", "qemu" and other nodes. If anyone has tried it, please share your thoughts :)

prasath1017
Posts: 4
Joined: Thu May 04, 2017 1:52 pm

Re: Corn Job to stop running all lab's Nodes

Post by prasath1017 » Tue Jul 16, 2019 12:35 pm

I have tested the below and it works for my requirement.
Add the below cron job to kill the process with the pattern of any qemu, iol and dynamips.

edit the /etc/crontab
0 3 * * * root pkill qemu
0 3 * * * root pkill iol
0 3 * * * root pkill dynamips

The above will stop all nodes from any lab at 3am everyday.

ecze
Posts: 533
Joined: Wed Mar 15, 2017 1:54 pm

Re: Corn Job to stop running all lab's Nodes

Post by ecze » Wed Jul 17, 2019 5:23 pm

did you try /opt/unetlab/wrappers/unl_wrapper -a stopall ?

E.

Post Reply