I have a JSON file and a RHEL kickstart file that I’m trying to access thru HTTP file server on a specific port. All this is on the same server. So when trying to build my server, i"m getting this error:
vsphere-iso: Error finding port: port 8099 cannot be opened: listen tcp 0.0.0.0:8099: bind: address already in use
You misunderstood the http feature. If you define the http_directory packer will spawn its own http server listen on the defined port und providing the files in the directory defined in http_directory.
But I have no glue why Packer shouldn’t find the file on your already running server. Access control problems?
Here is part of the JSON file:
“http_directory”: “KS”
…
“boot_command”:[
" Vmlinuz initrd=initrd.img inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/KS/ghi-ks.cfg ",
“i”
The KS directory is in the same directory from where I’m starting packer build… So what di I miss? Thx
==> vsphere-iso: Creating VM…
==> vsphere-iso: Customizing hardware…
==> vsphere-iso: Mounting ISO images…
==> vsphere-iso: Starting HTTP server on port 8900
==> vsphere-iso: Set boot order…
==> vsphere-iso: Power on VM…
==> vsphere-iso: Waiting 10s for boot…
==> vsphere-iso: HTTP server is working at http://10.94.17.85:8951/
==> vsphere-iso: Typing boot command…
==> vsphere-iso: Waiting for IP…
Cancelling build after receiving interrupt
==> vsphere-iso: Power off VM…
==> vsphere-iso: Destroying VM…
Build ‘vsphere-iso’ finished.
Cleanly cancelled builds after being interrupted.
When removing the HTTP_DIRECTORY, it’s using my HTTP file server which is running on the same server that PACKER is installed. If I manually create my VM in VMware, break the boot sequence and spycify “inst.ks=http://10.94.17.85/KS/ghi-ks.cfg” in the boot sequence, I’m able to install RHEL 8.2 correctly. But if I specify the same command in my JSON file, I keep getting “file or directory not found”. So I must be missing something…
it seems that you must have a directory http beside your template file as the root of the http webserver. If you place you hi-ks.cfg-file in there you should define it in your json like