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

Discussion in 'Coding, Scripting & Programming' started by Jonathan, Aug 14, 2015.

  1. Jonathan

    Jonathan Woohoo Administrator Verified Provider

    389
    196
    May 27, 2013
    jonspw
    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: Aug 14, 2015
    wlanboy, Nick_A, HalfEatenPie and 2 others like this.
  2. MannDude

    MannDude Just a dude vpsBoard Founder Moderator

    5,036
    2,634
    Mar 8, 2013
    MannDude
    Thanks for sharing! I'm sure some folks here will find it quite useful.
     
  3. Jonathan

    Jonathan Woohoo Administrator Verified Provider

    389
    196
    May 27, 2013
    jonspw
    There's tons of room for improvement, I'll be adding a new feature and making some optimizations in a commit hopefully later tonight.
     
  4. Jonathan

    Jonathan Woohoo Administrator Verified Provider

    389
    196
    May 27, 2013
    jonspw
    HalfEatenPie, RLT and MannDude like this.
  5. HalfEatenPie

    HalfEatenPie The Irrational One Retired Staff

    2,890
    1,386
    Mar 25, 2013
    HalfEatenPie
    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: Aug 15, 2015
  6. Jonathan

    Jonathan Woohoo Administrator Verified Provider

    389
    196
    May 27, 2013
    jonspw
    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 likes this.
  7. HalfEatenPie

    HalfEatenPie The Irrational One Retired Staff

    2,890
    1,386
    Mar 25, 2013
    HalfEatenPie
    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! 
     
  8. Nick_A

    Nick_A Provider of the year (2014)

    315
    235
    May 13, 2013
    Nice.
     
  9. Tyler

    Tyler Active Member

    199
    93
    May 27, 2015
    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.
     
  10. Jonathan

    Jonathan Woohoo Administrator Verified Provider

    389
    196
    May 27, 2013
    jonspw
    ARIN IP assignment usage requirements.  It's not very useful for those getting IPs from their datacenter I guess.
     
    Tyler likes this.
  11. IndoVirtue

    IndoVirtue New Member Verified Provider

    12
    6
    Apr 21, 2015
    Might be unrelated to this topic, but SolusVM add new features recently on v1.17:

    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.
     
  12. wlanboy

    wlanboy Content Contributer

    2,126
    1,169
    May 16, 2013
    Nice solution. I like simple (=effective) solutions solving a single problem.
    Designed as a cron to set priorities on schedule. *thumbs up*
     
    Jonathan likes this.
  13. Jonathan

    Jonathan Woohoo Administrator Verified Provider

    389
    196
    May 27, 2013
    jonspw
    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: Sep 28, 2015