If you own a cloud server with PCX you can migrate it by using snapshot. In this manual we will show you how this is done.
Contents
Introduction
In this article we will discuss how you can create snapshot and save it as a backup. We then explain how to make a template to deploy a new cloud server. Finally we talk about debugging and troubleshooting.
Available methods
There are two methods you can use to migrate a server to a new location. In this tutorial we will use the Control Panel and for the power-users we have an API witch can be accessed with cloudmonkey, a Python program.
Guide
Follow this step-by-step guide to safely migrate your cloud server.
Step 1: Create a snapshot
Before creating a snapshot of your root volume shut down your instance. This will make sure the data will remain consistent.
- Navigate to Products & Services;
- Click on Servers and then Instances;
- Find My server and go to Attached volumes;
- Select Snapshot from the menu.
The snapshot will then go into backup state and change into Backed up when finished. To find the snapshot navigate to
Products & Services > Servers >Snapshots.
Step 2: Create a template
To deploy a new cloud server based on this snapshot we have to create a template.
- Navigate to Products & Services;
- Click on Servers;
- Choose Snapshots and select Register template;
- Fill in the name and description of this template.
Please note that the template can be used to deploy multiple servers, so make sure to give it a good description.
Step 3: Deploy the new server
When the template is done processing we can deploy a server based on it.
- Go to Products & Services;
- Click on Servers and then Instances;
- Choose Deploy instance.
When asked for the server type select Custom templates and choose the template you’ve just created. You should now have a new cloud server which is identical to the old one but with new IP-addresses.
Troubleshooting
When migrating a server a few things can go wrong. The best way to debug a Linux server is by entering the SingleUserMode or booting from a RescueImage. Here is a tutorial on how to edit the kernel parameters and enter Single User Mode. A list of the most common problems you may encounter after migrating a server:
SElinux
If you are running a RHEV based OS like CentOS you might run into problems with SElinux and file labeling. To fix this add selinux=0 at the end of the kernel parameters. This will disable SElinux.
You might also need to relabel the system before booting. This can be done by adding an .autorelabel file on the root partition. Enter the system in SingleUserMode and execute this command: touch /.autorelabel.
Mountpoints
It is possible that the server had extra disks or network-points set up to automatically mount on boot. These can be found in the /etc/fstab file. When a disk cannot be found or a network point cannot be accessed the server might not boot.
To fix this, enter the system with SingleUserMode and edit /etc/fstab. Here you can comment out or delete the faulty entry(s). Please make sure you relabel the system (see SElinux) and execute the command sync before rebooting.
Network
Keep in mind that the server will get a new IP-address. Make sure your network configuration is set up for DHCP. The server needs this in order to get a new IP-address lease from the DHCP server.
It is also possible for the network interface name to change. For example: old: eth1 new: eth0. If this occurs you must edit the network configuration and change the name of the interface to the correct one. To see what interfaces are available, please run this command: ip l. The best way to do this is by entering SingleUserMode and execute this command: sed -i '/old_interface/new_interface/g' /etc/network/interfaces.
Was dit artikel nuttig?
Dat is fantastisch!
Hartelijk dank voor uw beoordeling
Sorry dat we u niet konden helpen
Hartelijk dank voor uw beoordeling
Feedback verzonden
We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren