为 Openstack Ironic Boot Failure 生成 CentOS 镜像

Generating CentOS image for Openstack Ironic Boot Failure

我正在尝试创建一个自定义 CentOS 映像以用作 Openstack Ironic 的映像。我在这里遵循指南:https://docs.openstack.org/image-guide/centos-image.html。我创建了镜像,并将其部署在我的裸机服务器上。具有讽刺意味的是,它似乎已成功 'dd' 将图像导入服务器。但是当服务器启动时,它找不到任何错误为 /dev/disk/by-uuid/XXXX does not exist 的分区。我可以将它启动到救援模式,但我不知道如何调试它。

我也使用相同的程序来部署自定义 Ubuntu 图像,它似乎工作得很好。有人有解决这个问题的建议吗?

好了,折腾了好久,终于找到问题所在了。这更像是 CentOS7 的问题,而不是 openstack 的问题。

我发现生成 CentOS 云构建的 kickstart 脚本 (https://github.com/CentOS/sig-cloud-instance-build/blob/master/cloudimg/CentOS-7-x86_64-GenericCloud-201606-r1.ks). Turns out that they included the dracut-config-generic package which my custom CentOS image did not include. After some google searching work, I found this link (https://www.systutorials.com/docs/linux/man/8-dracut/) 指出:

On RHEL-7 the hostonly mode is the default mode. Generic "non-hostonly" images are created, if the dracut-config-generic rpm is installed. The rescue kernel entry in the bootloader menu is also a generic image.

没有dracut-config-generic,图像只能在我设置的虚拟化环境中运行。所以添加这个包后,我就可以通过openstack ironic成功部署了。

希望这对尝试此操作的任何人有所帮助。