Skip to content

Can't boot UEFI VM after migration - grub configuration problem#160

Open
sparimi-rh wants to merge 1 commit into
libguestfs:masterfrom
sparimi-rh:rhel173538
Open

Can't boot UEFI VM after migration - grub configuration problem#160
sparimi-rh wants to merge 1 commit into
libguestfs:masterfrom
sparimi-rh:rhel173538

Conversation

@sparimi-rh

Copy link
Copy Markdown

UEFI boot mode based Linux VM, which reference /boot and /boot/efi partitions by device files (e.g. /dev/sdaX) in /etc/fstab, fail to boot post migration as virt-v2v re-writes the grub boot loader if it finds references to device files instead of disk UUIDs. The libguestfs appliance is configured to use BIOS boot mode. This causes the target VM's grub to be configured in BIOS boot mode. The target VM fails to boot in Qemu/KVM environment. The solution is to replace the BIOS boot mode specific grub commands which loads Linux kernel and init RAM disk, with UEFI boot mode specific commands. This is done only if source VM is in UEFI mode.

Fixes: https://redhat.atlassian.net/browse/RHEL-173538

UEFI boot mode based Linux VM, which reference /boot and /boot/efi
partitions by device files (e.g. /dev/sdaX) in /etc/fstab, fail to
boot post migration as virt-v2v re-writes the grub boot loader if
it finds references to device files instead of disk UUIDs. The
libguestfs appliance is configured to use BIOS boot mode. This
causes the target VM's grub to be configured in BIOS boot mode.
The target VM fails to boot in Qemu/KVM environment. The solution
is to replace the BIOS boot mode specific grub commands which loads
Linux kernel and init RAM disk, with UEFI  boot mode specific
commands. This is done only if source VM is in UEFI mode.

Fixes: https://redhat.atlassian.net/browse/RHEL-173538

Signed-off-by: Srihari Parimi <sparimi@redhat.com>
Comment thread convert/convert_linux.ml
if g#exists grub_cfg then (
try
ignore (g#sh (sprintf "sed -i 's/\\blinux16\\b/linuxefi/g;
s/\\binitrd16\\b/initrdefi/g' %s"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wouldn't normally want to run commands out of the guest like this. Augeas lets us programatically edit files in the guest which is considerably safer.

A bigger question that isn't answered is why do we need to change these linux16 commands? What is that doing exactly?

Also the commit message doesn't really explain anything, at least not in terms that I can understand. An example would go a long way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants