Vsphere-iso Could not connect to floppy "packer-tmp-created-floppy.flp"

Hi
I have had a windows server 2016 template build working for some time and upgraded to packer 1.6.4 a few months ago when we upgraded to VSphere 7 here with no issues also. In the last few days for some reason I cant quite get to the bottom of, I get the dreaded ‘waiting for ip…’ timeout. On closer inspection, the issue is due to the fact the floppy drives get disconnected right at the start of the unattended installation. I can see the floppy drives attached when the windows installation process starts but fairly soon after they are both disconnected. There are 2 vmware logs created in the datastore (which i suspect is part of the problem) and one of the logs confirms the disconnection of the floppy drives

2021-01-08T16:32:32.960Z| vcpu-0| I005: AIOGNRC: Failed to open ‘/vmfs/volumes/5d3042e8-7f887b56-08b6-0025b511a000/ISO’s/VMWare Tools/11.2.0/pvscsi-Windows8.flp’ : Failed to lock the file (40003) (0x3).
2021-01-08T16:32:32.960Z| vcpu-0| I005: FLOPPYLIB-LIB : Open: FileIO error 4.
2021-01-08T16:32:32.960Z| vcpu-0| I005: FLOPPYLIB-LIB : Open rw for /vmfs/volumes/5d3042e8-7f887b56-08b6-0025b511a000/ISO’s/VMWare Tools/11.2.0/pvscsi-Windows8.flp failed: Device or resource busy
2021-01-08T16:32:36.966Z| vcpu-0| I005: AIOGNRC: Failed to open ‘/vmfs/volumes/5d3042e8-7f887b56-08b6-0025b511a000/ISO’s/VMWare Tools/11.2.0/pvscsi-Windows8.flp’ : Failed to lock the file (40003) (0x1).
2021-01-08T16:32:36.966Z| vcpu-0| I005: FLOPPYLIB-LIB : Open: FileIO error 4.
2021-01-08T16:32:36.966Z| vcpu-0| I005: FLOPPYLIB-LIB : Open r for /vmfs/volumes/5d3042e8-7f887b56-08b6-0025b511a000/ISO’s/VMWare Tools/11.2.0/pvscsi-Windows8.flp failed: Device or resource busy
2021-01-08T16:32:36.966Z| vcpu-0| I005: Msg_Post: Warning
2021-01-08T16:32:36.966Z| vcpu-0| I005: [msg.floppyImage.cantOpen] Cannot open floppy image /vmfs/volumes/5d3042e8-7f887b56-08b6-0025b511a000/ISO’s/VMWare Tools/11.2.0/pvscsi-Windows8.flp: Interrupted system call
2021-01-08T16:32:36.966Z| vcpu-0| I005: ----------------------------------------
2021-01-08T16:32:36.966Z| vcpu-0| I005: Locale_Errno2LocalString: “C” locale found. LC_ALL=(null), LANG=C
2021-01-08T16:32:36.966Z| vcpu-0| I005: Locale_Errno2LocalString: locale(LC_ALL)=C locale(LC_MESSAGES)=C
2021-01-08T16:32:36.968Z| vcpu-0| I005: FLOPPYLIB-IMAGE: Connect error: /vmfs/volumes/5d3042e8-7f887b56-08b6-0025b511a000/ISO’s/VMWare Tools/11.2.0/pvscsi-Windows8.flp will be disconnected.
2021-01-08T16:32:36.968Z| vcpu-0| I005: Msg_Post: Warning
2021-01-08T16:32:36.968Z| vcpu-0| I005: [msg.floppy.connectfailure] Could not connect to floppy “/vmfs/volumes/5d3042e8-7f887b56-08b6-0025b511a000/ISO’s/VMWare Tools/11.2.0/pvscsi-Windows8.flp”. It is being used by another virtual machine or some other program. It will start disconnected.
2021-01-08T16:32:36.968Z| vcpu-0| I005: [msg.device.startdisconnected] Virtual device ‘floppy1’ will start disconnected.
2021-01-08T16:32:36.968Z| vcpu-0| I005: ----------------------------------------
2021-01-08T16:32:40.974Z| vcpu-0| I005: AIOGNRC: Failed to open ‘packer-tmp-created-floppy.flp’ : Failed to lock the file (40003) (0x3).
2021-01-08T16:32:40.974Z| vcpu-0| I005: FLOPPYLIB-LIB : Open: FileIO error 4.
2021-01-08T16:32:40.974Z| vcpu-0| I005: FLOPPYLIB-LIB : Open rw for packer-tmp-created-floppy.flp failed: Device or resource busy
2021-01-08T16:32:44.976Z| vcpu-0| I005: AIOGNRC: Failed to open ‘packer-tmp-created-floppy.flp’ : Failed to lock the file (40003) (0x1).
2021-01-08T16:32:44.976Z| vcpu-0| I005: FLOPPYLIB-LIB : Open: FileIO error 4.
2021-01-08T16:32:44.976Z| vcpu-0| I005: FLOPPYLIB-LIB : Open r for packer-tmp-created-floppy.flp failed: Device or resource busy
2021-01-08T16:32:44.976Z| vcpu-0| I005: Msg_Post: Warning
2021-01-08T16:32:44.976Z| vcpu-0| I005: [msg.floppyImage.cantOpen] Cannot open floppy image packer-tmp-created-floppy.flp: Interrupted system call
2021-01-08T16:32:44.976Z| vcpu-0| I005: ----------------------------------------
2021-01-08T16:32:44.979Z| vcpu-0| I005: FLOPPYLIB-IMAGE: Connect error: packer-tmp-created-floppy.flp will be disconnected.
2021-01-08T16:32:44.979Z| vcpu-0| I005: Msg_Post: Warning
2021-01-08T16:32:44.979Z| vcpu-0| I005: [msg.floppy.connectfailure] Could not connect to floppy “packer-tmp-created-floppy.flp”. It is being used by another virtual machine or some other program. It will start disconnected.
2021-01-08T16:32:44.979Z| vcpu-0| I005: [msg.device.startdisconnected] Virtual device ‘floppy0’ will start disconnected.

