Private IP automation
I am trying to have an automated way of creating and configuring my nodes and want them to communicate through the private network.
However, when I took a look at the API, I wasn't able to tell how I can get a private IP this way.
So I wanted to know if there is a way to enable the private IP of a node via some script rather than using the Linode Manager.
Thanks.
11 Replies
Is there a reason why you need to automate this? Why not just set up the private network on each machine and leave it at that?
As the decision for creation and deletion of nodes will be triggered by a program, it would be really inconvenient to have to request the private IP manually.
Thanks,
-Chris
I hope you can get this running as soon as possible
In my case, I would like to spawn up a bunch of boxes (say, 10 of them) for just one day a month. But I don't want to have to go configure the private IPs just so I can get them to see the persistent database server that they'll be communicating with…
At this point the API does seem to provide everything that would be needed to automate this without the DHCP assignment but it'd be sooo much easier for users to configure some type of automated scaling if the private IPs would be active immediately upon reboot via DHCP.
But, we could work in an 'ip-config helper' that spruces up your network interface config files for you. It would be disable-able, of course.
-Chris
DHCP - Aren't the steps that we take manually (am doing exactly this right now for a new Linode, heh, ~60% done) just adding a second interface meaning that you could potentially have two configured by default and so still be able to use DHCP for the private? Upon taking a closer second look at the instructions (it's early & I tend to stay closer to the app level generally heh) it actually looks like the other IPs are configured on virtual interfaces instead, eh? I'm not familiar TBH, is this where the limitation comes in to play? I guess I would expect, perhaps naively, that some of the new virtualization stuff would support a configuration like thus but obviously this is a good bit out of my knowledge range…
IP-Config Helper - Could you elaborate on this a bit more perhaps? Would this be a binary or something that in essence is a remote system that would automatically make the appropriate configuration changes via Lish or similar direct access login? Really just interested in what you had in mind, at first glance it sounds like it could potentially be a very useful addition. I'd actually even be interested in hearing more about what you have in mind as far as this approach is concerned as it's something, depending on what you had in mind, that I might be interested in writing / helping to write or at least contributing to if possible (assuming you weren't thinking something more from the VM side / that I wouldn't have access to obviously)…
They're on-boot helpers on the host that is bringing up your Linode. It mounts your filesystem, does stuff, unmounts and then boots it. This already happens with a few other things (console device, etc) which you can see clicking on your configuration profile.
If you're trying to achieve automation for now you're better off querying the API and then adding the (three?) lines to your network configuration file (/etc/network/interfaces for Debuntu, for example). Pretty straight forward.
(boot your Linode)
-Chris
OnBoot helpers - Ah, I see. Is the code for these available anywhere that I could take a look at (either on the Linodes themselves and/or via GitHub or similar) perhaps? I'd definitely be interested in seeing it added [or contributing it myself] especially since it seems like it'd be somewhat straight-forward to add. I'd also be curious if something similar could be added to auto-mount additional disk images that are attached to a Linode at boot time. Obviously the latter concern is pretty small, and is very easily automated around as-is, but seems like another semi-easy addition that would possibly be quite helpful & useful for much of the Linode user base.
API - Yep, that's the route I'm probably going to go down, appreciate the guidance & confirmation. We're already making some similar calls for automated deployment via Capistrano which is configured to dynamically lookup the 'server pool' and deploy the appropriate code / configs to each server in the pool based on its role. Will likely do something similar here as well.
Thanks again for the [super fast] replies on such an old thread, very much appreciated!
FWIW, I'm continually impressed by Linode - basically nothing to complain about - you guys have really surpassed my expectations all around (and my hopes / expectations began quite high)!
Thank you!
In case you don't know, intra-data center IPv6 traffic is free, just like traffic over IPv4 private IPs. And a node's (first) IPv6 address comes up automatically via SLAAC, similarly to how DHCP is used for your primary IPv4 address. So if all of your software supports IPv6, you can switch to it and avoid IPv4 private IPs and the configuration hassle.
Remember, this doesn't mean you have to force your users to use IPv6, or even expose it to them at all. I just mean using it for your backend traffic. (This assumes you aren't actually providing public services to other Linode customers over the private network, I guess.)
Edit: Copy editing.