Operating system maintenance FAQ

更新时间:
复制 MD 格式

Changing the operating system

Linux system issues

Windows system issues

Red Hat image issues

SUSE image FAQ

CentOS image issues

Ubuntu image issues

FreeBSD image issues

Fedora image issues

Alibaba Cloud Linux issues

General issues

Alibaba Cloud Linux 3

Alibaba Cloud Linux 2

Guest OS FAQ

Linux guest OS: issues and solutions

Boot failures

Logon failures

Instance access issues

Network connectivity issues

Performance issues

Windows guest OS: issues and solutions

Logon failures

Performance issues

  • High CPU utilization

    Sustained high CPU utilization can affect system stability and service performance. For more information, see Troubleshoot and resolve high CPU utilization on a Windows instance.

  • Check the Windows operating system version

    Microsoft ended support for Windows Server 2008 and Windows Server 2008 R2 on January 14, 2020. Therefore, Alibaba Cloud no longer provides technical support for ECS instances that run these operating systems. If you have ECS instances that run these operating systems, update them to Windows Server 2012 or a later version as soon as possible. For information about the supported images, see public images or refer to the buy page.

  • Check the disk capacity

    Insufficient space on the C drive can prevent the system from operating correctly. For more information, see How to troubleshoot low space on the C drive of a Windows instance.

AD domain controller installation failures

Other issues

Appendix

Change the operating system (system disk)

You can change the operating system (replace the system disk) by changing the image of an ECS instance.

Warning

After you change the operating system (replace the system disk), the original system disk is released and all data on the disk is erased. We recommend that you manually create a snapshot of the system disk to back up data beforehand.

Change the OS with a shared custom image

Yes. Account A must first share the custom image with Account B. Then, Account B can use the image to change the operating system (replace the system disk).

Use an image with data disk snapshots

You can use a custom image that contains data disk snapshots to change the operating system. This operation replaces only the system disk of the instance and does not affect its data disks.

Important

If you use a custom image that contains data disk snapshots to change the operating system, ensure that no service dependencies exist between the system disk and the data disks. Also, ensure that the new system disk's operations do not disrupt your business processes. For example, if your services read data from or write data to a data disk, read or write errors may occur after you change the operating system.

Change OS vs. re-initialize system disk

The main differences are described in the following table.

Item

Re-initialize system disk

Change operating system

Functional differences

Restores the ECS instance to its initial state. The operating system remains unchanged.

Replaces the current operating system with a different one.

Impact on the system disk

  • The original system disk is not released.

  • The system disk is restored to its state at the time of creation. Applications installed and data generated after the instance was created are erased. We recommend that you back up your data.

  • The system disk ID, disk type, and IP address of the ECS instance remain unchanged.

  • The original system disk is released after the operating system is changed.

  • All data on the system disk is erased. We recommend that you back up your data.

  • The system disk ID changes, but the disk type, the IP address of the ECS instance, and the MAC address of the elastic network interface remain unchanged.

Impact on data disks

Data disks are not affected.

Data disks are not affected.

Impact on snapshots

  • You can use snapshots of the system disk to roll back the disk.

  • Manual snapshots and automatic snapshots created from the system disk are retained.

  • The automatic snapshot policy remains in effect and does not need to be reconfigured.

  • Snapshots of the original system disk cannot be used to roll back the new system disk, but they can be used to create custom images.

  • Manual snapshots created from the original disk are not released.

  • If Delete Automatic Snapshots While Releasing Disk is enabled for the original system disk, its automatic snapshots are deleted. If Delete Automatic Snapshots While Releasing Disk is disabled, the automatic snapshots are released upon expiration.

  • The automatic snapshot policy for the original system disk becomes invalid and must be reconfigured.

Billing

Re-initializing a system disk is free of charge. The billing items do not change because the operating system remains the same.

Changing the operating system is free of charge. However, fees apply in the following cases:

  • If you replace the current image with a paid image, you are charged for the new image. For more information, see Image pricing.

  • If you increase the system disk capacity when you change the operating system, you are charged for the additional capacity. For more information, see Block storage pricing.

System disk resize failure during OS change

Resizing a system disk partition during an OS change may fail due to a timeout. If this occurs, you must manually extend the partition. For more information, see Extend partitions and file systems of a Linux disk. This method extends only the system disk partition and does not affect the operating system version.

Troubleshoot the non-I/O optimized instance error

Cause

An instance's I/O optimization attribute must match the image's. I/O optimized instances require I/O optimized images, and non-I/O optimized instances require non-I/O optimized images. A mismatch prevents you from selecting the image. In this case, the "The instance is a non-I/O optimized instance. You can select only an image that supports non-I/O optimized instances when you change the operating system" message appears.

Solution
  1. All available instance types are I/O optimized. We recommend that you change the instance type.

  2. Select an image that supports non-I/O optimized instances to change the operating system (replace the system disk).

