In OnApp Cloud platform, we can create custom template (Image) of any running reference VM, which can be used to create VMs with similar configuration.
The Error:
Sometimes, when we create a VM using a user template, it may not boot. If we get into console, the booting process will be stuck at GRUB with error message:
Error 15: File not found
This means that the defined kernel image in the grub.conf couldn’t be found.
Cause:
How does this could be happened? We created an image from a perfectly running VM, but the cloned VM fails to boot. Here comes the OnApp play it role.
The OnApp will overwrite many configuration including /etc/fstab, ifcfg-eth0 etc with new one matching with new VM environment. For the grub.conf, it keeps many versions for different virtualization and overwrite the grub.conf with one of the template matching with the virtualization of the new VM.
grub.conf templates:
/boot/grub/grub.conf.kvm /boot/grub/grub.conf.kvm_virtio /boot/grub/grub.conf.xen
When we update the Kernel over time, the new kernel images will be added to grub.conf and old ones will be removed too. These changes won’t be added to the grub templates automatically.
The reference VM will boot into the new kernel after reboot. But, the VMs created using its template will try to load the old kernel image defined in the grub template.
Fix:
To fix this, simply update the grub templates matching with the current configuration. Each grub template differ in the root device’s path.
An example is given below:
title CentOS (2.6.32-696.18.7.el6.x86_64) root (hd0,0) kernel /boot/vmlinuz-2.6.32-696.18.7.el6.x86_64 ro root=/dev/xvda1 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto console=tty0 initrd /boot/initramfs-2.6.32-696.18.7.el6.x86_64.img
The root device in the above entry is root=/dev/xvda1 which for Xen virtualization technology.
The different root device names are given below:
Virtualization | GRUB template name | Root device name |
---|---|---|
KVM | grub.conf.kvm | root=/dev/sda1 |
KVM (Virt IO) | grub.conf.kvm_virtio | root=/dev/vda1 |
Xen | grub.conf.xen | root=/dev/xvda1 |