An issue that I ran into after upgrading to the latest PowerCLI 13.0 release after it GA'ed was attempting to export an ESXi image profile that I had created to an ISO file using the Export-EsxImageProfile cmdlet and immediately hit the following error:
Export-EsxImageProfile: Error retrieving file for VIB 'VMware_bootbank_esx-update_8.0.0-1.0.20513097': ('vib20/esx-update/VMware_bootbank_esx-update_8.0.0-1.0.20513097.vib', "Unable to open VIB archive in streaming mode: '_SharedFile' object has no attribute 'writing'").
I am an avid use of this cmdlet and have never ran into this issue before and I was not sure if this could be related to the porting of the Image Builder and Auto Deploy cmdlets to PowerShell Core, which was new with the PowerCLI 13.0 release. I have already filed an internal bug and the PowerCLI Engineering team have not had a chance to look at it, but over the past week, I have noticed a number of reports on my blog, VMTN community forums, Reddit and Twitter that other users were also hitting this issue.
As I have already responded in a few of these channels already, a bug has been filed and there is currently not a work around that I am aware of. As I have any updates, I will update this article with more details.
UPDATE - Several readers have informed me that if you update to Python 3.7.9 or greater, the issue should go away.
The options right now is to either use the vSphere Image Builder UI OR vSphere Lifecycle Manager (vLCM) UI or the new vLCM PowerCLI cmdlets, both of which requiring a vCenter Server running vSphere 8.0.
parambil says
Hope to have fix soon for this
ucorsu says
Thank you for your post, ithought i was alone with that !
Look forward for good news soon i hope... no Vsphere 8 here....
My homelab cant wait 🙂
stephen says
Spent around 3 hours before I found out this was a stupid bug... thank you. I hope this fixed. Cant figure out how to get intel i226 drivers on any esxi without having vserver.
Vaughn says
In the same spot trying to build the iso for my nuc. Hope to see a fix soon, thanks for what you do William!
Vaughn says
I rolled back powercli to 12.7 and was able to make it work that way.
111111 says
Seems like a Python issue: https://bugs.python.org/issue34035
I got the same error, resolved by installing Python 3.7.9
mrtech2020 says
Thanks for this suggestion. I was looking for a tip in what's causing this error. 👍
222222 says
This fixed the issue for me too. Successfully created a custom 8.0 image. Thank you!
Marty The Party says
I finally got ESXi 8.0 running with a Startech USB31000S (after many hours scouring blog comments!).
This allowed me to generate an ISO for ESXi 8.0 with Fling drivers. I hope this helps others:
Prereqs:
1. Python 3.7.9 (not 3.7) - refer https://williamlam.com/2022/11/heads-up-unable-to-open-vib-archive-in-streaming-mode-using-export-esximageprofile-with-powercli-13-0.html
2. PowerCLI 13.0
Helpful links:
https://gist.github.com/gspivey/69b5c12962e00bf85c9cfdc954ad13f6
https://www.virten.net/2020/04/how-to-add-the-usb-nic-fling-to-esxi-7-0-base-image/
PowerShell Dump:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\WINDOWS\system32> cd 'D:\ESXi Images\ESXi Fling ISO\'
PS D:\ESXi Images\ESXi Fling ISO> Add-EsxSoftwareDepot .\ESXi-8.0.0-20513097-standard.zip
WARNING: Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a
better product. You can join using the following command:
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true
VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to
improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As
part of the CEIP, VMware collects technical information about your organization’s use of VMware products and services
on a regular basis in association with your organization’s VMware license key(s). This information does not
personally identify any individual.
For more details: type "help about_ceip" to see the related help article.
To disable this warning and set your preference use the following command and restart PowerShell:
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false.
Depot Url
---------
zip:D:\ESXi Images\ESXi Fling ISO\ESXi-8.0.0-20513097-standard.zip?index.xml
PS D:\ESXi Images\ESXi Fling ISO> Add-EsxSoftwareDepot .\ESXi800-VMKUSB-NIC-FLING-61054763-component-20826251.zip
Depot Url
---------
zip:D:\ESXi Images\ESXi Fling ISO\ESXi800-VMKUSB-NIC-FLING-61054763-component-20826251.zip?index.xml
PS D:\ESXi Images\ESXi Fling ISO> New-EsxImageProfile -CloneProfile "ESXi-8.0.0-20513097-standard" -name "ESXi-8.0.0-20513097-standard-USBNIC" -Vendor "VMW"
Name Vendor Last Modified Acceptance Level
---- ------ ------------- ----------------
ESXi-8.0.0-20513097-standar... VMW 23/09/2022 6... PartnerSupported
PS D:\ESXi Images\ESXi Fling ISO> Add-EsxSoftwarePackage -ImageProfile "ESXi-8.0.0-20513097-standard-USBNIC" -softwarePackage "vmkusb-nic-fling"
Name Vendor Last Modified Acceptance Level
---- ------ ------------- ----------------
ESXi-8.0.0-20513097-standar... VMW 28/12/2022 8... PartnerSupported
PS D:\ESXi Images\ESXi Fling ISO> Export-ESXImageProfile -ImageProfile "ESXi-8.0.0-20513097-standard-USBNIC" -ExportToIso -filepath ESXi-8.0.0-20513097-standard-USBNIC.iso -force -NoSignatureCheck
PS D:\ESXi Images\ESXi Fling ISO>
Aaron says
Thanks to everyone for sharing helpful comments and the Python PR. To resolve this, I was able to replace the file lib/zipfile.py from my python install folder with the same file from a newer python 3.7.9+ build and restart my PowerCLI session. Hope that brings about a quick fix for some one else.