AsBuiltReport / AsBuiltReport.VMware.vSphere

Repository for AsBuiltReport VMware vSphere module
https://www.asbuiltreport.com
MIT License
110 stars 39 forks source link

Error in Image Profile section #109

Closed rebelinux closed 6 months ago

rebelinux commented 1 year ago

Describe the bug

New-AsBuiltReport: Message: EsxCLI.CLIFault.summary;
InnerText:  [InstallationError] Failed to initiate installer: Could not parse Vib xml from database /var/db/esximg: ('Unknown', 'Could not parse VIB XML data: None (line 0).')      cause = Could not parse Vib xml from database /var/db/esximg: ('Unknown', 'Could not parse VIB XML data: None (line 0).') Please refer to the log file for more details.EsxCLI.CLIFault.summary

To Reproduce Steps to reproduce the behavior:

  1. Run report with $InfoLevel.VMHost >= 3
  2. See error: OperationStopped: Message: EsxCLI.CLIFault.summary; InnerText: [InstallationError] Failed to initiate installer: Could not parse Vib xml from database /var/db/esximg: ('Unknown', 'Could not parse VIB XML data: None (line 0).') cause = Could not parse Vib xml from database /var/db/esximg: ('Unknown', 'Could not parse VIB XML data: None (line 0).') Please refer to the log file for more details.EsxCLI.CLIFault.summary
  3. Report never get generated.

Expected behavior

Screenshots If applicable, add screenshots to help explain your problem.

System (please provide the following information about the system from which you are trying to generate a report):

Additional context Add any other context about the problem here.

rebelinux commented 1 year ago

Code:

#region ESXi Host Image Profile Information
if ($UserRole.Privilege -contains 'Host.Config.Settings') {
    Section -Style Heading5 'Image Profile' {
        $installdate = Get-InstallDate
        $esxcli = Get-EsxCli -VMHost $VMHost -V2 -Server $vCenter
        $ImageProfile = $esxcli.software.profile.get.Invoke()
        $SecurityProfile = [PSCustomObject]@{
            'Image Profile' = $ImageProfile.Name
            'Vendor' = $ImageProfile.Vendor
            'Installation Date' = $InstallDate.InstallDate
        }
        $TableParams = @{
            Name = "Image Profile - $VMHost"
            #ColumnWidths = 50, 25, 25
        }
        if ($Report.ShowTableCaptions) {
            $TableParams['Caption'] = "- $($TableParams.Name)"
        }
        $SecurityProfile | Table @TableParams
    }
} else {
    Write-PScriboMessage "Insufficient user privileges to report ESXi host image profiles. Please ensure the user account has the 'Host > Configuration > Change settings' privilege assigned."
}
#endregion ESXi Host Image Profile Information
rebelinux commented 6 months ago

This issue was closed because I identified that it is related to problems with the Vibs database.