Hacker News new | ask | show | jobs
by mwpmaybe 3413 days ago
PSA: If you're using the Linode API, the 2048 plan is now PlanID 2 and the new 1024 plan is now PlanID 1. The other PlanIDs were incremented by one as well. I wish they hadn't done that, but there it is.
5 comments

That's just... ugh. Who thought ordinal numbers were a good idea for plan ids / instance types? Seems part of what you are paying extra for with AWS/GCP etc is competent engineering.
The obvious alternative would be to make the plan IDs reflect the resource limit, e.g. 1024, 2048, 4096, etc.

But that doesn't work with Linode plans because they keep increasing the resources every now and then. They doubled the RAM on all the low-end plans a couple of years ago. Before that, they doubled the storage.

Another option would be to use random IDs that point to a specific bundle of resources. But then the plans change, and the previous bundle is no longer available for purchase.

It's hard to use consistent identifiers when the resources they point to change so often. Linode customers absolutely love those free upgrades.

I have just created an account to say this: CHANGING THE ID OF THE PLAN IS INSANE AND CLEARLY A BAD-DEVELOPER CHOICE.

I bet there is a piece of code in Linode codebase that has the plan resources mapped in a table, with a list of ID attached to the various sizes. The genius developer decided that it makes sense to have the "growing number ID" match the "growth in resources" assigned to the plan. In other words, the bigger ID should always mean MORE resources.

This leads them to alter IDs if they have to introduce plan-sizes that are small.

Imagine if AWS did this: you would see riots in the streets!

Yep just got bit by this as well. We're heavy users of the API and this was a surprise. Would have preferred some notification about the change OR better yet, just create these instances with new plan ID's.
That's really not cool.
That sucks. Those PlanIDs should never change.
Well, they've changed in the past... it's fine as long as the plans corresponding to the PlanIDs never get smaller or more expensive. This particular change violates that assumption and so is definitely not fine.
The hardcoded plan (PlanID 2) that I had in my program was pointing to a 4 GB 2 CPU plan (4 GB), now it's pointing to a 2 GB 1 CPU plan (2 GB).
There is an API method to query plans: https://www.linode.com/api/utility/avail.linodeplans

Presumably you can select the relevant ID based on plan properties (cores, RAM, etc.) rather than hardcoding IDs. Though I completely agree that once a plan has a specific ID, as long as that plan is available the ID should be constant.

Yeah, that's... not practical.

What if they upgrade the 1024 plan to 1536? (That has actually happened, by the way.) Now you're extracting the number and comparing it to a range?

> Give me the plan where the RAM is >= 1024 and < 2048.

What if they upgrade the 1536 plan to 2048?

> Nevermind, just give me the plan with two cores.

Okay, do you want the $20/mo plan or the $120/mo plan?

> Fine, sort the plans by cores and memory and give me the smallest plan.

Oops, they introduced a new plan with one core and less (i.e. not enough) storage.

I'm not saying it's impossible. Just impractical.

It's not as difficult as you're suggesting. Figure out your minimum specs and get the cheapest plan that meets them.
Why have there been no Diep.io updates lately? Would you like to join our Diep.io Discord: https://discord.gg/vJVqhTf#discordbutton?