Replacing a Linode
My question is with deployment when I'm finished. I don't want to have to mess around changing DNS settings for the new IP and new reverse DNS config because of the change of name and IP.
The ideal situation would be:
Setup temporary server how I want it, on a 5GB disk image.
Move that disk image to the other linode,
Shut down primary linode
Switch boot drive to other image,
Boot into new environment
Possible?
7 Replies
You can switch your 'boot drive' setting while your node is booted, FWIW. That saves you 30 seconds.
A different option is to swap the two nodes' IPs on the Remote Access tab of the manager and then just delete your first node.
So If I have 5GB of space spare on my first Linode the image from the temporary Linode will be able to swap straight in when I want it?
Downtime isn't an extreme priority, I could deal with an hour, so this sounds perfect.
Just to be clear, the disk image would be moved to the primary Linode, not just referenced. Once I delete the temporary Linode it will leave the disk image behind on the primary Linode right?
Thanks
I'm in the process of doing the same task as paystey, only I'm using the static networking approach as laid out in the Static Networking Guide
Can somebody double-check me on this to make sure I've got my process correct? Ideally, Linode B (the new box) will "inherit" all the IPs of Linode A (the old box), including private and IPv6 addresses. For the record, I'm running Fedora on all my boxes.
3. As a safety measure, shut down non-essential services (Apache, MySQL, etc.).
As another safety measure, back up key network configuration files (/etc/sysconfig/network, /etc/hosts, /etc/resolv.conf, /etc/sysconfig/network-scripts/ifcfg-eth0*).
Edit these configuration files manually to swap all relevant IPs (public IPv4, private IPv4, IPv6) and host names, so Linode A will have Linode B's addresses and vice versa. However, DO NOT restart the network service. (I don't want this to take effect immediately.) Theoretically, the IPs should now be swapped from the perspective of the config files, but not the Linode Manager.
Shut down both Linodes via the Linode Manager. (Scheduled downtime is OK for this process.)
Swap the IPs via the Linode Manager. Logically, from the perspective of the Manager, the IPs should now be swapped.
Restart both Linodes. Theoretically, the IPs should now be swapped from the perspective of both the Manager and the static configuration files.
I am assuming that since I'm using static networking rather than DHCP that I need to manually swap the IPs in the config files first before swapping them in the Linode Manager. However, since I'm planning to swap out a "production" server with its replacement, I don't want to take too many chances with it to experiment. (That said, this is already an experiment of sorts. I'm currently replacing my blog server which is usually my test bed before performing such tasks on my "bread and butter" commercial site.)
Any thoughts on this would be appreciated.
I went ahead, took the plunge, and followed my suggested script above. For the benefit of anyone else looking to try this tactic with a static IP setup, don't bother. Just switch your IPs in your DNS and everywhere else you need to; it's probably less hassle.
For completeness, I can say that the process I outlined above works, but for public IPv4 addresses only. It does NOT work for public IPv6 addresses, or for private IPv4. (I don't rely on the link-local IPv6, so I didn't bother dealing with it.) Even though I swapped the private IPv4 and the public IPv6 addresses in all the necessary config files, the Linode Manager didn't seem to care; the "IP Swap" function only swaps public IPv4. So in the end, I still had to go in and change a dozen or so IPv6 related DNS entries, which only saved me about half the work of changing them all. While manually tweaking scripts and such to deal with changing private IPs wouldn't have been a problem, it would have been nice if the Manager had the capability to swap public IPv6 addresses as well. Maybe that's just "too new" of a feature for anyone to have considered it.
So bottom line: If you use static IPs and don't use IPv6, my outline above should work. If you use static IPs and do use IPv6, don't bother with an IP swap and just change your DNS entries. You'll have to change your private IPv4 addresses in all your scripts regardless.
pool ofIPv6 addresses