amuck-landowner

[script] Solus IP Block Usage Priorities (Usage % Thresholds)

Jonathan

Woohoo
Administrator
Verified Provider
This may help out anyone here using SolusVM.  It will let you define what % usage you want to run IP blocks to and adjust the IP block priorities as such.  As of this posting Solus hasn't release this feature to their production tier yet but it will be available in 1.16.13 or you can /scripts/upcp-beta on your master to get it.

It's designed to be run on a cron.  I wouldn't recommend running it any more often than once an hour or so.

https://github.com/neonardo1/solusvm-80ipblock
 
Last edited by a moderator:

MannDude

Just a dude
vpsBoard Founder
Moderator
Thanks for sharing! I'm sure some folks here will find it quite useful.
 

Jonathan

Woohoo
Administrator
Verified Provider
There's tons of room for improvement, I'll be adding a new feature and making some optimizations in a commit hopefully later tonight.
 

Jonathan

Woohoo
Administrator
Verified Provider

HalfEatenPie

The Irrational One
Retired Staff
So to put it in plain words...

This is focused on determining what IPs to allocate to a VPS right?  Like if you need to use 80% of each /24 then it'll automatically provision using the proper subnet in order to get the proper %usage right?  

This is great since Solus usually does it by... whatever ordering it does.  I think lowest number to highest number.  

Out of curiosity, (since I haven't seen the code yet) does this script round up or down?  Lets say you need 81% of a /24 used.  Would it be 81% at 80.1%?  Or does it need to be a solid 81% (which would mean a fraction of an IP since it can't be a perfect 81%)?  Or will 81.1% still be considered satisfactory to the upper limit? 
 
Last edited by a moderator:

Jonathan

Woohoo
Administrator
Verified Provider
So to put it in plain words...

This is focused on determining what IPs to allocate to a VPS right?  Like if you need to use 80% of each /24 then it'll automatically provision using the proper subnet in order to get the proper %usage right?  

This is great since Solus usually does it by... whatever ordering it does.  I think lowest number to highest number.  

Out of curiosity, (since I haven't seen the code yet) does this script round up or down?  Lets say you need 81% of a /24 used.  Would it be 81% at 80.1%?  Or does it need to be a solid 81% (which would mean a fraction of an IP since it can't be a perfect 81%)?  Or will 81.1% still be considered satisfactory to the upper limit? 

That's precisely what it's designed to do.  It will go based on the highest to lowest (backwards feeling I know, blame Solus lol).  It doesn't round in that sense but it will recognize decimals and since it uses >=, 81.1 would meet the criteria, 80.9 would not.
 

HalfEatenPie

The Irrational One
Retired Staff
Alright sweet thanks for the clarification!  I didn't see it in the original post so I was a bit confused :)

Definitely looks like a nifty piece of software that'd be great to use!  Thanks for the contribution! 
 

Tyler

Active Member
This seems nice, and maybe there's something I am missing, but what exactly is the benefit to filling up your IP blocks in such a manner? I know Solus is weird about how it does the job, but I'm just not sure why one would care to fill them up in this way.  Perhaps I am missing something.
 

Jonathan

Woohoo
Administrator
Verified Provider
This seems nice, and maybe there's something I am missing, but what exactly is the benefit to filling up your IP blocks in such a manner? I know Solus is weird about how it does the job, but I'm just not sure why one would care to fill them up in this way.  Perhaps I am missing something.

ARIN IP assignment usage requirements.  It's not very useful for those getting IPs from their datacenter I guess.
 

IndoVirtue

New Member
Verified Provider
Might be unrelated to this topic, but SolusVM add new features recently on v1.17:

Quote said:
Released: 15 September 2015

A new Priority option has been added while editing an IP block. The Priority field can contain a numeric value where the highest block value will be used first when assigning ip addresses to a virtual server when created from the API
If you look at IP block list, now they have additional priority column. It's still limited to which IP block should be used until it's exhausted. Usage percentage still remains to be seen yet.
 

wlanboy

Content Contributer
Nice solution. I like simple (=effective) solutions solving a single problem.
Designed as a cron to set priorities on schedule. *thumbs up*
 

Jonathan

Woohoo
Administrator
Verified Provider
Might be unrelated to this topic, but SolusVM add new features recently on v1.17:

Quote said:
Released: 15 September 2015

A new Priority option has been added while editing an IP block. The Priority field can contain a numeric value where the highest block value will be used first when assigning ip addresses to a virtual server when created from the API
If you look at IP block list, now they have additional priority column. It's still limited to which IP block should be used until it's exhausted. Usage percentage still remains to be seen yet.

That priority feature of theirs is actually a dependency of this script.  This script controls those priorities.  They introduced them in a BETA version between 1.16 and 1.17 per my request.

I'll update my GitHub project to state that this only works with version of SolusVM >= 1.17

EDIT: I updated the readme to reflect requiring >= 1.17
https://github.com/neonardo1/solusvm-80ipblock/commit/95287f3b3dcfedc1c9e77dedf5694aa9dc087751
 
Last edited by a moderator:
Top
amuck-landowner