get Linode info from api within the linode

I'm wondering if this is possible, if not then i'll feature request it :)

EC2 has an ability to get basic instance information from within the instance without needing to authenticate with there API - its basically a web interface on an internal only ip that returns key info like ip, instance id etc

I'm currently writing a stack script for a common stack we need to setup including r1soft/idera

now as you may be aware r1soft/idera needs a custom kernel module compiling and i've historically had problems with compiling with the current versions of the kernel so i generally just switch to pv_grub with linode and use the debian stock kernels (i'd rather not but here we are anyway)

as part of the stackscript process i'd like to update the kernel for the config of the linode from the default (which is needed to get things going) to the pv_grub kernel once the relevant inside vm stuff is done (installing the kernel and grub etc so this means i need to work with the API which isnt such a big deal

however i have no way of currently being able to identify the linode without having info to start with (that is i would have to edit the stackscript manually once i created the linode so i can inject the linodeid into the script

so i ask, is this kind of info available to our linodes in any form?

3 Replies

as an update to this

StackScripts pass the LINODEID into a Bash Variable that you can use, it turns out i need the ConfigID to update the kernel setting and the API doesnt have any clear display of what config is active - so for now i have "cheated" i've assumed that at the point this stack script is used, there will only ever be one Config for a particular linode so just extract the ConfigID from the linode.config.list api call - its hacky but it works

I've half a mind to leverage the network of people that I can and see if there's any merit to some kind of cross-provider standard here, be that a standardization upon Amazon's mechanism or some kind of vendor-neutral identification scheme. You know what they say about standards, though…

Every piece of devops software -- think Chef, etc. -- needs to solve this in some way, and none of them can reverse the Linode ID from just the running Linode's environment without using a Stackscript. For those of you unfamiliar with Amazon's mechanism, Amazon offers a Web API running on which, when accessed from the instance, returns metadata for the instance itself. No identification required. Lots of things make use of this, like cloud-init.

We talked about it when I worked at Linode, so it was definitely on the radar. Would be nice to see.

its nice that LINODEID is passed via the stackscript which is great, it would good if it also passed the running/created CONFIGID through as well - it would solve my needs perfectly

my solution was hacky and will fail the moment i have more than one config setup for a single linode

but definitely +1 for some standardisation on linodes being able to get there metadata from an internal only API - the AWS is the most elegant solution i can say i have seen for this kind of stuff


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct