Packer + vmware-iso + ESX | VM created with disconnected network interface

745 views
Skip to first unread message

Sergey Kharnam

unread,
Dec 9, 2017, 5:52:48 PM12/9/17
to Packer

- VM is coming up with disconnected interface.
- If I try to tick the Connect check-box it throws an error "Failed to connect virtual device"
- If I switch over to another network and back again to the initial one and only tick the Connect check-box it becomes up and running.

See below my vmx_data defines the networking:

{
  "variables": {
    "version": "1.0"
  },

  "builders": [
    {
      "name": "rhel7.3",
      "vm_name": "rhel7.3",
      "vmdk_name": "rhel7.3",
      "type": "vmware-iso",
      "communicator": "ssh",
      "ssh_pty": "true",
      "headless": false,
      "disk_size": 102400,
      "guest_os_type": "rhel7-64",
      "iso_url": "/mnt/framework_bin_repo/rhel_7.3/rhel-server-7.3-x86_64-dvd.iso",
      "iso_checksum": "120acbca7b3d55465eb9f8ef53ad7365f2997d42d4f83d7cc285bf5c71e1131f",
      "iso_checksum_type": "none",
      "vnc_disable_password": "true",
      "shutdown_command": "echo 'packer' | sudo -S shutdown -P now",

      "remote_host": "{{user `packer_remote_host`}}",
      "remote_datastore": "{{user `packer_remote_datastore`}}",
      "remote_username": "{{user `packer_remote_username`}}",
      "remote_password": "{{user `packer_remote_password`}}",
      "remote_type": "esx5",

      "ssh_username": "packer",
      "ssh_password": "packer",
      "ssh_wait_timeout": "20m",
      "tools_upload_flavor": "linux",
      "http_directory": "",
      "boot_wait": "5s",
      "vmx_data": {
        "memsize": "4096",
        "numvcpus": "2",
        "ethernet0.virtualDev": "vmxnet3",
        "ethernet0.dvs.switchId": "01 e1 20 50 95 72 e5 7a-8b 9f 44 1a 6c 1e 24 af",
        "ethernet0.dvs.portgroupId": "dvportgroup-12221",
        "ethernet0.addressType": "vpx",
        "ethernet0.uptCompatibility": "TRUE",
        "ethernet0.present": "TRUE",
        "ethernet0.startConnected": "TRUE"
      },
      "vmx_data_post": {
        "ide1:0.startConnected": "TRUE",
        "ide1:0.clientDevice": "TRUE",
        "ide1:0.fileName": "emptyBackingString"
      },

      "boot_command": [
        "<esc><wait>",
        "vmlinuz initrd=initrd.img quite ",
        "inst.ks=http://bitbucket.agile.bns/projects/PRVCT/repos/framework/raw/applications/os_template_generator/kickstart/kickstart_template_generic_rhel_7.3.cfg",
        "<enter>"
      ]
    }
  ],

  "provisioners": [{
    "type": "shell",
    "execute_command": "echo 'packer' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
    "scripts": [
      "/mnt/framework/applications/os_template_generator/packer/scripts/packer_postprovisioning_rhel_7.3.sh",
      "/mnt/framework/applications/os_template_generator/packer/scripts/localyumsetup.sh",
      "/mnt/framework/applications/os_template_generator/packer/scripts/vraguestagent.sh"
    ]
  }]
}


Rickard von Essen

unread,
Dec 10, 2017, 12:30:19 AM12/10/17
to packe...@googlegroups.com
Compare your network settings with the one in:

And this suggest that you need "ethernet0.networkName", see https://github.com/hashicorp/packer/issues/4540

And packer will not work if there is a vmotion event, see https://github.com/hashicorp/packer/issues/5091

Hope that gets you on the right track.

--
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/11bbc002-43d3-4745-9d69-83e391eee43f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alvaro Miranda Aguilera

unread,
Dec 10, 2017, 5:37:50 AM12/10/17
to packe...@googlegroups.com
This works for me:

seems you are missing network Name but your network seems to be different from standard one.

Can you create or instpect a working VM in that network and check what you may be missing on ethernet0. ?




            "vmx_data": {

                "memsize": "2048",

                "ethernet0.startConnected": "TRUE",

                "ethernet0.virtualDev": "vmxnet3",

                "ethernet0.networkName": "{{user `esx5_network`}}",

                "ethernet0.addressType": "generated",

                "ethernet0.wakeOnPcktRcv": "FALSE",

--
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/11bbc002-43d3-4745-9d69-83e391eee43f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Srinivas Boddula

unread,
Nov 30, 2018, 4:28:21 PM11/30/18
to Packer

I have the same issue  and  below is my vmx_data section of my packer file , am I missing any thing ?


 "vmx_data": {
        "cpuid.coresPerSocket": "1",
        "memsize": "4096",
        "numvcpus": "2",
        "ethernet0.dvs.switchid": "50 16 a6 17 28 0e 7f bd-ee 55 67 a2 b8 e9 2f 7a",
        "ethernet0.dvs.portgroupid": "dvportgroup-112",
        "ethernet0.virtualdev": "vmxnet3",
        "ethernet0.networkName": "LABD-General_980",
        "ethernet0.addressType": "generated",
        "ethernet0.wakeOnPcktRcv": "FALSE",
        "ethernet0.uptCompatibility": "TRUE",
        "ethernet0.startConnected": "TRUE",
        "ethernet0.present": "true",
        "vcpu.hotadd": "true",
        "vmem.hotadd": "true"

      },
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
Nov 30, 2018, 5:34:30 PM11/30/18
to packe...@googlegroups.com
esxi host doesn't know about portgroup

portgroup is a feature on vsphere, packer currently sshs into the esxi , so the portgroup wont work




For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages