We moved this page to our Documentation Portal. You can find the latest updates here. |
Issue
After creating a CentOS 7 VM, running "yum update" and rebooting causes the VM to fail to boot. The log shows:
"Fatal: VM was not running 1 minute after being started"
Environment
All OnApp Versions
CentOS 7 VMs built from OnApp template (possibly any VM upgraded / installed to CentOS 7)
Resolution
In /boot/grub/grub.conf, there is a missing line for the default kernel. The first entry should look similar to the older entry, the missing line is something like initrd /boot/initramfs-<kernel release>.img
Example lines from /etc/grub.conf:
title CentOS Linux (3.10.0-229.1.2.el7.x86_64) 7 (Core) root (hd0,0) kernel /boot/vmlinuz-3.10.0-229.1.2.el7.x86_64 root=/dev/xvda1 console=tty0 ro vconsole.keymap=us vconsole.font=latarcyrheb-sun16 LANG=en_US.UTF-8 initrd /boot/initramfs-3.10.0-229.1.2.el7.x86_64.img
The simplest way to fix this is from the recovery mode. Mount the failed VM disk and edit file using vi or other text editor.
Additional Info
CentOS 7 template has a custom kernel from OnApp that has missing features to make the VNC console work. The default updated kernel installed with yum update is not guaranteed to work with the console and would leave the VNC console blank / black.
Comments
5 comments
Anyway we can get an updated kernel with VNC support?
Nvm seems to work fine in 3.10.0-229.7.2
This is how we "solved" the issue with grub1 on centos7. It triggers grubby after yum kernel update to add entries to grub.conf for you with the initrd line. It's not pretty but it works.
yum install yum-plugin-post-transaction-actions -y
cat > /etc/yum/post-actions/kernel.action <<EOL
kernel*:remove:grubby --grub -o /boot/grub/grub.conf --remove-kernel=/boot/vmlinuz-\$ver-\$rel.\$arch kernel*:install:grubby --grub -o /boot/grub/grub.conf --add-kernel /boot/vmlinuz-\$ver-\$rel.\$arch --title "CentOS 7 (\$ver-\$rel.\$arch)" --initrd=/boot/initramfs-\$ver-\$rel.\$arch.img --copy-default --make-default
EOL
I'm hoping onapp will let you just choose whether you want to stick to grub v1 or not.. It's only for backwards compability for xen HV on centos5 AFAIK?
I don't know when this was fixed, but I just upgraded my CentOS 7.1 template from 1.5 -> 1.6 and saw that this apparently is resolved. Of note, doing a yum update, which put in a new kernel, did add the lines to grub.conf, but did not set the new kernel as the default kernel.
Did a fresh template install of 7.1x1.6, ran a yum update, modified grub to boot the new kernel (#0), rebooted, came up, and checked grub.conf:
title CentOS Linux (3.10.0-327.3.1.el7.centos.plus.x86_64) 7 (Core)
root (hd0,0)
kernel /boot/vmlinuz-3.10.0-327.3.1.el7.centos.plus.x86_64 root=/dev/vda1 console=tty0 ro vconsole.keymap=us vconsole.font=latarcyrheb-sun16 LANG=en_US.UTF-8 net.ifnames=0 biosdevname=0 nomodeset
initrd /boot/initramfs-3.10.0-327.3.1.el7.centos.plus.x86_64.img
title CentOS Linux (3.10.0-229.20.1.el7.centos.plus.x86_64) 7 (Core)
root (hd0,0)
kernel /boot/vmlinuz-3.10.0-229.20.1.el7.centos.plus.x86_64 root=/dev/vda1 console=tty0 ro vconsole.keymap=us vconsole.font=latarcyrheb-sun16 LANG=en_US.UTF-8 net.ifnames=0 biosdevname=0 nomodeset
initrd /boot/initramfs-3.10.0-229.20.1.el7.centos.plus.x86_64.img
FYI for folks out there!
Please sign in to leave a comment.