2023/06/14 11:20:43 packer-1.8.6 plugin: [DEBUG] SSH handshake err: Timeout during SSH handshake
2023/06/14 11:20:50 packer-1.8.6 plugin: [INFO] Attempting SSH connection to 127.0.0.1:2226…
2023/06/14 11:20:50 packer-1.8.6 plugin: [DEBUG] reconnecting to TCP connection for SSH
2023/06/14 11:20:50 packer-1.8.6 plugin: [DEBUG] handshaking with SSH
Base_OS.json
{
“variables”: {
“DVD1”: “/proj/19089-CXP.iso”,
“imagename”: “base_os.qcow2”
},
“builders”:
[
{
“type”: “qemu”,
“accelerator”: “kvm”,
“headless”: true,
“qemuargs”: [
[ “-m”, “8048M” ],
[ “-smp”, “cpus=12,maxcpus=16,cores=8” ]
],
“disk_size”: 30480,
“format”: “qcow2”,
“net_device”: “virtio-net”,
"iso_url": "{{user `DVD1`}}",
"iso_checksum_type": "none",
"vm_name": "{{user `imagename`}}",
"http_directory": "httpdir",
"http_port_min": 10082,
"http_port_max": 10089,
"ssh_host_port_min": 2222,
"ssh_host_port_max": 2229,
"vnc_bind_address": "0.0.0.0",
"ssh_username": "root",
"ssh_password": "*****",
"ssh_port": 22,
"ssh_wait_timeout": "12000s",
"boot_wait": "5s",
"qemuargs":[
[
"-cpu",
"host"
]
],
“boot_command”:[
“ inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg ”
],
"shutdown_command": "shutdown -P now"
}
],
“provisioners”:
[
]
}
ks.cfg
[root@sellics01982 proj]# vi base_os.json
[root@sellics01982 proj]# vi httpdir/ks.cfg
keyboard ‘us’
rootpw EvaiKiO1
lang en_US.UTF-8
network --bootproto=dhcp
firewall --disabled
authselect --enableshadow --passalgo=sha512
cdrom
text
selinux --permissive
reboot
zerombr
clearpart --all --initlabel
autopart
openssh-clients