packer environment trying to setup on centos 7

368 views
Skip to first unread message

talha jilal

unread,
Mar 8, 2018, 1:26:28 AM3/8/18
to Packer
Hello Friends , 

I currently trying to setup another envirnoment on Centos 7.  My idea is to create a Esxi template by using redhat or centos 7 VM in vcenter and reproduce templates. 


1- Centos 7 VM. 
2- Packer ( 
packer  -v
1.2.1
3-  VMware packages installed , 

VMware-VIX-1.15.0-2985596.x86_64.bundle
VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle
VMware-vSphere-CLI-5.0.0-615831.x86_64.tar.gz
VMware-Player-7.1.2-2780323.x86_64.bundle

4- I am having the following error , please also find my json file at the bottom. 

packer  build esxi-template.json
vmware-iso output will be in this color.

Build 'vmware-iso' errored: Couldn't find VMware tools for 'linux'! VMware often downloads these
tools on-demand. However, to do this, you need to create a fake VM
of the proper type then click the 'install tools' option in the
VMware GUI.

==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Couldn't find VMware tools for 'linux'! VMware often downloads these
tools on-demand. However, to do this, you need to create a fake VM
of the proper type then click the 'install tools' option in the
VMware GUI.

==> Builds finished but no artifacts were created.





################################## JSON FILE   cat  esxi-template.json ##################



{
  "provisioners": [
    {
      "type": "shell",
      "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
      "script": "scripts/ansible.sh"
    }
  ],
  "builders": [
    {
      "type": "vmware-iso",
      "boot_command": [
        "<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg<enter><wait>"
      ],
      "boot_wait": "10s",
      "disk_size": 81920,
      "guest_os_type": "centos-64",
      "headless": true,
      "http_directory": "http",
      "iso_urls": [
        "CentOS-7-x86_64-Minimal-1708.iso",
        "CentOS-7-x86_64-Minimal-1708.iso"
      ],
      "iso_checksum_type": "sha256",
      "iso_checksum": "bba314624956961a2ea31dd460cd860a77911c1e0a56e4820a12b9c5dad363f5",
      "ssh_username": "vagrant",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_wait_timeout": "10000s",
      "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
      "remote_host": "192.168.2.50",
      "remote_datastore": "datastore1",
      "remote_username": "root",
      "remote_password": "somepass",
      "ssh_username": "root",
      "ssh_password": "vagrant",
      "ssh_wait_timeout": "60m",
      "tools_upload_flavor": "linux",
      "http_directory": ".",
      "boot_wait": "5s",
      "vmx_data": {
        "memsize": "2048",
        "numvcpus": "2",
        "ethernet0.present": "TRUE",
        "ethernet0.startConnected": "TRUE",
        "ethernet0.virtualDev": "e1000",
        "ethernet0.addressType": "generated",
        "ethernet0.generatedAddressOffset": "0",
        "ethernet0.wakeOnPcktRcv": "FALSE"
         },
      "tools_upload_flavor": "linux",
      "vm_name": "vmware-template",
      "vmx_data": {
        "cpuid.coresPerSocket": "2",
        "memsize": "2048",
        "numvcpus": "2"
      }
    }
  ],
  "post-processors": [
    {
    "type": "vsphere",
    "host": "192.168.2.50",
    "insecure": true,
    "username": "root",
    "password": "somepass",
    "datacenter": "some",
    "vm_name": "packer-build-centos7",
    "vm_folder": "vagrant",
    "datastore": "datastore1",
    "cluster": "some"

    }
    ]
}

Rickard von Essen

unread,
Mar 8, 2018, 1:53:30 AM3/8/18
to packe...@googlegroups.com

--
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/6460479d-d45a-4ac7-8a78-1efbcf23643c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

talha jilal

unread,
Mar 8, 2018, 5:10:52 PM3/8/18
to Packer
Hey Thanks this works for me. 


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

talha jilal

unread,
Mar 8, 2018, 10:35:41 PM3/8/18
to Packer
another issue with same packer , 

:( any clue ? 


vmware-iso output will be in this color.

==> vmware-iso: Downloading or copying ISO
    vmware-iso: Downloading or copying: file:///usr/src/packer-vagrant/CentOS-7-x86_64-Minimal-1708.iso
==> vmware-iso: Creating virtual machine disk
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Could not find netmap conf file: /etc/vmware/netmap.conf
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored: Could not find netmap conf file: /etc/vmware/netmap.conf

==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Could not find netmap conf file: /etc/vmware/netmap.conf

==> Builds finished but no artifacts were created.

Rickard von Essen

unread,
Mar 9, 2018, 1:47:45 AM3/9/18
to packe...@googlegroups.com
Can you search your VMware installation for the file netmap.conf? where is it located? Which OS are you running?

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/95dc5051-f2c0-489e-a4ec-b58d729f2d58%40googlegroups.com.

talha jilal

unread,
Mar 9, 2018, 9:43:38 AM3/9/18
to Packer
Centos 7.

Rickard von Essen

unread,
Mar 9, 2018, 10:37:27 AM3/9/18
to packe...@googlegroups.com
And the file? 

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/642784fd-d49b-4222-8fe2-614f25452608%40googlegroups.com.

talha jilal

unread,
Mar 10, 2018, 11:55:24 AM3/10/18
to Packer
No I can not find netmap.conf file, am I missing any package ? 
And the file? 

Rickard von Essen

unread,
Mar 10, 2018, 12:16:11 PM3/10/18
to packe...@googlegroups.com
Yes I think your VMware instalation is broken. Unfortunately I don't have a Linux workstation to try this on. 

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/42ba5ac3-6f4e-4df5-8681-6760cd5ae0aa%40googlegroups.com.

Alvaro Miranda Aguilera

unread,
Mar 10, 2018, 12:17:53 PM3/10/18
to packe...@googlegroups.com
Hello

Packer is a tool that helps you to automate creation of VM.

Is way better if you have some experience building VMs without packer so you can differenciate between OS issues, provision issues, packer issues.

I would suggest you build couple of boxes without packer and then try to automate that with packer.

Otherwise, even if you get past this road blocker you may hit another in the future.

If you are copying a packer repo, test is as it, and get one that works without any change.

Then my suggestion will be try to understand what the code does so you can move forward to your own project.

here you are hitting issues that are not packer issues, maybe host os is broken, vmware is missing files, etc.



talha jilal

unread,
Mar 11, 2018, 12:26:20 AM3/11/18
to Packer

Thanks , 
 
For prove of concept and to eliminate missing configuration parts, I skip my Linux Deployment for a while and trying to focus on my windows laptop and Esxi connectivity. 


Thanks you guys , I will reopen this thread once I have complete my windows setup. 
good suggestions highly appreciated  



Thanks ,  

TJ 
Reply all
Reply to author
Forward
0 new messages