Pass kernel commandline parameter when not using direct kernel boot

Is there any way to pass a kernel cmd parameter when booting a vm made from a template image?
From what I understand kernel_cmd only works for when you select a kernel from the files datastore and is not handled by the contextualisation framework.
Does the official linux contextualisation support passing in kernel params through some other option or is this feature nonexistent.
I figured there has to be some sort of mechanism for this since the provisioner might might to force some options for the vm without giving the user the ability to turn it off. (eg. mounting rootfs with certain flags)


when kernel is selected and executed by the boot loader in the VM, there is currently no way to pass custom kernel arguments from the OpenNebula into the OS instance.


1 Like

Ah, that’s a shame. Is this a feature that can easily be added to the contextualization package to pass the kernel params to libvirt/qemu? Or is that a route not worth exploring?

Context packages would have to reconfigure the boot loader inside the running VM to pass extra parameters to the kernel and trigger a reboot. So machine would have to pass through two boot sequences. The only real problem is to reconfigure various boot loaders correctly (e.g., GRUB in /etc/default/grub and trigger update-grub2 on Debian or grub2-mkconfig on RedHats or sed /boot/loader/entries/..., syslinux on Alpine, …). It’s not impossible, but since it requires booting into a VM first, it doesn’t cover the problem when kernel arguments need to be adapted right from the start…

You can always make a feature request in Issues · OpenNebula/addon-context-linux · GitHub, or even contribute the change on your own :wink: .