Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vSAN 8 ESA - "VsanDiskGroup" is empty #113

Open
mpacholke opened this issue Oct 20, 2023 · 10 comments
Open

vSAN 8 ESA - "VsanDiskGroup" is empty #113

mpacholke opened this issue Oct 20, 2023 · 10 comments
Labels
in progress Assignee is currently focusing on this issue

Comments

@mpacholke
Copy link

mpacholke commented Oct 20, 2023

vSAN 8 ESA has no disk groups anymore. The argument is NULL or empty

Perhaps you can skip the vSAN disk group information in the script ?

Update:

Test with the RC run into the same error:

ModuleType Version Name ExportedCommands


Script 1.3.4 AsBuiltReport.VMware.vSphere Invoke-AsBuiltReport.VMware.vSphere

New-AsBuiltReport : The argument for the VsanDiskGroup parameter cannot be verified. The argument is NULL or empty. Provide an argument that is not NULL or empty, and
run the command again.
In line:1 character:1

  • New-AsBuiltReport -Report VMware.vSphere -Target myvc.local ...
 + CategoryInfo : NotSpecified: (:) [Write Error], WriteErrorException
 + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport

ESXi 8.0.2 Build 22380479
vCenter 8.0.2 Build 22385739

Name Value


PSVersion 5.1.19041.3693
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.3693
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

PowerCLI Version

VMware.PowerCLI 13.2.1 build 22851661

Component Versions

VMware Common PowerCLI Component 13.2 build 22643733
VMware Cis Core PowerCLI Component PowerCLI Component 13.2 build 22643734
VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 13.2 build 22643732
VMware VimAutomation Storage PowerCLI Component PowerCLI Component 13.2 build 22643728
VMware VimAutomation Vds Commands PowerCLI Component PowerCLI Component 13.1 build 21610933

@tpcarman tpcarman added the help wanted Extra attention is needed label Dec 1, 2023
@tpcarman tpcarman added in progress Assignee is currently focusing on this issue and removed help wanted Extra attention is needed labels Feb 28, 2024
@baukeplugge
Copy link

Same issue here.

got it working with some tweaks:

added an extra line to $VsanClusterInfo

'vSAN ESA Enabled' = Switch ($VsanCluster.VsanEsaEnabled) {
                                            $true { 'Yes' }
                                            $false { 'No' } 
                                        }

in the vsanclusters loop I excluded the OSA disk details

if (!($VsanCluster.VsanEsaEnabled -eq $true)){
$VsanDiskGroup = Get-VsanDiskGroup -Cluster $VsanCluster.Cluster
$NumVsanDiskGroup = $VsanDiskGroup.Count
$VsanDisk = Get-VsanDisk -VsanDiskGroup $VsanDiskGroup
$VsanDiskFormat = $VsanDisk.DiskFormatVersion | Select-Object -First 1 -Unique
$NumVsanSsd = ($VsanDisk | Where-Object { $_.IsSsd -eq $true }).Count
$NumVsanHdd = ($VsanDisk | Where-Object { $_.IsSsd -eq $false }).Count
if ($NumVsanHdd -gt 0) {
$VsanClusterType = "Hybrid"
} else {
$VsanClusterType = "All Flash"
}
} else {
$VsanClusterType = "All Flash (NVMe)"
}

I removed these 3 lines from the clusterdetail object and added them only if there is no ESA

if (!($VsanCluster.VsanEsaEnabled -eq $true)){
$VsanClusterDetail | Add-Member -MemberType NoteProperty -name 'Disk Format Version' -value $VsanDiskFormat
$VsanClusterDetail | Add-Member -MemberType NoteProperty -name 'Total Number of Disks' -value $NumVsanSsd + $NumVsanHdd
$VsanClusterDetail | Add-Member -MemberType NoteProperty -name 'Total Number of Disk Groups' -value $NumVsanDiskGroup
}

lastly I excluded the whole section disk groups and disks. These are depended on the diskgroup which do no exist anymore

if (!($VsanCluster.VsanEsaEnabled -eq $true)){
.....
}

for the exclusion.

the result is that the report is created only the ESA lines are not included in the report yet.

@tpcarman
Copy link
Contributor

I have this coded already, however I got distracted while testing it in a few environments. I'll aim to push this up to the repo over the Easter weekend and you can test it further.

@tpcarman tpcarman mentioned this issue Mar 28, 2024
7 tasks
@mpacholke
Copy link
Author

Are you sure that it is fixed?

DETAILED: [ 14:41:03:404 ] [ Document ] - Processing paragraph 'The following sections detail the co[..]'.
VERBOSE: [ 14:41:03:407 ] [ Document ] - Processing section 'vsan-cluster' started.
New-AsBuiltReport : The argument for the VsanDiskGroup parameter cannot be verified. The argument is NULL or empty. Provide an argument that is not NULL or empty and run the command
again.
In line:1 character:1

  • New-AsBuiltReport -Report VMware.vSphere -Target vc.local ...
  •   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport
    
    
    

I have to mention that i installed a prerelease version while we tested in the last month:

Version Name Repository Description


1.4.0 AsBuiltReport.Core PSGallery A PowerShell module which provides the core framework for generating As-Built documentation ...
1.3.4-rc1 AsBuiltReport.VMware.vSphere PSGallery A PowerShell module to generate an as built report on the configuration of VMware vSphere

The update with the --force gives no errors but am not sure if the correct module is active now

WARNUNG: [ 14:52:25:303 ] [ Module ] - AsBuiltReport.VMware.vSphere 1.3.4.1 is currently installed.

To be sure i need to uninstall the prerelease and install from scratch but i get this error:

PackageManagement\Uninstall-Package : The module 'AsBuiltReport.VMware.vSphere' of version '1.3.4-rc1' in module base folder 'C:\Program
Files\WindowsPowerShell\Modules\AsBuiltReport.VMware.vSphere\1.3.4' was installed without side-by-side version support. Some versions are installed in this module base with
side-by-side version support. Uninstall other versions of this module before uninstalling the most current version.
In C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:12733 Zeichen:21

  • ... $null = PackageManagement\Uninstall-Package @PSBoundParameters
  •                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninstall-Package], Exception
    • FullyQualifiedErrorId : UnableToUninstallModuleVersion,Uninstall-Package,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

@mpacholke
Copy link
Author

Update:
i was able to remove all installed versions and reinstall the actual module:

ModuleType Version Name ExportedCommands


Script 1.3.4.1 AsBuiltReport.VMware.vSphere Invoke-AsBuiltReport.VMware.vSphere

The error remains:

New-AsBuiltReport : The argument for the VsanDiskGroup parameter cannot be verified. The argument is NULL or empty. Provide an argument that is not NULL or empty and run the command again.
In line:1 character:1

@tpcarman
Copy link
Contributor

tpcarman commented Apr 3, 2024

@mpacholke Can you please provide a verbose output or screenshot of where it is failing?

@mpacholke
Copy link
Author

image

It is a german windows jump host

@tpcarman
Copy link
Contributor

tpcarman commented Apr 4, 2024

What vSphere & VSAN version are you using?

What is the VSAN InfoLevel configured for within the report configuration JSON?

@tpcarman tpcarman reopened this Apr 4, 2024
@mpacholke
Copy link
Author

mpacholke commented Apr 5, 2024

Here the versions and info's:

ESXi
8.0.2 23305546

vCenter :
Version Build


8.0.2 23319993