Note
  • You can call the DescribeInstances operation and check the value of the IoOptimized parameter to query the I/O attribute of an instance.

  • You can call the DescribeImages operation and check the value of the IsSupportIoOptimized parameter to query the I/O attribute of an image.

Reset the system time zone

For a single instance, run the timedatectl set-timezone command to change the time zone.

You can use Cloud Assistant to change the time zones of multiple instances at once.

Container runtime in Windows Server with Container images

Due to changes in Microsoft's support policy for container runtimes (for more information, see Supported Container Runtime on Windows Server), Windows Server with Container images updated by Alibaba Cloud ECS since early 2024 no longer include Mirantis Container Runtime (MCR). Instead, they include the open-source containerd runtime. If you require MCR, you must purchase and install Mirantis Container Runtime from Mirantis.

Starting March 1, 2024, Windows Server with Container images provided by Alibaba Cloud ECS include the following container-related components:

  • The Windows Server container feature. Hyper-V isolation is not supported. For more information, see Windows and containers.

  • The containerd runtime, version 1.7.13. For more information, see containerd.

  • nerdctl.exe, a command-line interface (CLI) for managing containers, version 1.7.13. For more information, see nerdctl.

  • nat.exe, a Container Network Interface (CNI) plugin for Windows container networking, version 1.0.0. For more information, see windows-container-networking.

User data script write failure on Windows

Issue

When you use a user data script to write data to the C:\Users\Administrator\Desktop\userData_test.txt path, the operation fails with a "path not found" error.

Cause

In Windows, the C:\Users directory and its subdirectories are the default storage locations for user profiles and data. You can access these locations only after logging on to the system. The user data script runs during instance initialization, before a user logs on. Therefore, attempts to write data to the C:\Users directory fail.

Solution

To resolve this issue, modify the write path in your user data script to a directory that is not user-specific, such as the root of the C: drive. For example:

[bat]
echo "userData" > C:\userData_test.txt

For more information, see Customize instance initialization configurations.

Limitations of the Windows Server 2025 image

Windows Server KMS activation in a VPC

To activate a Windows instance in a VPC, use a specific KMS domain name. For instructions, see How to use a KMS domain name to activate a Windows instance in a VPC.

To activate a Windows instance in a VPC, use a specific KMS domain name. For instructions, see Activation methods for Windows instances in a VPC.

To activate a Windows instance in a VPC, use a specific KMS domain name. For instructions, see Activation methods for Windows instances in a VPC.

"Windows is not genuine" error

Activate Windows to resolve this error. For instructions, see Activate a Windows Server on an ECS instance with a KMS domain.

Inaccurate system time caused by timeBeginPeriod API

On an ECS instance running Windows Server 2008, frequent calls to the timeBeginPeriod Windows system API can make the system time inaccurate. To resolve this issue, perform the following steps:

Note

To learn about system functions that affect system time precision, see the official Microsoft documentation.

  1. Connect to the ECS instance.

    For instructions, see Log on to a Windows instance by using Workbench.

  2. Download the tool.

  3. Unzip CheckTimeBeginPeriod.zip.

  4. Unzip bin.zip, go to the bin directory, and double-click the appropriate .exe file.

    • For a 64-bit operating system, double-click InjectDllx64.exe.

    • For a 32-bit operating system, double-click InjectDllx86.exe.

    The tool displays the process that is calling the timeBeginPeriod API.

  5. Based on your business requirements, stop or update the application that is calling the timeBeginPeriod API.

If the issue persists, submit a ticket.

Handling IE enhanced security configuration blocks

On an ECS or Simple Application Server instance that runs Windows, Internet Explorer may display an error: "Content from the website listed below is being blocked by the Internet Explorer Enhanced Security Configuration". To resolve this issue, see How to resolve content blocking by Internet Explorer Enhanced Security Configuration on a Windows instance.

User data not running after system disk change

Cause

After a Windows ECS instance starts, a marker file is created in the C:\ProgramData\aliyun\vminit\INSTANCE_{instance ID}\METASERVER directory to mark the instance as initialized. If you create a custom image from this ECS instance, the marker file is included in the image. Consequently, when you use this custom image to re-initialize or replace a system disk, Vminit finds the existing marker file in the C:\ProgramData\aliyun\vminit\INSTANCE_{instance ID}\METASERVER directory. Vminit determines whether an instance is starting for the first time based on the presence of this file. Because this file exists, Vminit assumes it is not a first-time boot and skips running the user data script.

Note

Vminit is automatically installed when you create a Windows instance and handles startup initialization, similar to cloud-init for Linux systems. For more information, see Introduction to Initialization Tools.

Solution

Before creating a custom image from the ECS instance, check for and delete the marker file in the C:\ProgramData\aliyun\vminit\INSTANCE_{instance ID}\METASERVER directory.

Even thread distribution on Windows

No.

