Error "Failed to perform fix-up operation on migrated Linux VM. Unable to find suitable kernel"
search cancel

Error "Failed to perform fix-up operation on migrated Linux VM. Unable to find suitable kernel"

book

Article ID: 321576

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

During migration of a Linux machine using OSAM (OS Assisted Migration), it may fail to perform fix-up operation on the migrated VM.


Fixup Log:

++++++++++++++++++++
2021-04-20 08:50:26,266 INFO _fixup_with_report():52 ***** BEGIN: kernel fixup *****
2021-04-20 08:50:26,272 ERROR __validate_existing_kernel():293 UbuntuFixup(ubuntu): unable to find bootloader config
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/vmware/cmd/vmware_hcx_fixup/fixup/ubuntu.py", line 280, in __validate_existing_kernel
    grub_defaults_path, grubenv_path)
  File "/usr/lib/python3.6/site-packages/vmware/unixconf/grubconfig.py", line 581, in __init__
    self.__read_file()
  File "/usr/lib/python3.6/site-packages/vmware/unixconf/grubconfig.py", line 758, in __read_file
    with open(self.__path) as input_file:
FileNotFoundError: [Errno 2] No such file or directory: '/target-root/boot/grub/grub.cfg'
2021-04-20 08:50:26,292 INFO run():148 Executing: ['umount', '-R', '/target-root/run']
2021-04-20 08:50:26,311 INFO __remove_bind_mounts():74 Removed bind-mount at /target-root/run
2021-04-20 08:50:26,314 INFO run():148 Executing: ['umount', '-R', '/target-root/sys']
2021-04-20 08:50:26,335 INFO __remove_bind_mounts():74 Removed bind-mount at /target-root/sys
2021-04-20 08:50:26,338 INFO run():148 Executing: ['umount', '-R', '/target-root/proc']
2021-04-20 08:50:26,359 INFO __remove_bind_mounts():74 Removed bind-mount at /target-root/proc
2021-04-20 08:50:26,362 INFO run():148 Executing: ['umount', '-R', '/target-root/dev']
2021-04-20 08:50:26,383 INFO __remove_bind_mounts():74 Removed bind-mount at /target-root/dev
2021-04-20 08:50:26,386 ERROR main():339 /opt/vmware/hcx/osam/bin/vmware_hcx_fixup: exception occurred

  File "/usr/lib/python3.6/site-packages/vmware/cmd/vmware_hcx_fixup/fixup/ubuntu.py", line 383, in fix_kernel
    bootkern = self.__select_kernel(fixupenv)
  File "/usr/lib/python3.6/site-packages/vmware/cmd/vmware_hcx_fixup/fixup/ubuntu.py", line 328, in __select_kernel
    raise FixupError("Unable to find suitable kernel")
vmware.cmd.vmware_hcx_fixup.common.FixupError: Unable to find suitable kernel

++++++++++++++++++++


The fix-up failed because the fix-up code could not find /boot/grub/grub.cfg.



Environment

VMware HCX

Resolution

Grub is the standard boot loader on most of the Linux systems. When a system boots up, the boot loader is responsible for loading the kernel onto the memory and transferring the control. The boot loader (Grub) will refer to the config file (grub.cfg) to see which kernel image to load. If the grub.cfg is missing, then the boot loader will not know which kernel image to load and the system will get stuck in the grub> prompt. Whenever a new kernel is installed, this config file gets re-created and on the next reboot it will load the proper kernel.
The location of Grub boot loader config file is /boot/grub/grub.cfg.
We can get following from the source linux system to verify:
  • Does the source system has GRUB/GRUB2 loader.
  • Output of ‘mount’ command
  • Contents of ‘/boot/grub’ folder and see if grub.cfg/grub.confg is present.
  • We can run ‘find / -name grub.cfg’.
For OSAM migration, we do not support legacy grub configuration on Ubuntu systems.
grub.conf>>>>> legacy Grub
grub.cfg>>>>>> Grub2


Regular Ubuntu installations do come with Grub2 boot loader. Infact it is hard to install legacy grub since it is very old and one will have to deviate from the usual install process.
Having a legacy grub config can be considered as an unsupported configuration for OSAM migration.

The recommendation is to install Grub2 for all Ubuntu system before performing OS assisted migration.

There are couple of documentations on Grub boot loader:

https://en.wikipedia.org/wiki/GNU_GRUB
https://www.gnu.org/software/grub/manual/grub/grub.html
https://help.ubuntu.com/community/Grub2