VMware Cloud Community
jburgh
Contributor
Contributor

Trying to Build Custom ESXi - getting error 'VMware.ImageBuilder.Impl.IfServer' threw an exception.

Hello, 

I am trying to build a custom ESXi for 6.0 to include RealTek driver.

First time PS user and have installed some modules, below is a list.

ModuleType Version    Name                                ExportedCommands

---------- -------    ----                                ----------------

Script     6.7.0.1... VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add ScriptBundle, Copy-DeployRule...}

Script     6.7.0.1... VMware.ImageBuilder         {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImageP...

Manifest   11.5.0.... VMware.PowerCLI

Script     6.7.0.1... VMware.Vim

Script     11.5.0.... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}

Script     11.0.0.... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}

Script     11.5.0.... VMware.VimAutomation.Common         {Get-Task, Stop-Task, Wait-Task}

Script     11.5.0.... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostN...

Script     11.5.0.... VMware.VimAutomation.Hcx         {Connect-HCXServer, Disconnect-HCXServer, Get-HCXAppliance, Get-HCXComputeProfile...}

Script     7.10.0.... VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}

Script     11.3.0.... VMware.VimAutomation.License        Get-LicenseDataManager

Script     11.5.0.... VMware.VimAutomation.Nsxt           {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtPolicyService, Get-NsxtService}

Script     11.5.0.... VMware.VimAutomation.Sdk            {Get-ErrorReport, Get-InstallPath, Get-PSVersion}

Script     11.0.0.... VMware.VimAutomation.Security       {Get-SecurityInfo, Get-VTpm, Get-VTpmCertificate, Get-VTpmCSR...}

Script     11.5.0.... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}

Script     11.5.0.... VMware.VimAutomation.Storage     {Add-KeyManagementServer, Add-VsanObjectToRepairQueue, Copy-VDisk, Export-SpbmStoragePol...

Script     1.3.0.0    VMware.VimAutomation.StorageUtility Update-VmfsDatastore

Script     11.2.0.... VMware.VimAutomation.Vds     {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSw...

Script     11.5.0.... VMware.VimAutomation.Vmc            {Add-VmcSddcHost, Connect-Vmc, Disconnect-Vmc, Get-AwsAccount...}

Script     10.0.0.... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}

Script     6.5.1.7... VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}

 

PowerCLI Version

----------------

   VMware PowerCLI 11.5.0 build 14912921

---------------

Component Versions

---------------

   VMware Common PowerCLI Component 11.5 build 14898112

   VMware Cis Core PowerCLI Component PowerCLI Component 11.5 build 14898113

   VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 11.5 build 14899560

   VMWare ImageBuilder PowerCLI Component 6.7 build 11233116

 

Running this command results in an error

> .\ESXi-Customizer-PS-v2.6.0.ps1 -v60 -vft -load net55-r8168

 

This is ESXi-Customizer-PS Version 2.6.0 (visit https://ESXi-Customizer-PS.v-front.de for more information!)

(Call with -help for instructions)

(lines removed)

Running with PowerShell version 5.1 and VMware PowerCLI version 11.5.0.14899560

Connecting the VMware ESXi Online depot ...

An unexpected error occured:

The type initializer for 'VMware.ImageBuilder.Impl.IfServer' threw an exception.

 

I have been searching to find a possible solution to the above error but haven’t found anything specific yet.

 

The logfile has the following

**********************

Windows PowerShell transcript start

Start time: 20200227082051

Username: DESKTOP-0HSFGP0\jayma

RunAs User: DESKTOP-0HSFGP0\jayma

Configuration Name: 

Machine: DESKTOP-0HSFGP0 (Microsoft Windows NT 10.0.18362.0)

Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Process ID: 7320

PSVersion: 5.1.18362.628

PSEdition: Desktop

PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.18362.628

BuildVersion: 10.0.18362.628

CLRVersion: 4.0.30319.42000

WSManStackVersion: 3.0

PSRemotingProtocolVersion: 2.3

SerializationVersion: 1.1.0.1

**********************

 

Running with PowerShell version 5.1 and VMware PowerCLI version 11.5.0.14899560

 

Connecting the VMware ESXi Online depot ...

PS>TerminatingError(Add-EsxSoftwareDepot): "The type initializer for 'VMware.ImageBuilder.Impl.IfServer' threw an exception."

 

 

An unexpected error occured:

The type initializer for 'VMware.ImageBuilder.Impl.IfServer' threw an exception.

 

If requesting support please be sure to include the log file

   C:\Users\jayma\AppData\Local\Temp\ESXi-Customizer-PS-7320.log

**********************

Windows PowerShell transcript end

End time: 20200227082051

**********************

 
Any help is appreciated, Thanks J
 
**********************
Windows PowerShell transcript start
Start time: 20200227082051
Username: DESKTOP-0HSFGP0\jayma
RunAs User: DESKTOP-0HSFGP0\jayma
Configuration Name: 
Machine: DESKTOP-0HSFGP0 (Microsoft Windows NT 10.0.18362.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Process ID: 7320
PSVersion: 5.1.18362.628
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.18362.628
BuildVersion: 10.0.18362.628
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
 
Running with PowerShell version 5.1 and VMware PowerCLI version 11.5.0.14899560
 
Connecting the VMware ESXi Online depot ...
PS>TerminatingError(Add-EsxSoftwareDepot): "The type initializer for 'VMware.ImageBuilder.Impl.IfServer' threw an exception."
 
 
An unexpected error occured:
The type initializer for 'VMware.ImageBuilder.Impl.IfServer' threw an exception.
 
If requesting support please be sure to include the log file
   C:\Users\jayma\AppData\Local\Temp\ESXi-Customizer-PS-7320.log
**********************
Windows PowerShell transcript end
End time: 20200227082051
**********************
Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

There have been a few mentions of this same exception with the Add-EsxSoftwareDepot cmdlet.

But in none of these cases there were any clear solutions.

Some were caused by network issues when trying to reach the depot, others were fixed after a reinstall of PowerCLI.

You have a couple of options:

- contact the creator of the script you are using. Perhaps he has a better solution for this issue

- open a SR


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos