Reputation: 133
I am new to packer.
I am trying to build a vmware VM using packer. I am using VMware player as host.
I set the variables and select the builders as following:
"builders": [
{
"boot_command": [" text net.ifnames=0 biosdevname=0 ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg"],
"disk_size": "{{ user disk_size
}}",
"cpus": "{{ user cpus
}}",
"memory": "{{ user memory
}}",
"guest_os_type": "{{ user guest_os_type
}}",
"headless": "{{ user headless
}}",
"iso_checksum": "{{ user iso_checksum
}}",
"iso_checksum_type": "{{ user iso_checksum_type
}}",
"iso_url": "{{ user iso_url
}}",
"output_directory": "output-{{ user vm_name
}}-cloud",
"shutdown_command": "{{ user shutdown_command
}}",
"shutdown_timeout": "5m",
"ssh_password": "{{ user ssh_password
}}",
"ssh_username": "{{ user ssh_username
}}",
"ssh_wait_timeout": "{{ user ssh_wait_timeout
}}",
"type": "vmware-iso",
"vm_name": "{{ user vm_name
}}"
}
],
"variables": { "cpus": "2", "disk_size": "", "headless": "false", "iso_checksum": "", "iso_checksum_type": "sha256", "iso_url": "file://", "kickstart": "ks.cfg", "memory": "512", "shutdown_command": "shutdown -P now", "ssh_password": "packer", "ssh_username": "root", "ssh_wait_timeout" : "10000s", "guest_os_type": "rhel7-64", "vm_name": "" }
The error I am receiving is "Build 'vmware-iso' prepare failure: 1 error occurred: * unknown configuration key:" then it list all the parameters
After that I am receiving this --> and ctx data is map[interface {}]interface {}(nil)
Anyone can help?
Thanks in advance!!
Upvotes: 0
Views: 1981
Reputation: 133
After a I run the following commands:
"packer fix myfile.json > myfile-fixed.json"
"packer validate myfile-fixed.json"
issue resolved
Upvotes: 1