The Windows operating system offers no direct setting to evenly distribute a process's threads. Instead, the scheduler manages threads based on the collective behavior of all threads in the system. To control a process's thread distribution, you typically need to use third-party tools or manually set thread affinity in the application code.

Windows thread scheduling and CPU cache hit ratio

Yes. To maximize the CPU cache hit ratio, Windows considers two factors when scheduling threads:

  • Ideal processor: The processor assigned to a thread when it is created. The system typically distributes new threads across available CPUs in a round-robin fashion.

  • Last processor: The processor where the thread last ran.

Thread CPU reassignment scenarios

A thread can be reassigned to a different CPU in three main scheduling scenarios:

  • Time slice rotation: When its allocated time slice expires, a thread is returned to the ready queue of the same CPU. By default, it remains on the original CPU, as its CPU assignment is not recalculated.

  • Preemptive scheduling: When a higher-priority thread preempts a lower-priority thread, the preempted thread is returned to the ready queue of the original CPU. It typically remains on the original CPU, as its assignment is not recalculated.

  • Voluntary wait: When a thread enters a voluntary wait for a resource (such as I/O or a lock), the system recalculates its CPU assignment upon resumption. The scheduler prioritizes assigning the thread to its ideal processor or the one it last ran on.

Getting technical support for Red Hat Enterprise Linux

Instead of contacting Red Hat directly, you can submit a ticket to Alibaba Cloud for technical support. An Alibaba Cloud support engineer will assist you with your issue. If Alibaba Cloud cannot resolve an issue with the Red Hat Enterprise Linux operating system, we will escalate the ticket to Red Hat.

Included Red Hat subscriptions

Red Hat images from Alibaba Cloud include a Red Hat Enterprise Linux (RHEL) subscription. The following software repositories are available:

  • RHEL 7

    • Red Hat Enterprise Linux 7 Server - Extras from RHUI (RPMs)

    • Red Hat Enterprise Linux 7 Server - Optional from RHUI (RPMs)

    • Red Hat Enterprise Linux 7 Server from RHUI (RPMs)

  • RHEL 8 & RHEL 9

    • BaseOS

    • AppStream

    The latest RHEL 8 and RHEL 9 images also include the CodeReady Linux Builder and Supplementary repositories by default. To use these software repositories on your RHEL 8 or RHEL 9 instance, contact Alibaba Cloud support.

    For details about the software repositories and package lists for RHEL 8 and RHEL 9, see the RHEL 8 Package Manifest and RHEL 9 Package Manifest.

Red Hat images from Alibaba Cloud provide packages for RHEL only. To install packages for other Red Hat products, such as Red Hat Satellite or Red Hat Ceph Storage, you must purchase a separate Red Hat subscription, register your host, and subscribe to the required products.

"Unknown" subscription status

This is expected behavior. When you use a Red Hat Enterprise Linux image from Alibaba Cloud, your instance receives updates from Alibaba Cloud's update sources. This differs from the traditional model, where you would use a Red Hat account to get updates directly from Red Hat. Therefore, running the subscription-manager command correctly reports the status as "Unknown":

+-------------------------------------------+
 System Status Details
+-------------------------------------------+
Overall Status: Unknown

System Purpose Status: Unknown

Support for SUSE Linux Enterprise Server (SLES)

Alibaba Cloud provides SUSE Linux Enterprise Server (SLES) public images that are regularly synchronized with SUSE update repositories. Alibaba Cloud Enterprise Support includes operating system support for instances created from SLES public images. If you have purchased Alibaba Cloud Enterprise Support, you can submit a ticket for technical support. Alibaba Cloud engineers will help you resolve issues with the SLES operating system.

SLES for SAP FAQ

SUSE Linux Enterprise Server for SAP Applications (SLES for SAP) is a commercial Linux operating system customized for SAP systems.

Accessing Alibaba Cloud Linux 2 source code

Yes, Alibaba Cloud Linux 2 is open source. You can download source code packages using the yumdownloader tool or from the Alibaba Cloud open source site. The kernel source code tree is also available on GitHub.

Backward compatibility

Alibaba Cloud Linux 2 is fully compatible with Aliyun Linux 17.01.

Note

If you use custom-compiled kernel modules, you may need to recompile them on Alibaba Cloud Linux 2.

Supported third-party applications

Alibaba Cloud Linux 2 is binary compatible with the CentOS 7.6.1810 distribution and provides distinct operating system features.

Compared with CentOS and RHEL, Alibaba Cloud Linux 2 offers the following advantages:

  • A faster release cycle that delivers the latest operating system features, an updated Linux kernel, and newer user-mode software and toolkits.

  • An out-of-the-box experience with minimal configuration for rapid service deployment.

  • Enhanced performance through optimizations tightly integrated with the cloud infrastructure.

  • Commercial support (unlike CentOS) and no runtime billing (unlike RHEL).

