When you import a RedHat VM, say from VMWare, to a KVM environment like OpenStack it probably won't boot and instead goes straight to the dracut prompt.
This happens because the ramdisk doesn't have virtio drivers. You need to inject them. Import the volume and attach it to a running Linux server.
Personally I use Ubuntu, but it doesn't matter since you'll chroot
in.
mkdir /mnt/boot /mnt/root
mount <boot device> /mnt/boot
mount <root device> /mnt/root
for x in sys proc run dev tmp; do mount --bind /$x /mnt/root/$x; done
/etc/grub/grub.conf
to see which initrd file is being used. Something like 3.10.0-1062.1.2.el7.x86_64
.# chroot in
cd /mnt
chroot root bash
# set the version
cat /etc/grub/grub.cnf
version=
# example: version=3.10.0-1062.1.2.el7.x86_64
# check for virtio drivers
lsinitrd /boot/initramfs-$version.img | grep virtio
# if not found, add them
cd /boot
dracut -f \
/boot/initramfs-$version.img \
$version \
--add-drivers "virtio virtio_pci virtio_blk virtio_net"
# prove it worked
lsinitrd /boot/initramfs-$version.img | grep virtio
# leave the chroot
exit
This is a good time to do any other modifications you like, such as installing cloud-init or enabling DHCP.
Remove the mounts
for x in sys proc run dev tmp; do umount /mnt/root/$x; done
umount /mnt/root
umount /mnt/boot
Now you should be able to boot your RedHat VM without dracut coming up.