I want to prevent CentOS 7 grub problems in issue below. VM fails to boot due to grub issue seen in this KB. Below is a recipe to fix the issue.
All OnApp versions
CentOS7 VM, "yum update" has been run on this VM, but the VM has NOT been rebooted yet.
To fix this issue we will use a recipe. This recipe will edit the grub.conf to contain correct info, and allow the VM to boot. This recipe was submitted by Anders Aarvik.
LATESTRAMFS=$(find /boot/ -type f -name "initramfs*" | xargs ls -atr | tail -n1)
LATESTKERNEL=$(find /boot/ -type f -name "vmlinuz*" | xargs ls -atr | tail -n1)
sed -i "/\/boot\/$LATESTKERNEL/a \\\tinitrd $LATESTRAMFS" /boot/grub/grub.conf
You can add this to a recipe by following steps in the docs. Please note you will need to locate docs pertaining to your OnApp versions, here are 4.0 docs.
Entry for recipe is as seen below. After adding the recipe, you may find it in the recipes menu, click the drop down options menu on the right, and choose "Run recipe on VS(s)". After it has finished, the VM should boot normally.
Please note that recipes can only be ran on online VMs, so if your VM was already rebooted and won't come back online, please use KB at the top to fix. This recipe is to apply directly after a "yum update"/