Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Builds hang when floppy attached on ESXi 6.5 #104

Closed
gbuktenica opened this issue May 18, 2018 · 11 comments
Closed

Builds hang when floppy attached on ESXi 6.5 #104

gbuktenica opened this issue May 18, 2018 · 11 comments
Labels

Comments

@gbuktenica
Copy link

Environment:

ESXi = 6.5 update 1
vCenter = vcsa 6.5 update 2
Guest = Windows Server 2016

Steps to reproduce

  • Clone windows example
  • Update ISO
  • Add "cluster" to builder
  • Add "network" to builder
  • Run:
packer build windows-10.json

Result

  • Build hangs at vsphere-io: waiting for IP...
  • Guest has a black screen with a single non blinking cursor.

Removing floppy_files section and re-running results in Windows booting to the language section but then there is no way to run the autounattend.xml

@mkuzmin
Copy link
Contributor

mkuzmin commented May 22, 2018

try to add "boot_order": "disk,cdrom" parameter

@gbuktenica
Copy link
Author

Interesting, now it hangs at:
Setup is starting

@jcoconnor
Copy link
Contributor

Umm - deleted comment earlier re not seeing disk drivers - turned out that I was using a corrupted .iso file. Have a few more questions on this but will raise them through a separate issue.
Fwiw - setup is starting, but barfing on the autounattend file which is more likely a configuration error on my part :)

@schmandforke
Copy link

schmandforke commented May 31, 2018

the subject of the ticket describes exactly what i'm not able by now....

My Environment:
vSphere 6.5.0.13000 (VCSA)
ESXi 6.5
Packer v1.2.3 (in docker container)
vsphere-iso packer plugin 2.0

My Config:

{
  "builders": [
    {
      "type": "vsphere-iso",

      "vcenter_server": "10.10.10.10",
      "insecure_connection": "true",
      "vm_version": 13,

      "username": "xxxxx",
      "password": "yyyyy",

      "cluster": "cl01",
      "host": "host21.local",
      "datastore": "Datastore_0000",
      "network": "PROVISION-123",

      "vm_name":  "AutoBuildTemplate01",
      "guest_os_type": "windows7Server64Guest",
      "convert_to_template": "true",
      "folder": "Templates",

      "communicator": "winrm",
      "winrm_username": "user01",
      "winrm_password": "p4ssw0rd",

      "CPUs": 2,
      "RAM": 4096,
      "RAM_reserve_all": true,

      "disk_controller_type":  "pvscsi",
      "disk_size":        61440,
      "disk_thin_provisioned": false,

      "network_card": "vmxnet3",

      "iso_paths": [
        "[Datastore_0000] isos/en_windows_10_multi-edition_vl_version_1709_updated_dec_2017_x64_dvd_100406172.iso"
      ],

      "floppy_files": [
        "/root/unattend/2012r2.xml"
      ]
    }
  ],
  "provisioners": [
    {
      "type": "windows-shell",
      "inline": ["dir c:\\"]
    }
  ]
}

And the logs i get:

$ PACKER_LOG=1 packer build -on-error=abort -parallel=false  win2k8r2.json
2018/05/30 15:07:28 [INFO] Packer version: 1.2.3
2018/05/30 15:07:28 Packer Target OS/Arch: linux amd64
2018/05/30 15:07:28 Built with Go Version: go1.10.1
2018/05/30 15:07:28 Detected home directory from env var: /root
2018/05/30 15:07:28 [DEBUG] Discovered plugin: vsphere-iso = /root/.packer.d/plugins/packer-builder-vsphere-iso
2018/05/30 15:07:28 Using internal plugin for alicloud-ecs
...
2018/05/30 15:07:28 Detected home directory from env var: /root
2018/05/30 15:07:28 Setting cache directory: /root/packer_cache
2018/05/30 15:07:28 Detected home directory from env var: /root
2018/05/30 15:07:28 Loading builder: vsphere-iso
2018/05/30 15:07:28 Creating plugin client for path: /root/.packer.d/plugins/packer-builder-vsphere-iso
2018/05/30 15:07:28 Starting plugin: /root/.packer.d/plugins/packer-builder-vsphere-iso []string{"/root/.packer.d/plugins/packer-builder-vsphere-iso"}
2018/05/30 15:07:28 Waiting for RPC address for: /root/.packer.d/plugins/packer-builder-vsphere-iso
2018/05/30 15:07:28 packer-builder-vsphere-iso: 2018/05/30 15:07:28 Plugin minimum port: 10000
2018/05/30 15:07:28 packer-builder-vsphere-iso: 2018/05/30 15:07:28 Plugin maximum port: 25000
2018/05/30 15:07:28 packer-builder-vsphere-iso: 2018/05/30 15:07:28 Plugin address: unix /tmp/packer-plugin825943872
2018/05/30 15:07:28 packer-builder-vsphere-iso: 2018/05/30 15:07:28 Waiting for connection...
2018/05/30 15:07:28 packer-builder-vsphere-iso: 2018/05/30 15:07:28 Serving a plugin connection...
2018/05/30 15:07:28 Loading provisioner: windows-shell
2018/05/30 15:07:28 Plugin could not be found. Checking same directory as executable.
2018/05/30 15:07:28 Current exe path: /bin/packer
2018/05/30 15:07:28 Creating plugin client for path: /bin/packer
2018/05/30 15:07:28 Starting plugin: /bin/packer []string{"/bin/packer", "plugin", "packer-provisioner-windows-shell"}
2018/05/30 15:07:28 Waiting for RPC address for: /bin/packer
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 [INFO] Packer version: 1.2.3
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Packer Target OS/Arch: linux amd64
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Built with Go Version: go1.10.1
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Detected home directory from env var: /root
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Attempting to open config file: /root/.packerconfig
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 [WARN] Config file doesn't exist: /root/.packerconfig
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Detected home directory from env var: /root
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Setting cache directory: /root/packer_cache
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Detected home directory from env var: /root
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 args: []string{"packer-provisioner-windows-shell"}
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Plugin minimum port: 10000
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Plugin maximum port: 25000
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Plugin address: unix /tmp/packer-plugin339202557
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Waiting for connection...
2018/05/30 15:07:28 packer: 2018/05/30 15:07:28 Serving a plugin connection...
vsphere-iso output will be in this color.

2018/05/30 15:07:28 ui: vsphere-iso output will be in this color.
2018/05/30 15:07:28 ui:
2018/05/30 15:07:28 Build debug mode: false
2018/05/30 15:07:28 Force build: false
2018/05/30 15:07:28 On error: abort
2018/05/30 15:07:28 Preparing build: vsphere-iso
2018/05/30 15:07:28 Parallelization disabled, waiting for build to finish: vsphere-iso
2018/05/30 15:07:28 Starting build run: vsphere-iso
2018/05/30 15:07:28 Running builder: vsphere-iso
2018/05/30 15:07:28 [INFO] (telemetry) Starting builder vsphere-iso
2018/05/30 15:07:28 ui: ==> vsphere-iso: Creating VM...
==> vsphere-iso: Creating VM...
2018/05/30 15:07:31 ui: ==> vsphere-iso: Customizing hardware...
==> vsphere-iso: Customizing hardware...
2018/05/30 15:07:33 ui: ==> vsphere-iso: Adding CD-ROM drives...
==> vsphere-iso: Adding CD-ROM drives...
==> vsphere-iso: Creating floppy disk...
2018/05/30 15:07:35 ui: ==> vsphere-iso: Creating floppy disk...
2018/05/30 15:07:35 packer-builder-vsphere-iso: 2018/05/30 15:07:35 Floppy path: /tmp/packer385864607
2018/05/30 15:07:35 packer-builder-vsphere-iso: 2018/05/30 15:07:35 Initializing block device backed by temporary file
2018/05/30 15:07:35 packer-builder-vsphere-iso: 2018/05/30 15:07:35 Formatting the block device with a FAT filesystem...
2018/05/30 15:07:35 packer-builder-vsphere-iso: 2018/05/30 15:07:35 Initializing FAT filesystem on block device
2018/05/30 15:07:35 packer-builder-vsphere-iso: 2018/05/30 15:07:35 Reading the root directory from the filesystem
2018/05/30 15:07:35 ui:     vsphere-iso: Copying files flatly from floppy_files
    vsphere-iso: Copying files flatly from floppy_files
    vsphere-iso: Copying file: /root/unattend/2012r2.xml
2018/05/30 15:07:35 ui:     vsphere-iso: Copying file: /root/unattend/2012r2.xml
2018/05/30 15:07:35 ui:     vsphere-iso: Done copying files from floppy_files
    vsphere-iso: Done copying files from floppy_files
2018/05/30 15:07:35 ui:     vsphere-iso: Collecting paths from floppy_dirs
    vsphere-iso: Collecting paths from floppy_dirs
2018/05/30 15:07:35 ui:     vsphere-iso: Resulting paths from floppy_dirs : []
    vsphere-iso: Resulting paths from floppy_dirs : []
2018/05/30 15:07:35 ui:     vsphere-iso: Done copying paths from floppy_dirs
    vsphere-iso: Done copying paths from floppy_dirs
2018/05/30 15:07:35 ui: ==> vsphere-iso: Uploading created floppy image
==> vsphere-iso: Uploading created floppy image
==> vsphere-iso: Step "StepAddFloppy" failed, aborting...
2018/05/30 15:07:35 ui error: ==> vsphere-iso: Step "StepAddFloppy" failed, aborting...
2018/05/30 15:07:35 [INFO] (telemetry) ending vsphere-iso
2018/05/30 15:07:35 ui error: Build 'vsphere-iso' errored: unexpected EOF
2018/05/30 15:07:35 Waiting on builds to complete...
2018/05/30 15:07:35 Builds completed. Waiting on interrupt barrier...
2018/05/30 15:07:35 machine readable: error-count []string{"1"}
2018/05/30 15:07:35 ui error:
==> Some builds didn't complete successfully and had errors:
2018/05/30 15:07:35 machine readable: vsphere-iso,error []string{"unexpected EOF"}
2018/05/30 15:07:35 ui error: --> vsphere-iso: unexpected EOF
2018/05/30 15:07:35 ui:
==> Builds finished but no artifacts were created.
2018/05/30 15:07:35 [INFO] (telemetry) Finalizing.
Build 'vsphere-iso' errored: unexpected EOF

==> Some builds didn't complete successfully and had errors:
--> vsphere-iso: unexpected EOF

==> Builds finished but no artifacts were created.
2018/05/30 15:07:35 /root/.packer.d/plugins/packer-builder-vsphere-iso: plugin process exited
2018/05/30 15:07:36 waiting for all plugin processes to complete...
2018/05/30 15:07:36 /bin/packer: plugin process exited

I think the error during the upload is something about here:

vmDir, err := vm.GetDir()

Can somebody give me a hint ?

Thanks

@pgiuliano
Copy link

pgiuliano commented May 31, 2018

I believe I'm having same issue as @gbuktenica - shortly after the new VM boots it goes unresponsive. If you simply restart the VM the build starts and does not stop. I am using vsphere 6.0 U3 building windows server 2016 with a floppy attached for the autounattend.xml - however I have same issue if I don't attach any floppy disc. I suspect it is a vcenter issue (waiting on my virt team to help setup another environment to confirm)

@schmandforke
Copy link

Hey @ALL,

my first comment was a failure in vsphere with some certificates. As i'm solving it, i got the issue with "Setup is starting" and the hole vm hang's. Even halting or deleting the VM results in error messages :-S

But... i think it has to be something with the boot_order.

Normal steps which results in errors:

    • build new VM
    • attach ISO
    • attach flp-file
    • poweron VM

but if i'm going ahead with theese steps, the Setup is running through:

    • Change BootDelay to 5000 miliseconds
    • poweron vm
    • in bootup screen press ESC
    • choose CDROM Drive

I'm going a step ahead of the "Setup is starting", but failes in the next which say:

Windows could not apply the unattend answer file's <DiskConfiguration> section

pretty weired because, as i said, if i'm doing it all manually, all things working fine...

@Outek
Copy link

Outek commented Jun 13, 2018

I have the same issue, none of the Workarounds can fix the unresponsive vm

@xenithorb
Copy link

This is likely a duplicate of #119

Possible workaround for this ticket here: #119 (comment)

@Outek
Copy link

Outek commented Jun 14, 2018

Thank you, it's working now with this Workaround.

@pgiuliano
Copy link

Yep confirmed setting CPU Limit: -1 fixes hang......how did we not see this

@mkuzmin
Copy link
Contributor

mkuzmin commented Oct 21, 2018

fixed in version 2.0.1

@mkuzmin mkuzmin closed this as completed Oct 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

7 participants