How do I schedule my Linode's Maintenance Migration
I have recently received an email saying that my Linode needs to be migrated due to impending scheduled maintenance. How do I change the schedule?
1 Reply
About Scheduled Maintenance
When Linode Schedules Maintenance Migrations for one of its hosts, all of the Linodes that run on that host need to be migrated in the same window of time. This means that you can migrate ahead of the window that is provided for you, but you cannot postpone the deadline. The deadline has been coordinated with many other customers.
Manually Starting Your Migration
You can manually start your migration ahead of the scheduled maintenance using the “click here” link located in the banner at the top of your Linode's Summary page.
Automatically Starting your Migration at a Specific Time
If you need to have your Linode migrate at a time when you will not be around. (For example, you want your migration to occur in the middle of the night when there is no traffic to your website) This can be done by using the Linode API. The Linode API allows the automation of tasks that would normally be handled through the Linode Cloud Manager web interface. The basic outline of what we are going to do is:
- Generate an API key that a temporary Linode will use for permission to launch your migration
- Create the temporary Linode to supervise the migration for you
- Use the
at
command to schedule the migration to occur when you would like
Generate an API Personal Access Token
General Instructions can be found here: https://www.linode.com/docs/guides/getting-started-with-the-linode-api/
Call your token something like "Migrate Linodes", leave the default "In 6 Months" for the expiry and give it "Read/Write" Access to Linodes.
Your token will look something like: 9d3cd2872221f4d68f19668b10fa399defdc866ffad34443f58ce3aa42b16de9
Create a temporary Linode
Create Linode using the "Debian 10" distribution image. Select the cheapest "Nanode 1GB" plan and create a strong password for it.
Login to your Linode using LISH and set your Linode's timezone with the following command:
dpkg-reconfigure tzdata
- Update your packages:
apt-get update && apt-get upgrade
- Install the
at
package:
apt-get install at
- From the Linode Manager, click on "Linodes" and then click on the Linode that you will be migrating. Make a note of your Linode's Linode ID as shown on the line that shows your Linode's Plan, Region, Linode ID and Creation Date. I will use the Linode ID
25415867
for this example.
Schedule Your Migration
You will use the at
command to setup a migration for your Linode. Please note that the time you schedule should be at least a few hours in advance of your Linodes migration deadline. From the LISH console, use a command like the following (replace the API key and the Linode ID shown with your own):
root@localhost:~# at 18:15 3/21/21 <<END
> curl -H "Content-Type: application/json" \
> -H "Authorization: Bearer 9d3cd2872221f4d68f19668b10fa399defdc866ffad34443f58ce3aa42b16de9" \
> -X POST -d '{}' \
> https://api.linode.com/v4/linode/instances/25415867/migrate
> END
Documentation for the at
command can be found here: https://debian-handbook.info/browse/stable/sect.task-scheduling-cron-atd.html
Once your Migration has occurred you may now remove your temporary Linode