get Linode info from api within the linode
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?
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
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
We talked about it when I worked at Linode, so it was definitely on the radar. Would be nice to see.
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