Team,
Am trying to build the image for centos 8 through Jenkins. During the Packer execution, the HTTP IP and port is getting set as . Any thoughts?
Packer version: “Packer v1.5.6”
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",
"storage": [
{
"disk_size": 10000,
"disk_thin_provisioned": true
}
],
"iso_paths": [
"{{user `iso_paths` }}"
],
"iso_checksum": "13675c6f74880e7ff3481b91bdaf925ce81bda8f",
"iso_checksum_type": "sha1",
"boot_command": [
"<esc><wait>",
"vmlinuz initrd=initrd.img",
"init.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks8.cfg",
"<enter>"
]
}
]
}
The error is
boot: vmlinuz initrd=initrd.imginit.ks=http://<no value>:<no value>/ks8.cfg
Loading vmlinuz... ok
Loading initrd.imginit.ks=http://<no...failed: No such file or directory
The packer log shows:
+ PACKER_LOG=1 packer build '-var-file=vars/centos8-vars.json' -var 'vsphere_vm_name=centos8-template-26-10-20' -var 'vsphere_uid=****' -var 'vsphere_passwd=****' -var 'vm_superuser_passwd=****' -var 'bastion_key=****' -var 'vsphere_env=idev-uat' centos8-without-harden.json
2020/10/26 06:04:52 [INFO] Packer version: 1.5.6 [go1.14.2 linux amd64]
2020/10/26 06:04:52 Checking 'PACKER_CONFIG' for a config file path
2020/10/26 06:04:52 'PACKER_CONFIG' not set; checking the default config file path 2020/10/26 06:04:52 Attempting to open config file: /root/.packerconfig
2020/10/26 06:04:52 [WARN] Config file doesn't exist: /root/.packerconfig
2020/10/26 06:04:52 Setting cache directory: /bms/webapps/****/workspace/team_XSE/Admin/Terraform-Vsphere/vsphere-packer/Centos-Vspher-Image-build/packer-generic/packer_cache Running in background, not using a TTY
2020/10/26 06:04:52 Creating plugin client for path: /bin/packer
2020/10/26 06:04:52 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-builder-vsphere-iso"}
2020/10/26 06:04:52 Waiting for RPC address for: /bin/packer
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: [INFO] Packer version: 1.5.6 [go1.14.2 linux amd64]
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: Checking 'PACKER_CONFIG' for a config file path
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: Attempting to open config file: /root/.packerconfig
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: [WARN] Config file doesn't exist: /root/.packerconfig
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: Setting cache directory: /bms/webapps/****/workspace/team_XSE/Admin/Terraform-Vsphere/vsphere-packer/Centos-Vspher-Image-build/packer-generic/packer_cache
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: args: []string{"packer-builder-vsphere-iso"}
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: Plugin address: unix /tmp/packer-plugin605395048
2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: Waiting for connection...
2020/10/26 06:04:52 Received unix RPC address for /bin/packer: addr is /tmp/packer-plugin605395048 2020/10/26 06:04:52 packer-builder-vsphere-iso plugin: Serving a plugin connection...
2020/10/26 06:04:52 Build debug mode: false
2020/10/26 06:04:52 Force build: false
2020/10/26 06:04:52 On error:
2020/10/26 06:04:52 Preparing build: vsphere-iso **vsphere-iso: output will be in this color.** 2020/10/26 06:04:52 Waiting on builds to complete...
2020/10/26 06:04:52 Starting build run: vsphere-iso
2020/10/26 06:04:52 Running builder: vsphere-iso
2020/10/26 06:04:52 [INFO] (telemetry) Starting builder vsphere-iso **==> vsphere-iso: Creating VM...** **==> vsphere-iso: Customizing hardware...** **==> vsphere-iso: Mounting ISO images...**
2020/10/26 06:05:02 packer-builder-vsphere-iso plugin: Creating CD-ROM on controller '&{{{} 200 0xc0003d86a0 <nil> <nil> <nil> 0 <nil>} 0 []}' with iso '[nfs_iso_100] centos/CentOS-8.2.2004-x86_64-minimal.iso' **==> vsphere-iso: Set boot order temporary...**
2020/10/26 06:05:03 packer-builder-vsphere-iso plugin: No floppy files specified. Floppy disk will not be made. **==> vsphere-iso: Power on VM...** **==> vsphere-iso: Waiting 10s for boot...** **==> vsphere-iso: Typing boot command...**
2020/10/26 06:05:14 packer-builder-vsphere-iso plugin: Special code '<esc>' found, replacing with: CodeEscape
2020/10/26 06:05:15 packer-builder-vsphere-iso plugin: Waiting 1 second
2020/10/26 06:05:32 packer-builder-vsphere-iso plugin: Special code '<enter>' found, replacing with: CodeReturnEnter **==> vsphere-iso: Waiting for IP...**
2020/10/26 06:05:32 packer-builder-vsphere-iso plugin: [INFO] Waiting for IP, up to total timeout: 30m0s, settle timeout: 5s
Centos 7 and 6 image build is working fine from Jenkins. Anyway am not using http directory configuration there. The kickstart file is able to load using floppy there.