Issue
Custom CloudLinux template will not boot.
In the VM's logs, under a failed StartupVirtualServer, it should read similar to this:
Running: xm create /onapp/config/vmidentifier Using config file "/onapp/config/vmidentifier". Error: Boot loader didn't return any data! Fatal: Virtual machine has not been started on hypervisor Executing Rollback...
The virtual machine will not start because of this.
Environment
CloudLinux virtual machines
Resolution
You will need to check the grub.conf, generally it should be changing the grub.conf, but sometimes it may fail to make the correct changes or to change at all. The grub.conf file will not have a valid kernel for it to boot, so it will be unable to. You can diagnose this by checking the files on the VM through recovery mode, and update the grub.conf accordingly.
Generally, the virtual machine's primary drive will be /dev/xvdb1 in the recovery boot:
[root@recovery ~]# mkdir /mnt/xvdb1 && mount /dev/xvdb1 /mnt/xvdb1 && cd /mnt/xvdb1
[root@recovery xvdb1]# cat /mnt/xvdb1/etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title CloudLinux Server (2.6.32-379.19.1.lve1.2.7.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-379.19.1.lve1.2.7.el6.x86_64 ro root=/dev/xvda1 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb nohz=off console=tty0
initrd /boot/initramfs-2.6.32-379.19.1.lve1.2.7.el6.x86_64.img
Now we have the original grub.conf information, so we need to check it across the VM's kernels in /boot:
[root@recovery xvdb1]# ls -lah /mnt/xvdb1/boot/vmlinuz* /mnt/xvdb1/boot/initramfs*
-rw-r--r-- 1 root root 14M Nov 10 2013 /mnt/xvdb1/boot/initramfs-2.6.32-458.18.1.lve1.2.39.el6.x86_64.img
-rw------- 1 root root 14M Dec 22 14:47 /mnt/xvdb1/boot/initramfs-2.6.32-458.23.2.lve1.2.45.el6.x86_64.img
-rw------- 1 root root 14M Jan 14 11:14 /mnt/xvdb1/boot/initramfs-2.6.32-458.23.2.lve1.2.48.el6.x86_64.img
-rwxr-xr-x 1 root root 4.0M Sep 16 2013 /mnt/xvdb1/boot/vmlinuz-2.6.32-458.18.1.lve1.2.39.el6.x86_64
-rwxr-xr-x 1 root root 4.0M Nov 22 13:18 /mnt/xvdb1/boot/vmlinuz-2.6.32-458.23.2.lve1.2.45.el6.x86_64
-rwxr-xr-x 1 root root 4.0M Jan 3 16:39 /mnt/xvdb1/boot/vmlinuz-2.6.32-458.23.2.lve1.2.48.el6.x86_64
Now we see that the same images are not there. We will need to backup the grub.conf and change the image name to a kernel that exists.
Now, as we know which kernels exist, we can backup the grub.conf and edit it. The differences between the two is illustrated below:
[root@recovery etc]# cp grub.conf grub.backup-05-15-14.conf
[root@recovery etc]# vi grub.conf
--changed to images that are in the boot folder--
[root@recovery etc]# diff grub.conf grub.backup-05-15-14.conf
14c14
< title CloudLinux Server (2.6.32-458.23.2.lve1.2.48.el6.x86_64)
---
> title CloudLinux Server (2.6.32-379.19.1.lve1.2.7.el6.x86_64)
16,17c16,17
< kernel /boot/vmlinuz-2.6.32-458.23.2.lve1.2.48.el6.x86_64 ro root=/dev/xvda1 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb nohz=off console=tty0
< initrd /boot/initramfs-2.6.32-458.23.2.lve1.2.48.el6.x86_64.img
---
> kernel /boot/vmlinuz-2.6.32-379.19.1.lve1.2.7.el6.x86_64 ro root=/dev/xvda1 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb nohz=off console=tty0
> initrd /boot/initramfs-2.6.32-379.19.1.lve1.2.7.el6.x86_64.img
Once that is changed, we can safely unmount the drive with:
[root@recovery ~]# umount /mnt/xvdb1 && rmdir /mnt/xvdb1
Then, we can go back into the control panel's UI and reboot the virtual machine as normal. This time the grub configuration should boot to the kernel you specified.
style="padding-left: 30px;"