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
OS |
Version |
---|---|
CentOS |
|
Debian |
|
EulerOS |
|
OpenSUSE |
|
SUSE |
|
SUSE-SAP |
|
Ubuntu |
|
Red Hat |
|
Fedora |
|
Oracle Linux |
|
(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.
- 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.
- 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.
- Log in to the ECS.
- 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
- 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
- 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
- Make sure that the ECS has been configured successfully, or the ECS may become unavailable after the specifications are modified. If the operation failed, follow the instructions provided in Manually Changing a Xen ECS to a KVM ECS (Linux) for manual operations.
- FAQs related to a script installation failure:
Step 3: Modify Specifications
- Log in to the management console.
- 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, 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.
- Select the check box to confirm that the configuration is complete.
- 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.
- Linux ECS
For details, see Why Does the Disk Attachment of a Linux ECS Fail After I Modify the ECS Specifications?
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot