RHEL 7 vmware-iso build hangs

328 views
Skip to first unread message

Stacy

unread,
Mar 22, 2018, 1:06:48 PM3/22/18
to Packer
I apologize if this has been answered previously, I am new to the group, and looking for some help.  I am using packer and vmware workstation 14 to build a RHEL 7 template.  This works with our RHEL6 install, and when I boot the iso from vmware workstation or vsphere after creating the vm it installs just fine.  However when I try and build with packer it hangs before installing the packages.  I get the dracut-initqueue timeouts and an emergency shell.  I have able to see my install media and ks file from the emergency shell, so I know the network is working.  Not sure where to look for the problem, I have gone through the rdsosreport.txt file and do not see anything glaring.  Here is my packer json and variables json and the command I am running to build. 

Hangs at RTNETLINK answers: File exists
then times out

 packer build -var-file variables.json foundation_template.json

variables.json
{
  "ssh_username"         : "root",
  "ssh_password"         : "password",
  "output_dir"           : "/var/packer/vmware/vmware-iso-rh7"
}


foundation.json
{
  "builders":
  [
    {
      "type"                 : "vmware-iso",
      "boot_command":
      [
        "<wait>",
        "<enter>",
        "<wait>"
      ],
      "headless"             : true,
      "disk_type_id"         : "0",
      "vnc_bind_address"     : "0.0.0.0",
      "vnc_port_min"         : "5900",
      "vnc_port_max"         : "5910",
      "vnc_disable_password" : true,
      "iso_url"              : "iso/rhel7_base.iso",
      "iso_checksum"         : "e4bee7df9c1820035c47f200a2176e81",
      "iso_checksum_type"    : "md5",
      "output_directory"     : "{{user `output_dir`}}",
      "guest_os_type"        : "rhel7-64",
      "disk_size"            : "64000",
      "shutdown_command"     : "/sbin/halt -p",
      "ssh_wait_timeout"     : "2700s",
      "ssh_username"         : "{{user `ssh_username`}}",
      "ssh_password"         : "{{user `ssh_password`}}",
      "skip_compaction"      : true,
      "vmx_data"             : {
                                "ethernet0.virtualDev"               : "vmxnet3",
                                "scsi0.virtualDev"                   : "pvscsi"
      },
      "vm_name"              : "rhel7-tmplate"
    }
  ],
  "provisioners":
  [
    {
      "type"                 : "shell",
      "script"               : "scripts/run_updates.sh"
    },
    {
      "type"                 : "shell",
      "script"               : "scripts/reset_network.sh"
    }

  ]
}

Gabo Kete

unread,
Mar 22, 2018, 4:20:39 PM3/22/18
to Packer
Hi Stacy

Your boot_command argument is not telling where the OS needs to boot, you need to specify where to boot , where is the Linux image, and what is the KS file that needs to use to start the installation

Have a look how boot_command works


And here is an example of a boot_command I have running in my environment ( my boot command uses variables, so will share this with you, but not necessarily you need to use them, it is just for me it looks much more neat if I use them and much more flexible if I need to change them in the future)

variables

"vmlinuz_file": "centos7.1503_x64/images/pxeboot/vmlinuz", "initrd_file": "centos7.1503_x64/images/pxeboot/initrd.img", "iso_image":"http://192.168.1.150/isos/CentOS-7-x86_64-NetInstall-1503.iso", "ks_file": "simple-ks-integrado-CIS-BitbyBit.ks",
"ks_server": "192.168.1.150",
"ks_path": "centos7.1511_x64/ks/",

 "boot_command": [
"<tab> text {{user `vmlinuz_file`}} initrd={{user `initrd_file`}} inst.ks=http://{{user `ks_server`}}/{{user `ks_path`}}/{{user `ks_file`}}<enter><wait>"
],

Stacy

unread,
Mar 22, 2018, 6:06:14 PM3/22/18
to Packer
I am currently using the iso as the boot source, however I will break it all out like you have it in order to troubleshoot.

Alvaro Miranda Aguilera

unread,
Mar 22, 2018, 8:16:33 PM3/22/18
to packe...@googlegroups.com
hello

your packer template boots a vm, puts the iso and press enter

if the iso is an standard rhel7 i am not sure will work.

have you done rhel7 un-attendend install?

- where you are setting the password for root ?



--
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/00294eed-25ca-48f3-88c7-7cb786b84f07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Stacy

unread,
Mar 23, 2018, 2:29:19 PM3/23/18
to Packer
thank you, the problem was some of my syntax needed to be updated to rhel7 verbage, and I figured it out by breaking up my pieces thanks to Gabo Kete, much appreciated

Stacy

unread,
Mar 23, 2018, 2:30:34 PM3/23/18
to Packer
Thank you, I modified the boot_command, and was able to issues in my ks file due to deprecated entries I needed to update to rhel7 verbage, thanks again, I was reverse engineering this, and that helped alot.


On Thursday, March 22, 2018 at 1:20:39 PM UTC-7, Gabo Kete wrote:

Gabo Kete

unread,
Mar 23, 2018, 4:48:17 PM3/23/18
to Packer
Glad you found the issue..

My advise is to use ksvalidator , it comes included in the pykickstart package... helps to check the syntax of a KS file and point out if you need to update it based on the RHEL/CENTOS/FEDORA version you are installing


usage: ksvalidator [options] ksfile

positional arguments:
  ksfile                filename or URL to read from

optional arguments:
  -h, --help            show this help message and exit
  -e, --firsterror      halt after the first error or warning
  -i, --followincludes  parse include files when %include is seen
  -l, --listversions    list the available versions of kickstart syntax
  -v VERSION, --version VERSION
                        version of kickstart syntax to validate against
Reply all
Reply to author
Forward
0 new messages