packer-builder - 打包机 - Vsphere-iso - Centos 8
问题描述
我正在使用以下 JSON 和 KS.cfg 来构建 centos 8 模板。但面临软盘错误(未在配置中使用)。已尝试更改启动顺序,但没有运气。也没有找到用于 vsphere-iso 构建器的 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.
请协助
解决方案
工作 cdrom 替代使用cd_files
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>',
],
...
推荐阅读
- sql - 蜂巢查询中的 STDDEV 函数
- javascript - 获取 object.function 不是函数
- sql - 如何根据其他表中的其他关系从 1 列中选择 2 条数据
- animation - 如何在 Flutter 中使用 Hero 转换期间未运行的动画/动画?
- ruby-on-rails-4 - 未经许可的参数:上传视频时的视频 [回形针]
- shopify - 从 JS 或产品流页面访问 shopify 中的设置 json 文件
- python - 如果第一个文件不是最后一行,则 Python 从文件开头开始
- node.js - Node.js 微服务应该如何在 Rabbitmq 重启后存活下来?
- javascript - 跨域请求时,getJSON() 函数和 post() 函数有什么区别?
- ms-access - 当该列包含空值时格式化列抛出异常