lamw / vmware-scripts

Various scripts for VMware based solutions
http://www.williamlam.com/
BSD 2-Clause "Simplified" License
857 stars 489 forks source link

create_custom_esxi_iso.ps1: Incompatible with bundle containing multiple versions #117

Open jellybean13 opened 2 years ago

jellybean13 commented 2 years ago

Could not create ISO file with drivers integrated. Affected version: VMware ESXi 7.0U3d. spec JSON: { "base_image": { "version": [ "7.0.3-0.35.19482537", "7.0.3-0.30.19482531" ] }, "components": { "Net-Community-Driver": "1.2.7.0-1vmw.700.1.0.15843807" } }

image image

jellybean13 commented 2 years ago

After debugging, the problem is that the value of "version" in a spec JSON file is String rather than set. In other words, using a bundle containing multiple versions such as VMware ESXi 7.0U3d ("7.0.3-0.35.19482537", "7.0.3-0.30.19482531") will encounter an error owing to invalid data type.

Workaround method:

  1. Execute "create_custom_esxi_iso.ps1". It ends with errors.
  2. Modify spec JSON file. Select a version in this file, and make sure the type of "version" is String. Example: { "base_image": { "version": "7.0.3-0.35.19482537" }, "components": { "Net-Community-Driver": "1.2.7.0-1vmw.700.1.0.15843807" } }
  3. Comment the following codes in "create_custom_esxi_iso.ps1" to disable spec JSON file auto-generation. image
  4. Execute "create_custom_esxi_iso.ps1" again, a custom ISO file will be successfully generated.
frank1119 commented 2 years ago

I think replacing

$ESXIBaseImageVersion = (Get-DepotBaseImages -Depot $ESXIBaseImagePath).Version

with

$ESXIBaseImageVersion = (Get-DepotBaseImages -Depot $ESXIBaseImagePath).Version | select -first 1

might be sufficient?

Update: I see somebody else created already a pull request for this issue...

eng-rsalha commented 2 years ago

Hello everyone, i used the script and modified the multiple versions error above to be single one as a string under "VMware-ESXi-7.0U3f-20036589-depot.zip" the latest one right now.. but another error message appears: ( New-IsoImage : For "msg" expected type str, but got tuple )

image

any help guys.. appreciated.

eng-rsalha commented 2 years ago

@lamw @jellybean13 @jthat @frank1119