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 · 21 comments
Open

vSAN 8 ESA - "VsanDiskGroup" is empty #113

mpacholke opened this issue Oct 20, 2023 · 21 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
****************@

@mpacholke
Copy link
Author

i run the script again and after some errors i got this tail . I removed all personal information:


nStart der Windows PowerShell-Aufzeichnung
Startzeit: 20240725191638

Konfigurationsname:
Computer: SP77205NB-1218 (Microsoft Windows NT 10.0.19045.0)
Hostanwendung: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2024.2.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2024.2.2' -BundledModulesPath 'c:\Users\Administrator.vscode\extensions\ms-vscode.powershell-2024.2.2\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2024.2.2
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Normal' -LogPath 'c:\Users\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1721927401-44981674-1f94-49d9-9e8a-f688390390fc1721926883641' -SessionDetailsPath 'c:\Users\Administrator\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-5244-395128.json' -FeatureFlags @()
Prozess-ID: 5800
PSVersion: 5.1.19041.4522
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.4522
BuildVersion: 10.0.19041.4522
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".
PS>TerminatingError(Get-VsanClusterConfiguration): "Das Argument für den Parameter "Server" kann nicht überprüft werden. Das Argument ist NULL oder leer. Geben Sie ein Argument an, das nicht NULL oder leer ist, und führen Sie den Befehl erneut aus."
Get-VsanClusterConfiguration : Das Argument für den Parameter "Server" kann nicht überprüft werden. Das Argument ist
NULL oder leer. Geben Sie ein Argument an, das nicht NULL oder leer ist, und führen Sie den Befehl erneut aus.
In \code\test-asbuilt.ps1:14 Zeichen:75

  • ... anClusterConfiguration -Cluster $VsanCluster -Server $vCenter | Where ...
  •                                                      ~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-VsanClusterConfiguration], ParameterBindingValidationException
    • FullyQualifiedErrorId :
      ParameterArgumentValidationError,VMware.VimAutomation.Storage.Commands.Cmdlets.Vsan.GetVsanClusterConfiguration
      Get-VsanClusterConfiguration : Das Argument für den Parameter "Server" kann nicht überprüft werden. Das Argument ist NULL oder
      leer. Geben Sie ein Argument an, das nicht NULL oder leer ist, und führen Sie den Befehl erneut aus.
      In \code\test-asbuilt.ps1:14 Zeichen:75
  • ... anClusterConfiguration -Cluster $VsanCluster -Server $vCenter | Where ...
  •                                                      ~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-VsanClusterConfiguration], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.Storage.Commands.Cmdlets.Vsan.GetVsanClusterC
      onfiguration

AUSFÜHRLICH: 25.07.2024 19:16:42 Get-VsanDiskGroup Finished execution
PS>TerminatingError(Get-VsanDisk): "Das Argument für den Parameter "VsanDiskGroup" kann nicht überprüft werden. Das Argument ist NULL oder leer. Geben Sie ein Argument an, das nicht NULL oder leer ist, und führen Sie den Befehl erneut aus."
Get-VsanDisk : Das Argument für den Parameter "VsanDiskGroup" kann nicht überprüft werden. Das Argument ist NULL oder
leer. Geben Sie ein Argument an, das nicht NULL oder leer ist, und führen Sie den Befehl erneut aus.
In \code\test-asbuilt.ps1:55 Zeichen:49

  •     $VsanDisk = Get-VsanDisk -VsanDiskGroup $VsanDiskGroup
    
  •                                             ~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-VsanDisk], ParameterBindingValidationException
    • FullyQualifiedErrorId :
      ParameterArgumentValidationError,VMware.VimAutomation.Storage.Commands.Cmdlets.Vsan.GetVsanDisk
      Get-VsanDisk : Das Argument für den Parameter "VsanDiskGroup" kann nicht überprüft werden. Das Argument ist NULL oder leer. Geben
      Sie ein Argument an, das nicht NULL oder leer ist, und führen Sie den Befehl erneut aus.
      In\code\test-asbuilt.ps1:55 Zeichen:49
  •     $VsanDisk = Get-VsanDisk -VsanDiskGroup $VsanDiskGroup
    
  •                                             ~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-VsanDisk], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.Storage.Commands.Cmdlets.Vsan.GetVsanDisk

Cluster :
ID :
vSAN Type : vSAN OSA
Storage Type : All Flash
Stretched Cluster :
Number of Hosts : 0
Number of Disks : 0
Number of Disk Groups : 0
Disk Claim Mode :
Disk Format Version :
Deduplication & Compression : Disabled
Encryption : Disabled
Health Check : Disabled
HCL Last Updated :


Ende der Windows PowerShell-Aufzeichnung
Endzeit: 20240725191642


@mpacholke
Copy link
Author

Hi,
if the request of ESA information is not possible it would be helpful to exclude it until the issue is fixed.

@baukeplugge
Copy link

Hi, if the request of ESA information is not possible it would be helpful to exclude it until the issue is fixed.

I have run the script a week ago in a ESA environment. And that ran succesfully. you could try my earlier suggestion to bypass the diskgroup check.

@tpcarman
Copy link
Contributor

tpcarman commented Oct 2, 2024

Lets simplify this check, could you please report the output of the following.

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


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

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

$VsanCluster.VsanEsaEnabled

Could you also provide the output of the following?

Get-Module -ListAvailable -Name @("VMware.PowerCLI","AsBuiltReport.Core","AsBuiltReport.VMware.vSphere") | Select-Object Name,Version

@mpacholke
Copy link
Author

mpacholke commented Oct 4, 2024

Hi ,

the result is true.

PS C:\Users\Administrator> $VsanCluster.VsanEsaEnabled
True

Name Version


AsBuiltReport.Core 1.4.0
AsBuiltReport.Core 1.3.0
AsBuiltReport.VMware.vSphere 1.3.4.1
VMware.PowerCLI 13.2.1.22851661
VMware.PowerCLI 13.1.0.21624340

@mpacholke
Copy link
Author

Hi, if the request of ESA information is not possible it would be helpful to exclude it until the issue is fixed.

I have run the script a week ago in a ESA environment. And that ran succesfully. you could try my earlier suggestion to bypass the diskgroup check.

Yes, i tested it last week and it works. I have a nearly complete report - thanks for your advice.

@mpacholke
Copy link
Author

General enhancement:
When you call the driver and firmware information it would be very helpful to add VID, DID, SVID and SSID of the hardware. This is the point where the connection to the VMware HCL is located. This would help every vSAN administrator to validate the installed versions.

@tpcarman
Copy link
Contributor

VID, DID, SVID and SSID

Please raise this as a separate feature request

@tpcarman
Copy link
Contributor

Hi, if the request of ESA information is not possible it would be helpful to exclude it until the issue is fixed.

I have run the script a week ago in a ESA environment. And that ran succesfully. you could try my earlier suggestion to bypass the diskgroup check.

Did you successfully test this using v1.3.4.1, or did you use your modified script?

@mpacholke
Copy link
Author

I used the modified script

@tpcarman
Copy link
Contributor

You might be in luck. I will be working on a customer project in January deploying multiple vSAN ESA clusters so I will have an opportunity to look at this properly then.

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