使用Packer 在 VMware vSphere 上构建 Redhat/CentOS 虚拟机
dalaowang2016:
大佬,packer build的时候 获取不到ks.cfg
{
"builders": [
{
"accelerator": "kvm",
"boot_command": [
" text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg"
],
"boot_wait": "10s",
"disk_size": "20480M",
"format": "qcow2",
"headless": true,
"http_directory": "/var/ks.cfg",
"iso_checksum": "sha256:907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
"iso_url": "file:///var/CentOS-7-x86_64-DVD-1511.iso",
"memory": "2048",
"output_directory": "/var/output/0611",
"shutdown_command": "poweroff",
"ssh_handshake_attempts": 100,
"ssh_password": "000000",
"ssh_port": 22,
"ssh_timeout": "10m",
"ssh_username": "root",
"type": "qemu",
"vnc_bind_address": "0.0.0.0",
"vnc_port_max": 5900,
"vnc_port_min": 5900
}
],
"provisioners": [
{
"inline": [
"systemctl restart network"
],
"type": "shell"
}
]
}
|