As mentioned there are 2 vmware logs in the datastore and the log entries cross over timings which I suspect is the reason why the floppy files are in use
vmware.log 16:55:46.422 - 16:56:24.030
vmware_1.log 16:53:44.134 - 16:56:04.280

My packer config looks like this for info:

"builders": [

    {

      "CPUs": "{{user `vm-cpu-num`}}",

      "RAM": "{{user `vm-mem-size`}}",

      "RAM_reserve_all": true,

      "cluster": "{{user `vsphere-cluster`}}",

      "communicator": "winrm",

      "convert_to_template": "true",

      "datacenter": "{{user `vsphere-datacenter`}}",

      "datastore": "{{user `vsphere-datastore`}}",

      "disk_controller_type": "lsilogic-sas",

      "firmware": "bios",

      "floppy_files": [

        "./scripts/standard/autounattend.xml",

        "./scripts/install-vm-tools.cmd",

        "./scripts/disable-winrm.ps1",

        "./scripts/disable-network-discovery.cmd"

      ],

      "floppy_img_path": "[VMWARE-REDACTED-CONTENT-LIBRARY] ISO's/VMWare Tools/11.2.0/pvscsi-Windows8.flp",

      "folder": "{{user `vsphere-folder`}}",

      "guest_os_type": "windows9Server64Guest",

      "host": "{{user `vsphere-host`}}",

      "insecure_connection": "true",

      "iso_paths": [

        "{{user `os_iso_path`}}",

        "{{user `vmtools_iso_path`}}"

      ],

      "network_adapters": [

        {

          "network": "{{user `vsphere-network`}}",

          "network_card": "vmxnet3"

        }

      ],

      "notes": "Built via Packer - see code repo ''",

      "password": "{{user `vsphere-password`}}",

      "storage": [

        {

          "disk_size": "{{user `vm-disk-size`}}",

          "disk_thin_provisioned": true

        }

      ],

      "type": "vsphere-iso",

      "username": "{{user `vsphere-user`}}",

      "vcenter_server": "{{user `vsphere-server`}}",

      "vm_name": "{{user `vm-name`}}",

      "winrm_password": "{{user `winadmin-password`}}",

      "winrm_username": "Administrator"

    }

  ]

I have tried more recent packer versions 165 and 166 and same result. Also tried just one floppy drive instead of 2. The account I’m using for vsphere access is a top level administrator also

Any suggestions greatly appreciated!

Hello,

I wasn’t sure if this was something you were able to resolve.

I’m on Packer 1.7.2 and vSphere 7 update 1 and am getting the same message. The one difference I’ll add to yours is I noticed that DRS moves the VM while packer is working on it. I wonder if that process breaks the semaphore for Packer.

I’m still currently digging into my issue, but just wanted to see if you had an update here.

Hi that’s interesting. I actually ended up switching from ‘floppy_files’ to ‘cd_files’ which got around the issue - just had to download the windows server adk and add the location of oscdimg.exe to the system PATH env var

Hello!

I’m getting the same error. It used to work, but for some reason, it just stopped. I’m at packer 1.7.4. Were you guys able to resolve the issue? Thanks…

I also have this issue. It’s related to DRS switching from ESX host while packer is running. On my scenario it switched 3 times from esx host and last time it mentioned could not connect floppy because it’s being used by another virtual machine.