微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

封隔器-Vsphere-iso-Centos 8

如何解决封隔器-Vsphere-iso-Centos 8

使用以下JSON和KS.cfg构建centos 8模板。但是面临软盘错误(未在配置中使用)。尝试更改启动顺序,但没有运气。也没有找到针对vsphere-iso builder的centos 8 Json的示例。有人可以帮我吗?

CentOS 8 JSON

{
  "variables": {
   "vsphere_uid": "Null","vsphere_passwd": "Null","vm_superuser_passwd" : "Null","vsphere_vm_name": "Null","bastion_host": "","bastion_user": "","bastion_password":"Null","datacenter": "","cluster": "","datastore": "","network": "","iso_paths": ""
   },"builders": [
    {
      "type": "vsphere-iso","vcenter_server":      "{{user `vsphere_server` }}","username":            "{{user `vsphere_uid` }}","password":            "{{user `vsphere_passwd` }}","insecure_connection": "true","datacenter": "{{user `datacenter` }}","cluster": "{{user `cluster` }}","datastore": "{{user `datastore` }}","network": "{{user `network` }}","vm_name": "{{user `vsphere_vm_name` }}","guest_os_type": "centos7_64Guest","ssh_username": "admin","ssh_password": "{{user `vm_superuser_passwd` }}","ssh_bastion_host": "{{user `bastion_host` }}","ssh_bastion_username": "{{user `bastion_user` }}","ssh_bastion_agent_auth": true,"cpus":             2,"RAM":              5120,"RAM_reserve_all": false,"convert_to_template": true,"disk_controller_type":  "pvscsi","disk_size":        102400,"disk_thin_provisioned": true,"network_card": "vmxnet3","http_directory" :  "httpks","iso_paths": [
        "[nfs] centos/CentOS-8.2.2004-x86_64-minimal.iso"
      ],"iso_checksum": "e15fb0e51726de0a4128448b9bd63e7b","iso_checksum_type": "md5","boot_command": "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg <enter><wait>"
          }
  ]

}

错误是:

dracut-pre-udev{585}: modprobe: FATAL: Module floppy not found in directory /lib/modules/4.18.0-193.2l8.x86_64

— 
2020/09/17 05:17:40 ui: ask: ==> vsphere-iso: Pausing after run of step 'StepConfigParams'. Press enter to continue. 
2020/09/17 05:17:40 packer-builder-vsphere-iso.linux: 
2020/09/17 05:17:40 No floppy files specified. Floppy disk will not be made. 
2020/09/17 05:17:40 ui: ask: ==> vsphere-iso: Pausing after run of step 'StepCreateFloppy'. Press enter to continue. 
2020/09/17 05:17:40 ui: ask: ==> vsphere-iso: Pausing after run of step 'StepAddFloppy'. Press enter to continue.
 — Dracut-initqueue: warning : Could not boot Entering Emergency mode. 


请协助

解决方法

您现在已经发现了,但是对于事后搜索的人

操作系统卷不再包含软盘设备驱动程序,因此您将需要对KS配置使用其他来源。 inst.ks使用与inst.repo相同的格式,大多数人将使用HTTP源。

,

使用 cd_files 的工作 cdrom 替代方案

https://www.packer.io/docs/builders/vmware/vsphere-iso#cd_files

packer 1.6.6

相关片段

...
"type": "vsphere-iso","guest_os_type": "centos8_64Guest","cd_files": [
    "{{template_dir}}/ks.cfg",],"boot_command": [
    '<up>'
    'e','<down><down><end><wait>',' text ks=cdrom:/dev/sr1:/ks.cfg'
    '<leftCtrlOn>x<leftCtrlOff>',...
,

我在使用 HTTP 目录的错误 IP 构建 vsphere-iso 打包程序时遇到了类似的问题,尤其是当我使用公司的 VPN 与硬连线时。因此,它一直停留在“等待 IP”并收到相同的 dracut-init 错误。对我来说,问题是packer 用于确定用于包含我的kickstarter 文件的HTTP 目录的接口的优先级顺序。

我们是如何解决这个问题的,因为我们实际上有一个调用 packer 的 shell 包装器。在该脚本中,我们向用户询问应该访问 HTTP 目录的 IP。我使用 ifconfig 并查看列表中的 10. IP。 shell 脚本将该环境变量传递给我的打包程序的 build.json 这不是最干净的解决方案,但我已经使用这个修复程序几个月了。如果您仍有问题,请告诉我,我可以发布一些代码。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。