packer-builder-vsphere icon indicating copy to clipboard operation
packer-builder-vsphere copied to clipboard

vsphere-iso: The attempted operation cannot be performed in the current state (Powered on). Build 'vsphere-iso' errored: unexpected EOF

Open KiranMedicherla opened this issue 6 years ago • 5 comments

When trying to build the VM image using the vpshere iso. i get the below error.

vsphere-iso: The attempted operation cannot be performed in the current state (Powered on). Build 'vsphere-iso' errored: unexpected EOF

Below is the exception trace in more detail. 2019/10/18 10:52:28 [INFO] (telemetry) Starting builder vsphere-iso ==> vsphere-iso: Creating VM... ==> vsphere-iso: Customizing hardware... ==> vsphere-iso: Mount ISO images... ==> vsphere-iso: Creating floppy disk... 2019/10/18 10:52:34 packer-builder-vsphere-iso.exe: 2019/10/18 10:52:34 Floppy path: C:\Users\medik\AppData\Local\Temp\packer189977667 2019/10/18 10:52:34 packer-builder-vsphere-iso.exe: 2019/10/18 10:52:34 Initializing block device backed by temporary file vsphere-iso: Copying files flatly from floppy_files 2019/10/18 10:52:34 packer-builder-vsphere-iso.exe: 2019/10/18 10:52:34 Formatting the block device with a FAT filesystem... vsphere-iso: Copying file: C:\POCs\Packer\ksn.cfg 2019/10/18 10:52:34 packer-builder-vsphere-iso.exe: 2019/10/18 10:52:34 Initializing FAT filesystem on block device vsphere-iso: Done copying files from floppy_files 2019/10/18 10:52:34 packer-builder-vsphere-iso.exe: 2019/10/18 10:52:34 Reading the root directory from the filesystem vsphere-iso: Collecting paths from floppy_dirs vsphere-iso: Resulting paths from floppy_dirs : [] vsphere-iso: Done copying paths from floppy_dirs ==> vsphere-iso: Uploading created floppy image ==> vsphere-iso: Adding generated Floppy... ==> vsphere-iso: Set boot order temporary... ==> vsphere-iso: Power on VM... ==> vsphere-iso: Waiting 45s for boot... ==> vsphere-iso: Typing boot command... 2019/10/18 10:53:26 packer-builder-vsphere-iso.exe: 2019/10/18 10:53:26 Waiting 1 second 2019/10/18 10:53:27 packer-builder-vsphere-iso.exe: 2019/10/18 10:53:27 Unsolicited response received on idle HTTP channel starting with "HTTP/1.1 501 Not Implemented\r\nDate: Fri, 18 Oct 2019 05:24:05 GMT\r\nConnection: close\r\nContent-Type: text; charset=plain\r\nContent-Length: 0\r\n\r\n"; err= ==> vsphere-iso: Clear boot order... ==> vsphere-iso: Deleting Floppy image ... 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: 2019/10/18 10:53:32 Deleting floppy disk: C:\Users\medik\AppData\Local\Temp\packer189977667 ==> vsphere-iso: Destroying VM... ==> vsphere-iso: The attempted operation cannot be performed in the current state (Powered on). 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. 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: panic: interface conversion: interface is nil, not error 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: goroutine 78 [running]: 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: github.com/jetbrains-infra/packer-builder-vsphere/iso.(*Builder).Run(0xc000005180, 0x13c03a0, 0xc0000053a0, 0x13b96e0, 0xc000050a40, 0x13be620, 0xc000006178, 0x4cae53, 0xf50820, 0xf50820, ...) 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: /mnt/agent/work/ab2b783c0e3ba9c5/iso/builder.go:133 +0xdb7 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: github.com/hashicorp/packer/packer/rpc.(*BuilderServer).Run(0xc0000051a0, 0x1, 0xc00006dce0, 0x0, 0x0) 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: /mnt/agent/work/ab2b783c0e3ba9c5/build/modules/pkg/mod/github.com/hashicorp/[email protected]/packer/rpc/builder.go:94 +0x1d4 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: reflect.Value.call(0xc000056720, 0xc000006160, 0x13, 0x1266459, 0x4, 0xc00036df18, 0x3, 0x3, 0xc000142000, 0x0, ...) 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: /usr/local/go/src/reflect/value.go:447 +0x45b 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: reflect.Value.Call(0xc000056720, 0xc000006160, 0x13, 0xc00036df18, 0x3, 0x3, 0x0, 0x0, 0x0) 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: /usr/local/go/src/reflect/value.go:308 +0xab 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: net/rpc.(*service).call(0xc000052740, 0xc000158460, 0xc000030508, 0xc000030510, 0xc000192500, 0xc000067320, 0xf81f80, 0xc00006dcdc, 0x18a, 0xf50820, ...) 2019/10/18 10:53:32 packer-builder-vsphere-iso.exe: /usr/local/go/src/net/rpc/server.go:384 +0x155

KiranMedicherla avatar Oct 18 '19 05:10 KiranMedicherla

@KiranMedicherla Which version of ESXI & vCenter are you running? Boot command typing is supported on 6.5 and newer only

LIV2 avatar Oct 24 '19 11:10 LIV2

I am having the same problem, using ESXi version 6.7 The problem appears only after the termination:

==> vsphere-iso: Destroying VM...
==> vsphere-iso: The attempted operation cannot be performed in the current state (Powered on).
Build 'vsphere-iso' errored: unexpected EOF

Any updates on that?

sporokh avatar Nov 09 '19 01:11 sporokh

Happens to me too on 6.7 when converting to template. Seems to try to convert before the VM is completely off.

PshNinja avatar Dec 01 '19 23:12 PshNinja

Fetching same issues with 5.5. Do we have any switch to pause packer after all build are completed.? I have set "convert_to_template" to false but still facing the same issue.

connect2aameer avatar Feb 24 '20 12:02 connect2aameer

I'm experiencing this issue on 6.7 with a Windows 10 build 1507 image. Other OSes seem to complete successfully.

twangboy avatar Sep 17 '20 13:09 twangboy