All Products
Document Center

How to avoid Linux instance startup failure after kernel upgrade

Last Updated: Jan 31, 2018

If a Linux instance running CentOS, OpenSUSE, SLES (SUSE Linux Enterprise Server), or Aliyun Linux fails to start after the upgrade, the reason may be that the virtio-blk and xen-blkfront drivers are missing from the initrd file for the upgraded kernel. This does not happen to Debian or Ubuntu, because their virtio-blk and xen-blkfront drivers are built into the kernel.

Note: We do not recommend upgrading the kernel on your own. For more information, see ECS operation instructions.

What is an initrd file?

In computing, initrd (initial ramdisk) is a scheme to load a temporary root file system into memory, which may be used as part of the Linux instance startup process. initramf is alternatively used for the same. Although they are two different schemes, both are commonly used to prepare the base before the real root file system is mounted.

Which system images support direct kernel upgrade?

Alibaba Cloud has optimized the public system image kernels with a timestamp starting from 20161115 in the image named image_no. For the initrd files of these images, the unavailability of the virtio-blk and blkfront drivers does not cause startup failure. See the following:

  • centos_6u8_64_40G_cloudinit_20161115.vhd
  • centos_6u8_32_40G_cloudinit_20161115.vhd
  • centos_5u11_64_40G_cloudinit_20161115.vhd
  • centos_5u11_32_40G_cloudinit_20161115.vhd
  • centos_6_8_64_40G_base_20170222.vhd
  • centos_6_8_32_40G_base_20170222.vhd
  • centos_7_2_64_40G_base_20170222.vhd
  • centos_5_11_64_40G_base_20170222.vhd
  • centos_5_11_32_40G_base_20170222.vhd
  • centos_6_08_64_20G_alibase_20170824.vhd
  • debian_8_09_64_20G_alibase_20170824.vhd

How do I optimize the kernel and avoid startup failure?

Follow these steps:

  1. Edit the system configuration file. If the following are missing from the configuration file, add them manually.

    • For CentOS 6 and CentOS 7: Run vi /etc/dracut.conf.d/virt-drivers.conf and add add_drivers+=" xen-blkfront virtio_blk ".

    • For CentOS 5: Run vi /etc/dracut.conf.d/virt-drivers.conf and add add_drivers+=" xen-vbd virtio_blk virtio_console ".

    • For OpenSUSE/SUSE:

      1. Run vi /etc/sysconfig/kernel and add INITRD_MODULES=" virtio_blk virtio_pci xen-vbd".
      2. Run vi /etc/dracut.conf and add add_drivers+="virtio_blk virtio_pci xen-vbd".
  2. Upgrade the kernel:

    • For CentOS: Run yum install kernel.

    • For OpenSUSE/SUSE: Run zypper install kernel-default.

  3. Run the command lsinitrd /boot/initramfs-$(new-kernel-ver).img | grep -E 'virtio|xen' to check if the virtio-blk and xen-blkfront drivers are available in the initrd/initramfs file.

  4. Do not restart the instance until you are sure that the virtio-blk and xen-blkfront drivers are available in the initrd file.

If the problem persists, open a ticket to Alibaba Cloud.