Data security

Alibaba Cloud Linux 2 is binary compatible with CentOS 7.6.1810 and RHEL 7.6, and adheres to the RHEL security specification. We ensure data security in the following ways:

  • We regularly perform security scans using industry-standard vulnerability scanning and security testing tools.

  • We regularly evaluate CVE patches for CentOS 7 to address security vulnerabilities.

  • We work with the Alibaba Cloud security team to support existing OS security hardening solutions.

  • We release security advisories and patch updates using the same mechanism as CentOS 7.

Data encryption

Alibaba Cloud Linux 2 retains the data encryption toolkit from CentOS 7 and supports the same KMS-integrated encryption solutions.

Configure permissions for Alibaba Cloud Linux 2

Alibaba Cloud Linux 2 is an operating system that is source-compatible with CentOS 7. Administrators can use the same management commands as in CentOS 7 to configure permissions. The default permission settings are identical to those of the official Alibaba Cloud CentOS 7 image.

Alibaba Cloud Linux pricing

There is no additional cost for the Alibaba Cloud Linux image. You pay only for the ECS instances and other resources you use.

Supported ECS instance types

Alibaba Cloud Linux supports most Alibaba Cloud ECS instance types, including ECS Bare Metal Instances.

Note

Alibaba Cloud Linux does not support instances that run on the Xen virtualization platform.

32-bit support

No, it does not support 32-bit applications and libraries.

GUI support

Alibaba Cloud Linux does not officially support a graphical user interface (GUI). However, you can install one by following the official CentOS documentation. For more information, see Install a graphical user interface on a Linux instance.

Appendix: wget command errors

"Command not found" error

Symptom

When you run the wget command on a Linux instance, a "command not found" error is reported. When you then run the yum install wget command, a message indicates that the package is "already installed and latest version".

Cause

The wget command file is not found in the /usr/bin directory, but a file named wge exists. This indicates that the command file may have been renamed.

Solution

Follow these steps to resolve the issue.

  1. Connect to your Linux instance.

    For more information, see Connect to a Linux instance by using a password or key.

  2. Run the following command to find the path of the wge command:

    whereis wge

    The following output indicates that the path of the wge command is /usr/bin/wge.

    wge: /usr/bin/wge
  3. Run the following command to restore the correct filename:

    cp /usr/bin/wge /usr/bin/wget
  4. Run the wget command again to confirm the issue is resolved.

"Permission denied" error

Symptom

When you run the wget command on a Linux ECS instance, the following error is reported:

wget bash: /usr/bin/wget: Permission denied
Cause

The permissions for the wget command are set to 000, which denies read, write, and execute permissions.

Solution

Follow these steps to resolve the issue.

  1. Connect to your Linux instance.

    For more information, see Connect to a Linux instance by using a password or key.

  2. Run the following command to check the permissions of the wget command:

    ls -l /usr/bin/wget

    The command returns the following output, which indicates that the permissions for the wget command are 000 (no read, write, or execute permissions).

    -------- 1 root root 366800 Oct 31 2014 /usr/bin/wget
  3. Run the following command to check the attributes of the /usr/bin/wget file:

    lsattr /usr/bin/wget

    The command returns the following result, indicating that the attribute of the /usr/bin/wget directory is i (you cannot create or delete files in the directory).

    ----i--------e- /usr/bin/wget
  4. Run the following command to remove the immutable (i) attribute from the /usr/bin/wget file:

    chattr -i /usr/bin/wget
  5. Run the following command to grant permissions to the /usr/bin/wget directory.

    chmod 755 /usr/bin/wget 
  6. Run the wget command again to confirm the issue is resolved.

AD DS installation error

Symptom

Installing an AD domain controller on a Windows ECS instance fails with the error message: "Installation of Active Directory Domain Services binaries failed".

Cause

The Event Viewer indicates that the Remote Registry service is disabled and cannot start.

Solution

Follow these steps to start the Remote Registry service.

  1. Connect to the Windows instance.

    See Connect to a Windows instance by using a password or key.

  2. Go to Start > Run, enter services.msc, and then click OK.

  3. In the Services window, double-click the Remote Registry service to open the Remote Registry Properties window. Configure the following settings:

    • Set Startup Type to Automatic.

    • Under Service status, click Start. Ensure the Remote Registry service is running.

  4. Click OK to save the settings.

Error: "This computer has dynamically assigned IP addresses"

Symptoms

When you install an AD domain controller on a Windows ECS instance, the message "This computer has dynamically assigned IP addresses" appears.

Cause

At least one physical network adapter on the Windows ECS instance does not have a static IP address.

Solution
  1. Connect to the Windows instance.

    For instructions, see Log on to a Windows instance by using a password or key.

  2. Install the AD domain controller. For instructions, see Build a Windows AD domain on an ECS instance.

  3. When the Static IP Assignment dialog box appears, click Yes.

Note

