Skip to content

Instantly share code, notes, and snippets.

@gspivey
Created December 3, 2021 07:21
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gspivey/69b5c12962e00bf85c9cfdc954ad13f6 to your computer and use it in GitHub Desktop.
Save gspivey/69b5c12962e00bf85c9cfdc954ad13f6 to your computer and use it in GitHub Desktop.
Parameterized steps for creating a fling ISO for ESXi

Parameterized steps for creating a fling ISO for ESXi

Powershell Permissions

List Execution Policies Get-ExecutionPolicy -List Set Excecution Policy (Requires Running terminal as Admministrator) Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine Return Excecution Policy (Requires Running terminal as Admministrator) Set-ExecutionPolicy -ExecutionPolicy Restricted -Scope LocalMachine

What your command promt will say if you do not have the correct permissions

PS C:\Users\<yourUser>> Import-Module VMware.ImageBuilder
Import-Module : File
C:\Users\<yourUser>\Documents\WindowsPowerShell\Modules\VMware.VimAutomation.Sdk\12.2.0.17531155\VMware.VimAutomation.Sdk.psm1 cannot
be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module VMware.ImageBuilder
+ ~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand

Install VMware Image Builder to Powershell Terminal

Import-Module VMware.ImageBuilder
Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
Install-Module -Name VMWare.PowerCLI -Scope CurrentUser

Build Fling ISO

Show all Downloadable Profiles

Get-EsxImageProfile

Download Image Profile

Export-ESXImageProfile -ImageProfile "<profile from get image profile>" -ExportToBundle -filepath <filename> Ex: Export-ESXImageProfile -ImageProfile "ESXi-7.0U2d-18538813-standard" -ExportToBundle -filepath ESXi-7.0U2d-18538813-standard.zip

Add Downloaded Image Profile to the Powershell Software Depot

Add-EsxSoftwareDepot <created zip filename> Ex: Add-EsxSoftwareDepot .\ESXi-7.0U2d-18538813-standard.zip

Add the Zip of the fling you downloaded to the Powershell Software Depot

Add-EsxSoftwareDepot <path to downloaded ZIP> Ex: Add-EsxSoftwareDepot .\ESXi700-VMKUSB-NIC-FLING-34491022-component-15873236.zip Ex: Add-EsxSoftwareDepot .\Net-Community-Driver_1.2.0.0-1vmw.700.1.0.15843807_18028830.zip

Clone the profile to a new one that we will modify

New-EsxImageProfile -CloneProfile "<downloaded image profile name>" -name "<name of new profile>" -Vendor "<whatever vendor name you want>" Ex: New-EsxImageProfile -CloneProfile "ESXi-7.0.0-15843807-standard" -name "ESXi-7.0.0-15843807-USBNIC" -Vendor "virten.net" Ex: New-EsxImageProfile -CloneProfile "ESXi-7.0U2d-18538813-standard" -name "ESXi-7.0U2d-18538813-standard-CommunityNics" -Vendor "Curious Tech"

Add Software Package from fling to your custom image profile

Example relative path inside the zip that has the Software Package name

<opened zip file>\metadata\vibs\<software package name>--<numbers>.xml Ex: Net-Community-Driver_1.2.0.0-1vmw.700.1.0.15843807_18028830\metadata.zip\vib\net-community--1173369167022138283.xml

Add Software Package using located name

Add-EsxSoftwarePackage -ImageProfile "<your image profile>" -SoftwarePackage "<software package name>" Ex: Add-EsxSoftwarePackage -ImageProfile "ESXi-7.0U2d-18538813-standard-CommunityNics" -SoftwarePackage "net-community"

Export your custom ISO

Export-ESXImageProfile -ImageProfile "<your image profile>" -ExportToIso -filepath <user created name of ISO> Ex: Export-ESXImageProfile -ImageProfile "ESXi-7.0.0-15843807-USBNIC" -ExportToIso -filepath ESXi-7.0.0-15843807-USBNIC.iso Ex: Export-ESXImageProfile -ImageProfile "ESXi-7.0U2d-18538813-standard-CommunityNics" -ExportToIso -filepath ESXi-7.0U2d-18538813-standard-CommunityNics.iso

Export your custom Image Profile as a ZIP

Export-ESXImageProfile -ImageProfile "<your image profile>" -ExportToBundle -filepath <user created name of ZIP> Export-ESXImageProfile -ImageProfile "ESXi-7.0.0-15843807-USBNIC" -ExportToBundle -filepath ESXi-7.0.0-15843807-USBNIC.zip Export-ESXImageProfile -ImageProfile "ESXi-7.0U2d-18538813-standard-CommunityNics" -ExportToBundle -filepath ESXi-7.0U2d-18538813-standard-CommunityNics.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment