VM wont boot after template creation

62 views
Skip to first unread message

Paul Grinstead

unread,
Dec 10, 2018, 11:24:14 AM12/10/18
to Packer
Been having an issue for some time. After the creation and upload of the template to ESX and converting to VM, I get "Operating System not found". I have been scratching my head for the last couple of days.
Here is my build config. I am using fusion on my workstation than using vsphere and vsphere-template. The upload is quick, but I can see .vmx when it is completed in the templates folder.

$ packer version

Packer v1.3.3


Thoughts?

{
"variables": {
"version": ""
},
"provisioners": [{
"type": "shell",
"execute_command": "echo 'Packer' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/ansible.sh"
},
{
"type": "ansible-local",
"playbook_file": "ansible/main.yml",
"galaxy_file": "requirements.yml"
},
{
"type": "shell",
"execute_command": "echo 'Packer' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/cleanup.sh"
}
],
"builders": [{
"type": "vmware-iso",
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/ks.cfg<enter><wait>"
],
"boot_wait": "10s",
"disk_size": 31920,
"guest_os_type": "centos7-64",
"headless": true,
"http_directory": "http",
"iso_urls": [
"CentOS-7-x86_64-Minimal-1810.iso",
],
"iso_checksum_type": "sha256",
"iso_checksum": "38d5d51d9d100fd73df031ffd6bd8b1297ce24660dc8c13a3b8b4534a4bd291c",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"vm_name": "packer-centos-7-x86_64",

"remote_host": "x.x.x.xl",
    "remote_datastore": "VNX01_001",
    "remote_username": "username",
    "remote_password": "password",
    "ssh_wait_timeout": "60m",
    "tools_upload_flavor": "linux",
    "http_directory": ".",
    "boot_wait": "5s",
    "vmx_data": {
"ethernet0.virtualdev" : "vmxnet3",
"virtualhw.productcompatibility" : "esx",
"virtualhw.version" : "13",
"cpuid.coresPerSocket": "2",
"memsize": "2048",
"scsi0.virtualDev": "pvscsi",
"numvcpus": "1"
},
"tools_upload_flavor": "linux",
    "vm_name": "VM-packer-build-centos7v2"
}],
"post-processors": [
[{ "type": "vsphere",
    "host": "x.x.x.x",
    "insecure": true,
    "username": "username",
    "password": "password",

    "datacenter": "NSCLAB",
    "vm_name": "packer-build-centos7v2",
    "vm_folder": "kitchen",
    "datastore": "VNX01_001",
"vm_network": "VLAN1216",
    "cluster":  "Automation",

"keep_input_artifact": true,
"overwrite" : true
},
{    "type": "vsphere-template",
    "host": "x.x.x.x",
    "insecure": true,
    "username": "username",
    "password": "password",
    "datacenter": "NSCLAB",
    "folder": "/kitchen",

"keep_input_artifact": true
}]
]
}

----

==> vmware-iso: Skipping export of virtual machine (export is allowed only for ESXi)...

2018/12/10 08:07:05 packer: 2018/12/10 08:07:05 Executing: /Applications/VMware Fusion.app/Contents/Library/vmrun -T fusion list

2018/12/10 08:07:05 packer: 2018/12/10 08:07:05 stdout: Total running VMs: 0

2018/12/10 08:07:05 packer: 2018/12/10 08:07:05 stderr:

2018/12/10 08:07:05 [INFO] (telemetry) ending vmware-iso

2018/12/10 08:07:05 [INFO] (telemetry) Starting post-processor vsphere

==> vmware-iso: Running post-processor: vsphere

    vmware-iso (vsphere): Uploading output-vmware-iso/VM-packer-build-centos7v2.vmx to vSphere

2018/12/10 08:07:05 packer: 2018/12/10 08:07:05 Starting ovftool with parameters: --acceptAllEulas --name=packer-build-centos7v2 --datastore=VNX01_001 --noSSLVerify=true --diskMode=thick --vmFolder=kitchen --network=VLAN1216 --overwrite output-vmware-iso/VM-packer-build-centos7v2.vmx vi://user:<password>@x.x.x.x/NSCLAB/host/Automation

    vmware-iso (vsphere):

2018/12/10 08:07:10 [INFO] (telemetry) ending vsphere

2018/12/10 08:07:10 Flagging to keep original artifact from post-processor 'vsphere'

2018/12/10 08:07:10 [INFO] (telemetry) Starting post-processor vsphere-template

==> vmware-iso: Running post-processor: vsphere-template

    vmware-iso (vsphere-template): Waiting 10s for VMware vSphere to start

    vmware-iso (vsphere-template): Choosing datacenter...

    vmware-iso (vsphere-template): Creating or checking destination folders...

    vmware-iso (vsphere-template): Marking as a template...

2018/12/10 08:07:21 [INFO] (telemetry) ending vsphere-template

2018/12/10 08:07:21 Builds completed. Waiting on interrupt barrier...

Build 'vmware-iso' finished.


==> Builds finished. The artifacts of successful builds are:

2018/12/10 08:07:21 machine readable: vmware-iso,artifact-count []string{"3"}

==> Builds finished. The artifacts of successful builds are:

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "builder-id", "mitchellh.vmware"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "id", "VM-packer-build-centos7v2"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "string", "VM files in directory: %!s(<nil>)"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "files-count", "13"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "0", "output-vmware-iso/VM-packer-build-centos7v2.nvram"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "1", "output-vmware-iso/VM-packer-build-centos7v2.vmsd"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "2", "output-vmware-iso/VM-packer-build-centos7v2.vmx"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "3", "output-vmware-iso/VM-packer-build-centos7v2.vmxf"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "4", "output-vmware-iso/disk-s001.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "5", "output-vmware-iso/disk-s002.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "6", "output-vmware-iso/disk-s003.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "7", "output-vmware-iso/disk-s004.vmdk"}