Because the loopback adapter uses DHCP, you can proceed with the installation without assigning it a static IP address.

AD domain controller installation error 0x0000232B RCODE_NAME_ERROR

Symptoms

When you install an AD domain controller on a Windows ECS instance, the installation fails with the error code "0x0000232B RCODE_NAME_ERROR".

Cause

An incorrect IP address configuration in the DNS server may cause this issue.

Solution

Follow these steps to change the DNS server address on both the internal and external network adapters of the secondary instance to the private IP address of the primary instance.

  1. Connect to the Windows instance.

    For more information, see Connect to a Windows instance by using a password or key.

  2. Go to the Internet Protocol Version 4 (TCP/IPv4) Properties window, change the DNS server address, and then click OK.

    Note

    Set the DNS server address to the private IP address of your primary instance.

    p13294

  3. Verify that you can ping the DNS server's IP address.

Resolve the "The network path was not found" error

Symptoms

When installing an AD domain controller on a Windows ECS instance, you receive the error message "The network path was not found".

Causes

Possible causes include the following:

  • The TCP/IP NetBIOS Helper and Remote Registry services on the AD domain controller and the client are not running.

  • The DNS configuration on the client or the AD domain controller is incorrect.

  • A SID conflict exists between the client and the AD domain controller.

  • A firewall or security software is blocking the connection.

Solutions

Follow these steps to troubleshoot the issue.

  • Change the client SID

    To change the client SID, follow these steps:

    1. Connect to the Windows instance.

      For more information, see Connect to a Windows instance by using a password or key.

    2. Download the PowerShell script to change the client SID.

    3. Open Command Prompt, enter PowerShell, and press Enter to open Windows PowerShell.

      Note

      If your instance runs a 64-bit operating system, do not use 32-bit PowerShell (Windows PowerShell (x86)). Otherwise, an error occurs.

    4. Navigate to the script's directory and run the following command to view the help information:

      .\AutoSysprep.ps1 -help
    5. Run the following command to re-initialize the server's SID:

      .\AutoSysprep.ps1 -ReserveHostname -ReserveNetwork -SkipRearm -PostAction "reboot"

      After the initialization is complete, the instance restarts. Note the following:

      • The IP address assignment method changes from DHCP to a static IP address. Ensure this static IP address matches the original IP address of the ECS instance. Alternatively, switch back to DHCP to automatically use the primary private IP address assigned on the console.

        Note

        Do not change the primary private IP address of the ECS instance on the console. Otherwise, access issues may occur.

      • After the SID is re-initialized, the firewall configuration reverts to the Microsoft default settings, which may block ping requests. To resolve this, you can turn off the firewall for the Guest or Public Network profile or add a rule to allow the required ports.

    6. Open Control Panel and turn off the firewall for the Guest or Public Network profile.

      You can then ping the server.

  • Allow client connections through the firewall or security software

    For instructions, see Windows system firewall policy configuration guide.

Resolve CentOS DNS resolution timeouts

Cause

Due to a change in the DNS resolution mechanism of CentOS 6 and CentOS 7, DNS resolution timeouts may occur on ECS instances that run CentOS 6 or CentOS 7 and were created before February 22, 2017. The issue may also occur on instances created from custom images that were created before that date.

Solution

To resolve this issue, follow these steps:

  1. Download the fix_dns.sh script.

  2. Place the downloaded script in the /tmp directory of your CentOS system.

  3. Run the bash /tmp/fix_dns.sh command to execute the script.

The following sections explain the script's function and logic.

  • Script function

    The script checks if the options line in the /etc/resolv.conf file contains the single-request-reopen configuration. For more information, see the resolv.conf file description.

    CentOS 6 and CentOS 7 use the same network 5-tuple to send both IPv4 and IPv6 DNS requests. In this case, the single-request-reopen option should be enabled. This option forces the resolver to close the socket after the first request and open a new one for the second request. The change takes effect immediately without requiring an instance restart.

  • Script logic

    1. The script checks whether the instance is running CentOS.

      • If the instance is not running CentOS, such as Ubuntu or Debian, the script exits.

      • If the instance is running CentOS, the script continues.

    2. The script checks the options configuration in the /etc/resolv.conf file.

      • If no options line exists:

        The script adds the default Alibaba Cloud options configuration: options timeout:2 attempts:3 rotate single-request-reopen.options timeout

      • If an options line exists:

        • If the single-request-reopen option is missing, the script appends it to the existing options line.

        • If the single-request-reopen option is already present, the script exits without changing the DNS configuration.

Check and fix missing IP addresses

For the cause and solution, see Fix missing IP addresses on CentOS 7 and Windows instances.

Resolve dump file generation failures

Symptoms

After a CentOS 7.9 ARM system crashes, you run the ls /var/crash command, but no vmcore file is generated.

image.png

Cause

