Converter fails at 99% on RHEL 9
search cancel

Converter fails at 99% on RHEL 9

book

Article ID: 452834

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Using Standalone Converter when converting RHEL 9 servers to vms fails at 99% and the OS does not load.

Resolution

The issue can be resolved by creating a custom ISO and replacing the converter-helper-vm.iso as follows.

  1. Preparation
    Copy converter-helper-vm.iso from the environment where the Converter is installed and mount it on a Linux environment of your choice.

          Default Path:
          C:\Program Files (x86)\VMware\VMware vCenter Converter Standalone

       Ensure the following commands are available in your Linux working environment:

  • cpio
  • mkisofs or genisoimage
  1. Mount Original ISO and Prepare Working Environment

        Create mount point and mount (Adjust device name as necessary)

              sudo mkdir -p /mnt/cdrom
              sudo mount -o ro /dev/cdrom /mnt/cdrom

        Create working directory

              mkdir -p ~/custom_iso/rootfs
              cd ~/custom_iso

        Copy all files while preserving attributes

              sudo cp -rp /mnt/cdrom/* ./  
              sudo chmod -R u+w .

  1. Extract Image

              cd ~/custom_iso/rootfs
              sudo gunzip -dc ../isolinux/initrd.img | sudo cpio -idmv

  1. Modify Script Arguments

         We need to modify the arguments so that grub2-mkconfig -o /boot/grub2/grub.cfg --update-bls-cmdline is processed correctly.

        Locate the script

              TARGET_SH=$(sudo find . -name chrootAndExec.sh)

        Create a patch to insert the logic

              cat << 'EOF' | sudo tee patch.txt > /dev/null
              if [ "$2" = "grub2-mkconfig" ] || [ "$2" = "grub-mkconfig" ]; then
              BOOT_DEV=$(findmnt -n -o SOURCE "$1/boot")
              [ -n "$BOOT_DEV" ] && sed -i "s/--set=dev [^ ]*/--set=dev $(blkid -s UUID -o value "$BOOT_DEV")/" "$1/boot/efi/EFI/redhat/grub.cfg"
              set -- "$1" "grub2-mkconfig" "-o" "/boot/grub2/grub.cfg" "--update-bls-cmdline"
              fi
              EOF

        Insert the patch immediately after the first line (#!/bin/sh) of chrootAndExec.sh

              sudo sed -i '1r patch.txt' $TARGET_SH

  1. Recompress the Image

        Remove the old image

              sudo rm ../isolinux/initrd.img

        Create a new initrd.img including the modified script

              sudo find . | sudo cpio -o -H newc --owner root:root | sudo xz -9 --check=crc32 > ../isolinux/initrd.img

  1. Cleanup and Build ISO

        Return to the ISO build directory

              cd ~/custom_iso

        Remove extracted raw data

              sudo rm -rf rootfs

        Create the Custom ISO

              sudo mkisofs -o ../converter-helper-vm-custom.iso
              -b isolinux/isolinux.bin -c isolinux/boot.cat
              -no-emul-boot -boot-load-size 4 -boot-info-table
              -eltorito-alt-boot -e boot/grub2/efiboot.img -no-emul-boot
              -R -J -v -V "CONVERTER_HELPER" ./

                     (Note: The same parameters can be used if you are using the genisoimage command.)

  1. Relocate ISO and Execute Conversion

              6-1. Place the newly created converter-helper-vm-custom.iso into the original ISO directory on the Windows machine.
              6-2. Rename the original converter-helper-vm.iso to a different name (e.g., .bak) for backup.
              6-3. Rename your custom ISO to converter-helper-vm.iso.
              6-4. Run the VM conversion again and verify that the issue is resolved.