Manually Changing a Xen ECS to a KVM ECS (Linux)
Scenarios
Before changing a Xen ECS that runs Linux to a KVM ECS, install and configure desired drivers.
This section describes how to manually install drivers on a Linux ECS, configure automatic disk attachment, and change Xen to KVM.
For instructions about how to use a script to automatically install drivers, see Automatically Changing a Xen ECS to a KVM ECS (Linux).
- Xen ECSs include S1, C1, C2, and M1 ECSs.
- To obtain KVM ECSs, see the Virtualization Type column in ECS Specifications.
- To support both Xen and KVM, Linux ECSs require the xen-pv and Virtio drivers. Before changing a Xen ECS to a KVM ECS, make sure that the Linux ECS has been configured, including installing drivers and configuring automatic disk attachment.
Constraints
- If a Linux ECS is attached with a logical LVM disk or a RAID disk array consisting of multiple physical disks, the ECS specifications cannot be modified. Otherwise, data may be lost.
- A Xen ECS with more than 24 VBD disks attached cannot be changed to a KVM ECS.
- A Xen ECS can be changed to a KVM ECS, but a KVM ECS cannot be changed to a Xen ECS.
Procedure
| Step | Task |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |
Step 1: Create a System Disk Snapshot
Before modifying the specifications, back up the system disk by creating a system disk snapshot and install drivers on the ECS. Otherwise, once the ECS becomes unavailable after the modification, the data in the system disk may be lost.
For instructions about how to create a system disk snapshot, see Creating a Snapshot in Elastic Volume Service User Guide.
After the specifications are modified, manually delete the snapshot on the snapshot page if you verify that services have been recovered.
Step 2: Install Drivers
Perform the operations described in this section if your ECS does not support the configuration using a script.
- Log in to the ECS.
- Uninstall Tools from the ECS.
For details, see Uninstalling Tools from a Linux ECS.
- Change the GRUB disk ID to UUID.
For details, see Changing the Disk Identifier in the GRUB Configuration File to UUID.
- Change the fstab disk ID to UUID.
For details, see Changing the Disk Identifier in the fstab File to UUID.
- Install native Xen and KVM drivers.
For details, see Installing Native Xen and KVM Drivers.
Step 3: Check Whether the ECS Has Been Configured
Perform the following operations to check whether the drivers have been installed and the configuration files have been modified.
Before manually configuring an ECS, perform the following operations to check existing ECS configurations.
- Log in to the ECS.
- Run the following command to check whether the root partition is in UUID format:
- If yes, the disk ID in the GRUB configuration file has been changed to UUID.
- If no, the modification failed. In such a case, change the GRUB disk ID to UUID again.
...menuentry 'Ubuntu Linux, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-ec51d860-34bf-4374-ad46-a0c3e337fd34' { recordfail load_video gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34 else search --no-floppy --fs-uuid --set=root ec51d860-34bf-4374-ad46-a0c3e337fd34 fi echo 'Loading Linux 3.13.0-24-generic ...' linux /boot/vmlinuz-3.13.0-24-generic root=UUID=ec51d860-34bf-4374-ad46-a0c3e337fd34 ro echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.13.0-24-generic }
The path in which the GRUB configuration file is stored varies depending on the OS. For example, the path can be /boot/grub/menu.lst, /boot/grub/grub.cfg, /boot/grub2/grub.cfg, or /boot/grub/grub.conf.
- Run the following command to check whether the disk ID in the fstab configuration file is UUID:
- If yes, the disk ID has been changed to UUID.
- If no, the modification failed. In such a case, change the fstab disk ID to UUID again.
[root@****** ~]# cat /etc/fstab UUID=4eb40294-4c6f-4384-bbb6-b8795bbb1130 / xfs defaults 0 0 UUID=2de37c6b-2648-43b4-a4f5-40162154e135 swap swap defaults 0 0
- Check whether the native Xen and KVM drivers have been installed.
- If the boot virtual file system is initramfs, run the following commands:
lsinitrd /boot/initramfs-`uname -r`.img | grep ` uname -r ` | grep xen
lsinitrd /boot/initramfs-`uname -r`.img | grep ` uname -r ` |grep virtio
- If the boot virtual file system is initrd, run the following commands:
lsinitrd /boot/initrd-`uname -r` | grep ` uname -r ` | grep xen
lsinitrd /boot/initrd-`uname -r` | grep ` uname -r ` | grep virtio
If the names of the native Xen and KVM drivers are displayed in the command output, the drivers have been installed.
[root@CTU10000xxxxx home]# lsinitrd /boot/initramfs-`uname -r`.img | grep ` uname -r`| grep xen -rwxr--r-- 1 root root 54888 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/block/xen-blkfront.ko -rwxr--r-- 1 root root 45664 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/net/xen-netfront.ko [root@CTU10000xxxxx home]# lsinitrd /boot/initramfs-`uname -r`.img | grep ` uname -r`| grep virtio -rwxr--r-- 1 root root 23448 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/block/virtio_blk.ko -rwxr--r-- 1 root root 50704 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/net/virtio_net.ko -rwxr--r-- 1 root root 28424 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/scsi/virtio_scsi.ko drwxr-xr-x 2 root root 0 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio -rwxr--r-- 1 root root 14544 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio.ko -rwxr--r-- 1 root root 21040 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio_pci.ko -rwxr--r-- 1 root root 18016 Jul 16 17:53 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio_ring.ko
- If the boot virtual file system is initramfs, run the following commands:
- Run the following command to update the system status of the ECS:
curl 'http://169.254.169.254/openstack/latest/support_hypervisor' -X POST -H "Accept: application/json" -d '{"support_hypervisor":["all"]}' -w %{http_code}
If 200 is displayed in the command output, the system tag of the ECS has been added.
Figure 2 Setting the ECS system tag
Make sure that the ECS has been configured successfully. Otherwise, the ECS will be unavailable after the modification is performed.
Step 4: Modify Specifications
- Log in to management console.
- Click
in the upper left corner and select the desired region and project. - Under Computing, click Elastic Cloud Server.
- On the Elastic Cloud Server page, view the status of the target ECS.
If the ECS is not in Stopped state, click More in the Operation column and select Stop.
- Click More in the Operation column and select Modify Specifications.
The Modify ECS Specifications page is displayed.
- Select the new ECS type, vCPUs, and memory as prompted.
- (Optional) Set DeH.
If the ECS is created on a DeH, the system allows you to change the DeH.
To do so, select the target DeH from the drop-down list. If no DeH is available in the drop-down list, remaining DeH resources are insufficient and cannot be used to create the ECS with specifications modified.
- Select the check box to confirm the ECS configuration.
- Click OK.
- The cloud platform automatically creates a system disk snapshot for you. After the specifications are modified, manually delete the snapshot on the snapshot page if you verify that services have been recovered.
- If modifying the ECS specifications failed and the ECS becomes unavailable, reinstall the OS to recover the ECS. However, this operation will clear the system disk data, and data disk data is retained.
(Optional) Step 5: Check Disk Attachment
After a Xen ECS is changed to a KVM ECS, disk attachment may fail. Therefore, check disk attachment after specifications modification. If disks are properly attached, the specifications modification is successful.
Follow-up Procedure
If the ECS with specifications modified is displayed in the ECS list but its OS cannot be started after the ECS is remotely logged in, contact customer service or reinstall the ECS OS to rectify this fault. For details, see Reinstalling the OS.
Reinstalling the OS will clear the system disk, but not affecting data disks.
After the specifications are modified, manually delete the snapshot on the snapshot page if you verify that services have been recovered.
Last Article: Automatically Changing a Xen ECS to a KVM ECS (Linux)
Next Article: Automatically Changing Xen ECSs to KVM ECSs in a Batch (Linux)

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.