Help Center/ Elastic Cloud Server/ User Guide (Paris Regions)/ Instances/ Modifying ECS Specifications/ Automatically Changing a Xen ECS to a KVM ECS (Linux)
Updated on 2024-07-24 GMT+08:00

Automatically Changing a Xen ECS to a KVM ECS (Linux)

Scenarios

Before changing a Xen ECS that runs Linux to a KVM ECS, make sure that the required drivers have been installed and configured on the ECS.

This section describes how to use a script to automatically install drivers on the ECS, configure the device name, and change Xen to KVM.

  • Xen ECSs include S1, C1, C2, T2, and M1 ECSs.
  • To obtain KVM ECSs, see the Virtualization column in ECS Specifications and Types.
  • 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 driver installation and automatic disk attachment.

Constraints

  • To prevent data loss, the specifications of Linux ECSs that use LVM or RAID arrays cannot be modified.
  • 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

Figure 1 shows the flowchart for automatically changing a Xen ECS to a KVM ECS.
Figure 1 Flowchart for automatically changing a Xen ECS to a KVM ECS
Table 1 OSs that support automatic configuration using a script

OS

Version

CentOS

  • CentOS 7
  • CentOS 6

Debian

  • Debian 9
  • Debian 8

EulerOS

  • EulerOS 2

OpenSUSE

  • OpenSUSE 42
  • OpenSUSE 15

SUSE

  • SUSE 15
  • SUSE 12
  • SUSE 11

SUSE-SAP

  • SUSE-SAP 12

Ubuntu

  • Ubuntu 18.04
  • Ubuntu 16.04
  • Ubuntu 14.04

Red Hat

  • Red Hat 7
  • Red Hat 6

Fedora

  • Fedora 29
  • Fedora 28
  • Fedora 27
  • Fedora 26

Oracle Linux

  • Oracle Linux 7
Table 2 describes the operations for automatically changing a Xen ECS to a KVM ECS using a script.

(Optional) Step 1: Back Up System Disk Data

If you modify the specifications of an ECS without installing the driver, the ECS may become unavailable and the data on the system disk may be lost. Therefore, back up the system disk first.

  1. Before you create a system disk backup, check the ECS.

    Stop and then start the ECS to ensure that services can run properly after the ECS is started. Back up the system disk.

  2. For instructions about how to back up the system disk, seeCreating a VBS Backup.

Step 2: Using a Script to Automatically Install Drivers

Use a script to install drivers on an ECS. If your ECS does not support configuration using a script, manually configure it by referring to Manually Changing a Xen ECS to a KVM ECS (Linux).

For details about the ECS OSs that support automatic configuration using a script, see Table 1.

  1. Log in to the ECS.
  2. Run the following command to download the driver installation script to the root directory:

    curl URL > ~/resize_ecs_modify_linux.sh

    In the preceding command, URL is the address for downloading the specifications modification script.

    Select an address for downloading the optimization script based on the region where the ECS is located:

    URL for downloading the script: https://latin-server-resize.obs.na-mexico-1.myhuaweicloud.com/linux/server_resize/resize_ecs_modify_linux.sh

  3. Run the following command to execute the script which automatically checks and installs the native Xen PV driver and virtio driver:

    bash resize_ecs_modify_linux.sh

    Figure 2 Executing the script
  4. Wait until the script is executed.

    After checking that the required driver has been installed, the system automatically tags the ECS. The specifications of only the tagged ECSs can be modified.

    If the check result is "{Image name} already contain xen and virtio driver", the driver has been installed.
    • If the check result is "Success to set kvm meta!" or "this server already has kvm meta.", the ECS has been tagged. Then, go to Step 3: Modify Specifications.
    • If the check result is "Failed to set metadata, please try again.", tagging the ECS failed. In such a case, try again later.

    If the installation failed, manually configure the ECS by following the instructions provided in Manually Changing a Xen ECS to a KVM ECS (Linux) or contact customer service.

    Figure 3 Successful script execution

Step 3: Modify Specifications

  1. Log in to the management console.
  2. Under Computing, click Elastic Cloud Server.
  3. 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.

  4. Click More in the Operation column and select Modify Specifications.

    The Modify ECS Specifications page is displayed.

  5. Select the new ECS type, vCPUs, and memory as prompted.
  6. (Optional) Set DeH.

    If the ECS is created on a DeH, you can change the DeH where the ECS resides.

    To do so, select the target DeH from the drop-down list. If no DeH is available in the drop-down list, it indicates that DeH resources are insufficient and cannot be used to create the ECS with specifications modified.

  7. Select the check box to confirm that the configuration is complete.
  8. Click OK.

(Optional) Step 4: 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 specifications have been modified but the OS cannot be started after remote login, reinstall the ECS OS to resolve this issue. For details, see Reinstalling the OS.