I am trying to create template in a ESX machine from a VMWare VM in another host. Below are versions.
Packer version - 0.12.2
Host platform - RHEL 6.7
ESX 5.1
I am using below JSON and kickstart to create template. When I check the "Network adapter" in the VM. I see no VLAN is assigned to it. Please help me with parameter to mention the VLAN and any other required parameters if any required.
(Initially tried without passing much data to vmx_data unlike the code below, but error is same.)
JSON
{
"variables": {
"vm_name": "packer",
"vm_description": "rhel7 base",
"iso": "/packer/Virtualbox/rhel-server-7.0-x86_64-dvd.iso",
"checksum": "85a9fedc2bf0fc825cc7817056aa00b3ea87d7e111e0cf8de77d3ba643f8646c",
"iso_checksum_type": "sha256"
},
"builders": [
{
"type": "vmware-iso",
"ssh_username": "packer",
"ssh_password": "packer",
"ssh_port": 22,
"ssh_wait_timeout": "30m",
"http_directory": "http",
"vm_name": "{{ user `vm_name` }}",
"guest_os_type": "rhel7-64",
"iso_url": "{{ user `iso` }}",
"iso_checksum": "{{ user `checksum` }}",
"iso_checksum_type": "{{ user `iso_checksum_type` }}",
"tools_upload_flavor": "linux",
"remote_datastore": "removed",
"remote_host": "removed",
"remote_password": "removed",
"remote_type": "esx5",
"remote_username": "root",
"headless": false,
"vmx_data": {
"cpuid.coresPerSocket": 1,
"memsize": 512,
"ethernet0.present":"true",
"ethernet0.pciSlotNumber":"192",
"ethernet0.virtualDev":"vmxnet3",
"ethernet0.dvs.switchId":"",
"ethernet0.dvs.connectionId":"0",
"ethernet0.addressType":"vpx",
"numvcpus": 1
},
"boot_wait": "10s",
"boot_command": [
"<esc><wait>",
"vmlinuz initrd=initrd.img net.ifnames=0 biosdevname=0 ",
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks3.cfg<enter><wait>"
],
"shutdown_command": "echo '{{ user `username` }}' | sudo -S shutdown -P now"
}
]
}
Kickstart
install
cdrom
lang en_US.UTF-8
keyboard us
timezone America/New_York --isUtc
network --bootproto=dhcp
user --name=packer --plaintext --password packer --groups=packer --gecos="packer"
rootpw --iscrypted xxxxxxx
auth --enableshadow --passalgo=sha512 --kickstart
firewall --disabled
selinux --disabled
bootloader --location=mbr
services --disabled="ip6tables,iptables" --enabled=NetworkManager,sshd
text
skipx
zerombr
clearpart --all --initlabel
autopart --type=lvm
firstboot --disable
eula --agreed
reboot
%packages --instLangs=en_US.utf8 --nobase --ignoremissing --excludedocs
@Core
@Base
@Development Tools
@Console internet tools
@Legacy UNIX compatibility
@Network Infrastructure Server
@Networking Tools
@Perl Support
@Security Tools
@System administration tools
@Debugging Tools
@Compatibility libraries
%end
%post
groupadd -g 9999 packer
useradd -u 9999 -g packer -G wheel packer
echo "packer" | passwd --stdin packer
sed -E -i '/Defaults[[:space:]]+requiretty/ s/^/#/' /etc/sudoers
echo "packer ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
%end
Thanks in advance
Shyam
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/510caa6f-7bd0-4a98-bac1-f4f568260cd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks
Shyam
Shyam
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a4f51eb5-cb90-4bf1-bb58-7978f7386736%40googlegroups.com.
Thanks
Shyam
Thanks
Shyam
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/e8afd149-6a72-40c2-87bd-8d41cf57fa36%40googlegroups.com.
What I was trying to explain is after adding ssh_host in my JSon file getting network error agsin. Packer is looking for dhcp. Please see error attached
Thanks
ShyanOn Tuesday, 14 February 2017 16:07:00 UTC+5:30, Rickard von Essen wrote:
> "With mentioning ssh_host, ssh_port packer is still looking for Dhcp" Sorry I don't follow this.
>
>
> On 14 February 2017 at 10:27, Shyam J <shya...@gmail.com> wrote:
> With mentioning ssh_host, ssh_port packer is still looking for Dhcp. Am I missing any other parameter?
>
>
>
> Thanks
>
> Shyam
>
>
>
> --
>
> This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
>
>
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
>
> IRC: #packer-tool on Freenode
>
> ---
>
> You received this message because you are subscribed to the Google Groups "Packer" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/8f25615e-94ed-4a23-ac0f-8b5163f9d649%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/8f25615e-94ed-4a23-ac0f-8b5163f9d649%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Alvaro for checking..But even when I remove Dhcp entry and give full network details with IP it is searching for dhcp
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/7947832d-05fd-49d1-be55-b5e023d6cb3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks
Shyam
Thanks everyone for checking.
I was able to fix this by adding network details along with kick-start details in same line under boot_command option. Even when we put network details in kick-start file packer can't communicate.
Thanks
Shyam