--> vmware-iso: VM files in directory: %!s(<nil>)

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "8", "output-vmware-iso/disk-s005.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "9", "output-vmware-iso/disk-s006.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "10", "output-vmware-iso/disk-s007.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "11", "output-vmware-iso/disk-s008.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "file", "12", "output-vmware-iso/disk.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"0", "end"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "builder-id", "packer.post-processor.vsphere"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "id", "VNX01_001::kitchen::packer-build-centos7v2"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "string", "VM: packer-build-centos7v2 Folder: kitchen Datastore: VNX01_001"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "files-count", "13"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "0", "output-vmware-iso/VM-packer-build-centos7v2.nvram"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "1", "output-vmware-iso/VM-packer-build-centos7v2.vmsd"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "2", "output-vmware-iso/VM-packer-build-centos7v2.vmx"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "3", "output-vmware-iso/VM-packer-build-centos7v2.vmxf"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "4", "output-vmware-iso/disk-s001.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "5", "output-vmware-iso/disk-s002.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "6", "output-vmware-iso/disk-s003.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "7", "output-vmware-iso/disk-s004.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "8", "output-vmware-iso/disk-s005.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "9", "output-vmware-iso/disk-s006.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "10", "output-vmware-iso/disk-s007.vmdk"}

--> vmware-iso: VM: packer-build-centos7v2 Folder: kitchen Datastore: VNX01_001

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "11", "output-vmware-iso/disk-s008.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "file", "12", "output-vmware-iso/disk.vmdk"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"1", "end"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"2", "builder-id", ""}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"2", "id", ""}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"2", "string", ""}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"2", "files-count", "0"}

2018/12/10 08:07:21 machine readable: vmware-iso,artifact []string{"2", "end"}

--> vmware-iso: 

2018/12/10 08:07:21 [INFO] (telemetry) Finalizing.

2018/12/10 08:07:21 waiting for all plugin processes to complete...

2018/12/10 08:07:21 /usr/local/bin/packer: plugin process exited

2018/12/10 08:07:21 /usr/local/bin/packer: plugin process exited

2018/12/10 08:07:21 /usr/local/bin/packer: plugin process exited

2018/12/10 08:07:21 /usr/local/bin/packer: plugin process exited

2018/12/10 08:07:21 /usr/local/bin/packer: plugin process exited

2018/12/10 08:07:21 /usr/local/bin/packer: plugin process exited


Megan Marsh

unread,
Dec 10, 2018, 12:38:07 PM12/10/18
to packe...@googlegroups.com

Can you take a look there and at the workaround described? We had to revert the code change because it was causing other breakages, and are tracking the problem here: https://github.com/hashicorp/packer/issues/7067

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/11c35d7f-9d8e-4697-8bf4-96a9d7585ad4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Megan Marsh

unread,
Dec 10, 2018, 12:38:40 PM12/10/18
to packe...@googlegroups.com
Er, the workaround is described in https://github.com/hashicorp/packer/issues/6197

PaulG

unread,
Dec 10, 2018, 12:51:59 PM12/10/18
to Packer
I thought that was reverted in 1.3.3 release?

Megan Marsh

unread,
Dec 10, 2018, 12:55:30 PM12/10/18
to packe...@googlegroups.com
The _fix_ was reverted in 1.3.3 because it was causing other issues. So the original problem, with the template not booting because hddOrder is unset, is back.  :(

PaulG

unread,
Dec 10, 2018, 1:10:26 PM12/10/18
to Packer
Hmm, looking at my .vmx I do have an order set. Am I missing something? Thank you for your help, Megan.

.encoding = "UTF-8"
bios.bootorder = "hdd,cdrom"
bios.hddorder = "scsi0:0"
checkpoint.vmstate = ""
cleanshutdown = "TRUE"
config.version = "8"
cpuid.corespersocket = "2"
displayname = "VM-packer-build-centos7v2"

Megan Marsh

unread,
Dec 10, 2018, 1:13:18 PM12/10/18
to packe...@googlegroups.com
hm. Then maybe this is a different issue after all. Are you sure it's correctly uploading? We have another problem where OFVTool isn't properly uploading vms with the hddOrder _set_ in the template (fun, right?)

Megan Marsh

unread,
Dec 10, 2018, 1:14:47 PM12/10/18
to packe...@googlegroups.com
Note, that one should have been reverted in 1.3.3.  So if you used 1.3.3 to use the vsphere postprocessor to upload the vm to esxi then it should be okay.

Another option is that you can do the build entirely remotely, which I believe will bypass the ovftool bug.  Both of these issues are described in the meta-issue I linked above, if you want to follow them.

PaulG

unread,
Dec 10, 2018, 1:24:46 PM12/10/18
to Packer
Super fun! I am sure that it is uploading, but properly I am not 100% sure, everything looks like it should. Sigh. I am really stuck. Building remotely might be my best bet but gaining access is going to be cumbersome.

You mentioned another issue for hddOrder _set_ .. Do you have the link to that bug?

Thank you again!

-Paul

Megan Marsh

unread,
Dec 10, 2018, 1:29:42 PM12/10/18
to packe...@googlegroups.com
The summary for both our currently tracked hddOrder bugs is here: https://github.com/hashicorp/packer/issues/7067, and it has links to the original issues.

Reply all
Reply to author
Forward
0 new messages