"InfoLevel": {
"comment": "0 = Disabled, 1 = Enabled / Summary, 2 = Adv Summary, 3 = Detailed, 4 = Adv Detailed, 5 = Comprehensive",
"vCenter": 3,
"Cluster": 3,
"ResourcePool": 3,
"VMHost": 3,
"Network": 3,
"vSAN": 3,
"Datastore": 3,
"DSCluster": 3,
"VM": 2,
"VUM": 3

I varied the setting for vSAN to 1 and 0 but the error remains

@tpcarman
Copy link
Contributor

tpcarman commented Apr 7, 2024

Can you please provide further information about your VSAN cluster? Is it ESA or OSA? Hybrid or SSD?

Try and run this and share the output file.

$VcenterServer = "Your vCenter Server name"
$VsanCluster = "Your VSAN cluster name"


$vccreds = Get-Credential
$vcenter = connect-viserver $VcenterServer -Credential $vccreds

# Set verbose and debug preferences
$global:VerbosePreference = 'Continue'
$global:DebugPreference = 'Continue'

Start-Transcript -Path .\Output.log

$VsanCluster = Get-VsanClusterConfiguration -Cluster $VsanCluster -Server $vCenter | Where-Object { $_.vsanenabled -eq $true }

if ($VsanCluster) {
    if ($VsanCluster.VsanEsaEnabled) {
        $VsanStoragePoolDisk = Get-VsanStoragePoolDisk -Cluster $VsanCluster.Cluster
        $VsanDiskFormat = $VsanStoragePoolDisk.DiskFormatVersion | Select-Object -First 1 -Unique
        $VsanClusterDetail = [PSCustomObject]@{
            'Cluster' = $VsanCluster.Name
            'ID' = $VsanCluster.Id
            'vSAN Type' = Switch ($VsanCluster.VsanEsaEnabled) {
                $true { 'vSAN ESA' }
                $null { 'vSAN OSA' }
            }
            'Stretched Cluster' = Switch ($VsanCluster.StretchedClusterEnabled) {
                $true { 'Yes' }
                $false { 'No' }
            }
            'Number of Hosts' = $VsanCluster.Cluster.ExtensionData.Host.Count
            'Number of Disks' = $VsanStoragePoolDisk.Count
            'Disk Claim Mode' = $VsanCluster.VsanDiskClaimMode
            'Disk Format Version' = $VsanDiskFormat
            'Deduplication & Compression' = Switch ($VsanCluster.SpaceEfficiencyEnabled) {
                $true { 'Enabled' }
                $false { 'Disabled' }
                $null { 'Disabled' }
            }
            'Encryption' = Switch ($VsanCluster.EncryptionEnabled) {
                $true { 'Enabled' }
                $false { 'Disabled' }
                $null { 'Disabled' }
            }
            'Health Check' = Switch ($VsanCluster.HealthCheckEnabled) {
                $true { 'Enabled' }
                $false { 'Disabled' }
                $null { 'Disabled' }
            }
            'HCL Last Updated' = $VsanCluster.TimeOfHclUpdate
        }
    } else {
        $VsanDiskGroup = Get-VsanDiskGroup -Cluster $VsanCluster.Cluster
        $NumVsanDiskGroup = $VsanDiskGroup.Count
        $VsanDisk = Get-VsanDisk -VsanDiskGroup $VsanDiskGroup
        $VsanDiskFormat = $VsanDisk.DiskFormatVersion | Select-Object -First 1 -Unique
        $NumVsanSsd = ($VsanDisk | Where-Object { $_.IsSsd -eq $true }).Count
        $NumVsanHdd = ($VsanDisk | Where-Object { $_.IsSsd -eq $false }).Count
        if ($NumVsanHdd -gt 0) {
            $VsanClusterType = "Hybrid"
        } else {
            $VsanClusterType = "All Flash"
        }
        $VsanClusterDetail = [PSCustomObject]@{
            'Cluster' = $VsanCluster.Name
            'ID' = $VsanCluster.Id
            'vSAN Type' = Switch ($VsanCluster.VsanEsaEnabled) {
                $true { 'vSAN ESA' }
                $null { 'vSAN OSA' }
            }
            'Storage Type' = $VsanClusterType
            'Stretched Cluster' = Switch ($VsanCluster.StretchedClusterEnabled) {
                $true { 'Yes' }
                $false { 'No' }
            }
            'Number of Hosts' = $VsanCluster.Cluster.ExtensionData.Host.Count
            'Number of Disks' = $NumVsanSsd + $NumVsanHdd
            'Number of Disk Groups' = $NumVsanDiskGroup
            'Disk Claim Mode' = $VsanCluster.VsanDiskClaimMode
            'Disk Format Version' = $VsanDiskFormat
            'Deduplication & Compression' = Switch ($VsanCluster.SpaceEfficiencyEnabled) {
                $true { 'Enabled' }
                $false { 'Disabled' }
                $null { 'Disabled' }
            }
            'Encryption' = Switch ($VsanCluster.EncryptionEnabled) {
                $true { 'Enabled' }
                $false { 'Disabled' }
                $null { 'Disabled' }
            }
            'Health Check' = Switch ($VsanCluster.HealthCheckEnabled) {
                $true { 'Enabled' }
                $false { 'Disabled' }
                $null { 'Disabled' }
            }
            'HCL Last Updated' = $VsanCluster.TimeOfHclUpdate
        }
        Write-Output $VsanClusterDetail | fl
    }
} else {
    Write-Error -Message "VSAN cluster not found!"
}

Stop-Transcript

# Reset verbose and debug preferences
$global:VerbosePreference = 'SilentlyContinue'
$global:DebugPreference = 'SilentlyContinue'

@mpacholke
Copy link
Author

Hi sorry for the delay. I only have access to the customer site at dedicated time frames. This is a vSAN ESA (all-nvme) cluster.

image

I have to anonymize some data:

cat .\Output.log


Start der Windows PowerShell-Aufzeichnung
Startzeit: 20240422171639
Benutzername: mydom\Administrator
RunAs-Benutzer: mydom\Administrator
Konfigurationsname:
Computer: ws1 (Microsoft Windows NT 10.0.19045.0)
Hostanwendung: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command try { . "c:\Users\Administrator.mydom\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1" } catch {}
Prozess-ID: 9556
PSVersion: 5.1.19041.4291
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.4291
BuildVersion: 10.0.19041.4291
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1


Die Aufzeichnung wurde gestartet. Die Ausgabedatei ist ".\Output.log".
AUSFÜHRLICH: 22.04.2024 17:16:39 Get-VsanClusterConfiguration Finished execution
AUSFÜHRLICH: 22.04.2024 17:16:43 Get-VsanStoragePoolDisk Finished execution


Ende der Windows PowerShell-Aufzeichnung
Endzeit: 20240422171643
****************@

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Assignee is currently focusing on this issue
Projects
None yet
Development

No branches or pull requests

3 participants