The pre-installed version of the makedumpfile software is incompatible with this kernel, which prevents the system from generating a dump file. The kernel of the CentOS 7.9 ARM system includes the CONFIG_ARM64_USER_VA_BITS_52=y feature.

Solution

Important

This solution applies only to systems where you have correctly enabled the kdump service. If you have not enabled the kdump service and follow these steps to fix the issue, you must manually add the crashkernel parameter to the proc/cmdline file.

  1. Run the following command to download the kexec-tools RPM package.

    wget http://mirrors.aliyun.com/centos-vault/7.9.2009/os/Source/SPackages/kexec-tools-2.0.15-51.el7.src.rpm
  2. Run the following command to install the RPM package.

    rpm -ivh kexec-tools-2.0.15-51.el7.src.rpm
  3. Run the following commands to download the patch file.

    cd /root/rpmbuild/SOURCES
    wget https://ecs-image-tools.oss-cn-hangzhou.aliyuncs.com/patch/rhelonly-kexec-tools-2.0.20-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch
  4. Modify the kexec-tools.spec file.

    1. Open the kexec-tools.spec file.

      cd /root/rpmbuild/SPECS/
      vi kexec-tools.spec
    2. Press i to enter insert mode, and then add the following two lines in the appropriate locations.

      Patch999: rhelonly-kexec-tools-2.0.20-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch
      %patch999 -p1

      Insert the lines in the locations shown in the following figures.

      image.png

      image.png

    3. Press Esc to exit insert mode, and then enter :wq to save and exit.

  5. Run the following command to check and install dependencies.

    yum-builddep kexec-tools.spec 
  6. Run the following commands to build the RPM package.

    yum -y install rpm-build
    rpmbuild -ba kexec-tools.spec
  7. Run the following commands to install the modified RPM package.

    cd /root/rpmbuild/RPMS/aarch64
    rpm -ivh kexec-tools-2.0.15-51.el7.aarch64.rpm

After another crash, run the ls -lh /var/crash command. If a vmcore file is now generated, the issue is resolved.

image.png

  • Resolve slow startup of Red Hat images

    On an ECS Bare Metal Instance, an instance running Red Hat 8.1 or 8.2 starts 1 to 2 minutes slower than an instance running Red Hat 7. To resolve this issue, open the /boot/grub2/grubenv file on your Red Hat 8.1 or 8.2 system, change the kernel boot parameter from console=ttyS0 console=ttyS0,115200n8 to console=tty0 console=ttyS0,115200n8, and then restart the server to apply the change.

High system load from Server Guard on Ubuntu

The system load on an ECS instance running certain versions of Ubuntu, such as Ubuntu 18.04, increases after the Server Guard process starts.

For the cause and solution, see High system load after the Server Guard process starts on an ECS instance that runs Ubuntu 18.04.

Why do Ubuntu system services restart automatically?

By default, Ubuntu uses the unattended-upgrade service to automatically update packages. This service periodically checks for and installs updates, which can cause related services to restart. If you do not need automatic updates, you can disable this service.

systemctl stop unattended-upgrade
systemctl disable unattended-upgrade

Patch and compile the FreeBSD kernel

Alibaba Cloud's public FreeBSD images use patched kernels to support booting on generation V or later instance families. You can query the instance families by using the Generation parameter of the DescribeInstanceTypeFamilies operation.

To prevent or resolve boot failures that can occur in the following situations, you can apply a patch to the FreeBSD kernel source code and compile the kernel.

  • ECS instances of generation V or later instance families may fail to boot when created from a third-party FreeBSD image or a related custom image.

  • If you use a public FreeBSD image to create an ECS instance and then update the kernel by using a tool such as freebsd-update, the instance may fail to boot on a generation V or later instance family.

Patching is not required for FreeBSD 13 or later. This topic demonstrates how to patch and compile the FreeBSD kernel, using FreeBSD 12.3 as an example.

  1. Download and decompress the FreeBSD kernel source code.

    wget http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/12.3-RELEASE/src.txz -O /src.txz
    cd /
    tar -zxvf /src.txz
  2. Download the patch package.

    In this example, the 0001-virtio.patch is applied to the virtio driver.

    cd /usr/src/sys/dev/virtio/
    wget https://ecs-image-tools.oss-cn-hangzhou.aliyuncs.com/0001-virtio.patch
    patch -p4 < 0001-virtio.patch
  3. Copy the kernel file, and then build and install the kernel.

    make -j<N> specifies the number of parallel jobs for compilation. You should determine this value based on the configuration of your build environment. For example, in a 1 vCPU environment, we recommend setting -j2. This means the ratio of vCPU cores to the variable N is 1:2.

    cd /usr/src/
    cp ./sys/amd64/conf/GENERIC .
    make -j2 buildworld KERNCONF=GENERIC
    make -j2 buildkernel KERNCONF=GENERIC
    make -j2 installkernel KERNCONF=GENERIC
  4. After the build is complete, delete the source code.

    rm -rf /usr/src/*
    rm -rf /usr/src/.*

FreeBSD system disk not found in KVM

Problem

When logging on to a FreeBSD system in a KVM environment using VNC, the system cannot find the system disk and fails to boot, as shown below.无法进入根分区

Solution

  1. In the VNC console, enter ? to view the ufsid of the root file system (rootfs).ufsid

  2. Enter ufs:/dev/ufsid/5565b5a09045**** to boot the operating system.

  3. Enter the username and password to log on to the system.

  4. Run the following command to view the /etc/fstab configuration:

    cat /etc/fstab

    The /etc/fstab configuration, shown below, uses the UUID mount method. However, FreeBSD does not support this mount method and requires the ufsid method.检查/etc/fstab配置

  5. Change the system's mount method to ufsid.

    1. Run the following command to open the /etc/fstab file:

      vi /etc/fstab
    2. Press i to enter insert mode.

    3. Replace UUID=5565b5a09045**** with /dev/ufsid/5565b5a09045****.

    4. Press Esc, enter :wq, and press Enter to save the changes and exit.

  6. Restart the system to apply the changes:

    reboot 
  • Why can't I connect to a Fedora 33 instance with an ssh-rsa key pair?

    You may be unable to connect over SSH to an ECS instance running the 64-bit Fedora 33 operating system if you use an SSH key pair with the ssh-rsa signature algorithm. To resolve this issue, use one of the following methods:

    • Replace the ssh-rsa SSH key pair with one that uses a different signature algorithm, such as ECDSA.

    • Run the update-crypto-policies --set LEGACY command on the instance to switch the encryption policy from POLICY to LEGACY. This allows you to use an SSH key pair that uses the ssh-rsa signature algorithm.

  • Why do Fedora CoreOS instances show only half the specified CPUs?

    On some instances created from a Fedora CoreOS image, such as those from the g5 general-purpose instance family, the On-line CPU(s) list in the lscpu command output shows only half the number of CPUs for the selected instance type. For example, if you select an instance type with 2 CPU cores, the On-line CPU(s) list shows only one CPU. The following figure shows an example.lscpu

    Note

    The On-line CPU(s) list field shows the IDs of the online CPUs.

    This behavior occurs because the kernel of the Fedora CoreOS image includes the mitigations=auto,nosmt boot parameter by default. This parameter automatically disables simultaneous multi-threading (SMT) on systems with known vulnerabilities, which reduces the number of available CPUs by half. You can view the mitigations=auto,nosmt parameter by running the cat /proc/cmdline command.

    For more information about SMT, see Automatically disable SMT when needed to address vulnerabilities and Policy for disabling SMT.

Appendix: Linux guest OS issues

  • Default virtual memory and swap configuration

    An operating system's memory manager uses a swap partition or a virtual memory file to temporarily move rarely accessed memory data to disk when physical memory is insufficient. This process increases the amount of available memory.

    However, this mechanism can degrade performance if memory usage is already high and I/O performance is poor. ECS cloud disks use a distributed file system as the storage backend and maintain multiple strongly consistent replicas for each data block. This approach ensures data durability but also increases I/O operations threefold, reducing storage and I/O performance.

    To avoid degrading cloud disk I/O performance under memory pressure, virtual memory is not enabled by default on Windows instances, and swap partitions are not configured by default on Linux instances.

  • How do I enable Kdump in a public image?

    The Kdump service is disabled by default in public images. To generate a core file for downtime analysis, enable the Kdump service. This procedure uses a CentOS 7.2 public image as an example. The steps may vary based on your operating system.

    1. Set the directory where the core file is generated.

      1. Run vim /etc/kdump.conf to open the kdump configuration file. For more information about the vim command, see Vim editor.

      2. Set path to the directory where core files are generated. In this example, to generate core files in the /var/crash directory, the path is set as follows.

        path /var/crash
      3. Save and close the /etc/kdump.conf file.

    2. Enable the Kdump service.

      Use the method supported by your operating system.

      • Method 1: Run the following commands to enable the Kdump service.

        systemctl enable kdump.service
        systemctl start kdump.service
      • Method 2: Run the following commands to enable the Kdump service.

        chkconfig kdump on
        service kdump start
      • Method 3: If Cloud Assistant is installed on your server, see How do I resolve instance downtime issues after a migration? to enable the Kdump service.

  • NTP sync failure after IPv6 configuration

    Symptom

    When you run the ntpq -p command on the server to synchronize the time, a timeout error occurs, as shown in the following figure.超时

    Solution

    Note

    This method applies to CentOS 7 and earlier, Ubuntu 20.04 and earlier, Anolis OS (ANCK and RHCK), Alibaba Cloud Linux, and Debian.

    1. Establish a remote connection to the Linux instance.

      For more information, see Log on to a Linux instance by using Workbench.

    2. Run the following command to modify the /etc/ntp.conf configuration file:

      vi /etc/ntp.conf
    3. Press the I key to enter the insert mode.

    4. Add the restrict -6 ::1 line to the file, as shown in the following figure.添加内容

    5. Press the Esc key, enter :wq, and press the Enter key to save the changes and exit.

    6. Run the following command to restart the NTP service:

      systemctl restart ntp 
  • Hot-plug failure on custom image instances

    Symptom

    Hot-plugging a cloud disk refers to mounting or detaching a cloud disk while an instance is in the Running state. Hot-plugging a network interface refers to attaching or detaching an elastic network interface while an instance is in the Running state.

    Alibaba Cloud supports hot-plug for cloud disks and NICs, but this operation requires support from the operating system kernel. If the kernel does not support hot-plug, the following issues can occur:

    • After you attach a cloud disk or bind an ENI, the corresponding device is not visible in the operating system.

    • Detaching a cloud disk or unbinding an ENI fails.

    Solution

    Kernel support requirements for hot-plug differ between standard cloud instances and bare metal instances. Ensure your kernel supports both Peripheral Component Interconnect (PCI) and Advanced Configuration and Power Management Interface (ACPI) hot-plug features. These features are enabled by default on most systems, except for older versions such as CentOS 5. To verify that your kernel supports PCI and ACPI hot-plug, follow these steps:

    1. Establish a remote connection to the Linux instance.

      For more information, see Log on to a Linux instance by using Workbench.

    2. Run the following command to check the current kernel version of the instance:

      uname -r

      The following output indicates that the current kernel version is 3.10.0-1127.19.1.el7.x86_64.

      image.png

    3. Run the following command to view the files in the /boot directory:

      ll /boot

      The following output indicates that config-3.10.0-1127.19.1.el7.x86_64 is the system's kernel configuration file.

      image.png

    4. Run the following command to view the kernel configuration file of the system:

      cat /boot/config-3.10.0-1127.19.1.el7.x86_64
      • If the following configuration items are all set to y, the features are built into the kernel, and the operating system supports hot-plugging.

        CONFIG_HOTPLUG_PCI_PCIE=y
        CONFIG_HOTPLUG_PCI=y
        CONFIG_HOTPLUG_PCI_ACPI=y
      • If a configuration item is set to is not set, the feature was not compiled into the kernel. You must recompile the kernel to enable the feature.

      • If a configuration item is set to m, the feature is compiled as a module. For example, if CONFIG_HOTPLUG_PCI_ACPI is compiled as a module, you must load the corresponding module.

        CONFIG_HOTPLUG_PCI_PCIE=y
        CONFIG_HOTPLUG_PCI=y
        CONFIG_HOTPLUG_PCI_ACPI=m

        For example, in the 2.6 kernel of CentOS 5.x, the module for CONFIG_HOTPLUG_PCI_ACPI is acpiphp.ko. To load the module, run the modprobe acpiphp command. If the module fails to load, you can upgrade to a newer kernel version or stop the instance and perform a cold-plug operation.

        Important

        We recommend that you do not arbitrarily upgrade the kernel or operating system of your ECS instance. If you need to upgrade the kernel, see Prevent a Linux instance from failing to start after a kernel upgrade.

  • Instance shutdown after a kernel panic

    Symptom

    When a kernel panic occurs, the system loads a second kernel (also known as a capture kernel) to perform a memory dump and generate Kdump logs. Due to a compatibility issue with bare metal instance types, disk discovery can fail during the boot of the capture kernel. This failure prevents the collection of Kdump logs, causes the capture kernel to fail, and shuts down the instance. You must then restart the instance from the console.

    For more information about bare metal instance types, see Instance families.

    Cause

    On bare metal instances, using the Kdump service to generate a dump file may fail.

    • This issue occurs on 6th-generation ebm* series bare metal instances running one of the following images:

      • CentOS 8.3 and earlier versions

      • Ubuntu 16 and 18

      • Debian 10

      • Alibaba Cloud Linux 2 with a kernel version that is earlier than 4.19.91-24.al7 (This issue is fixed in 4.19.91-24.al7 and later versions.)

    • This issue occurs on 7th-generation ebm* series bare metal instances running the Debian 10 image.

    Solution

    • CentOS and other images

      We recommend that you change the operating system to a more recent version. For more information, see Change the operating system (replace the system disk).

    • Alibaba Cloud Linux 2 images

      We recommend that you upgrade the kernel to version 4.19.91-24.al7 or later. Follow these steps:

      1. Establish a remote connection to the ECS instance.

        For more information, see Log on to a Linux instance by using Workbench.

      2. Run the following command to check the kernel version:

        uname -r
      3. Run the following command to upgrade the kernel:

        sudo yum update kernel
      4. Run the following command to restart the ECS instance for the new kernel to take effect:

        sudo reboot