Close Menu
DPC Virtual Tips
    Read More

    How to Troubleshoot Packet Drops on an ESXi Host

    August 16, 2026

    SlurmDBD Is Down: What Continues Working and What Does Not

    August 15, 2026

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    August 14, 2026
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Tuesday, August 25
    DPC Virtual Tips
    • Home
    • Operating Systems
    • PowerFlex
    • HPC
    • Virtualization
    • About the Author
    • About Us
    • Contact
    DPC Virtual Tips
    Home » Getting Useful vSAN Details with PowerCLI
    Virtualization

    Getting Useful vSAN Details with PowerCLI

    DaniloBy DaniloAugust 15, 2024Updated:August 5, 2026No Comments4 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    vSAN PowerCLI commands
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Getting Useful vSAN Details with PowerCLI aims to get useful vSAN details or information in a vSAN-enabled cluster.

    Powershell is a powerful tool embedded in the majority of Windows installations. VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell. It provides more than 800 cmdlets for managing and automating VMware vSphere, VMware Cloud Director, vRealize Operations Manager, vSAN, VMware NSX-T Data Center, VMware Cloud Services, VMware Cloud on AWS, VMware HCX, VMware Site Recovery Manager, and VMware Horizon environments.

    We have written some articles explaining how to install the PowerCLI. You are more than welcome to check with one by accessing the following links:
    https://dpcvirtualtips.com/introduction-to-the-vmware-powercli/
    https://dpcvirtualtips.com/install-vmware-powercli-offline/

    Connecting to the vCenter Server through PowerCLI

    The first step is to connect to the vCenter Server. Before executing each command, we need to connect to the vCenter Server:

    connect-VIServer -Server VC_FQDN
    
    #change VC_FQDN to your vCenter FQDN

    If the connection has been done successfully, a message like the following image will appear:

    Now, we can execute PowerCLI commands to retrieve whatever details we need!

    Getting the vSAN-Enabled, Guest TRIM/Unmap, and vSAN Object Repair Time Values

    Checking if the vSAN is enabled at the cluster level:

    (Get-VsanClusterConfiguration -Cluster "vcf-cl01").VsanEnabled
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    Checking if the vSAN Guest TRIM/Unmap feature is enabled at the cluster level:

    (Get-VsanClusterConfiguration -Cluster "vcf-cl01").GuestTrimUnmap
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    Getting the vSAN Object Repair Time (The default value is 60 minutes):

    (Get-VsanClusterConfiguration -Cluster "vcf-cl01").ObjectRepairTimerMinutes
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    For instance, based on the image above, vSAN is enabled, TRIM/Unmap is enabled, too, and the vSAN Object Repair Time has its default value (60 minutes).

    Getting vSAN Disk Group Details

    As we can see in the following image, our vSAN cluster has four ESXi hosts, and each one has one vSAN Disk Group, as we can confirm in the following image:

    To get all vSAN Disk Groups from PowerCLI, the following command can be used:

    Get-VsanDiskGroup -Cluster "vcf-cl01" | ft -Wrap -Autosize
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    To get more details of each one:

    Get-VsanDiskGroup -Cluster "vcf-cl01" | fl
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    Getting vSAN Objects Details

    To get all vSAN Objects, execute the following command:

    Get-VsanObject -Cluster "vcf-cl01"
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    Look at the previous command; the “vSanUuid” field did not show its entire value. We can use the following command to solve it:

    Get-VsanObject -Cluster "vcf-cl01" | Format-Table -Property VsanUuid, ComplianceStatus, VsanHealth, StoragePolicy -Wrap -AutoSize
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    To get all vSAN Objects with a “vSanHealth” value different from “healthy”:

    Get-VsanObject -Cluster "vcf-cl01" | Where-Object { $_.VsanHealth -ne "healthy" }
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    To get details of a specific vSAN Object, execute the following command:

    Get-VsanObject -Cluster "vcf-cl01" | Where-Object { $_.VsanUuid -eq "202e8d66-bc65-d8f7-5881-005056b2e5dc" } | Format-List *
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server
    
    #replace "202e8d66-bc65-d8f7-5881-005056b2e5dc" to your vSAN Object UUID

    Getting vSAN Cluster Health Status

    To get the vSAN Health status, we can execute the following command:

    # Retrieve and store the health report
    $healthReport = Test-VsanClusterHealth -Cluster "vcf-cl01"
    
    # Inspect detailed properties
    $healthReport | Format-List *
    
    #replace vcf-cl01 to your cluster name
    #you can run Get-Cluster to get all available cluster under the vCenter Server

    As we can see in the above image, the “OverallHealthStatus” is “info.” It is possible to get specific health results for each item, for example:

    $healthReport.HealthSystemStatus | Format-List *
    $healthReport.DiskHealthResult | Format-List *
    $healthReport.NetworkHealth | Format-List *

    To Wrapping This Up

    The PowerCLI is a powerful tool that helps automate many tasks on an administrator’s day. We showed some examples of how to get vSAN details. However, feel free to explore more and more to make your day as easy as possible 🙂

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleChecking Thick-Provisioned Disks with PowerCLI in a vSAN Cluster
    Next Article Getting the Nutanix CE
    Danilo

    Infrastructure Engineer with experience in Virtualization, Linux, Windows Server and learning automation using Python. DPC Virtual Tips was created to share practical tutorials, lab experiences and troubleshooting guides focused on enterprise infrastructure technologies.

    Related Posts

    How to Troubleshoot Packet Drops on an ESXi Host

    August 16, 2026

    VM Replication with vSphere Replication and Site Recovery Manager

    June 16, 2025

    Changing DNS Settings on ESXi Hosts

    May 20, 2025

    Comments are closed.

    Search
    Categories
    • HPC (12)
    • Operating Systems (85)
    • PowerFlex (22)
    • Virtualization (130)
    Read More
    Virtualization

    How to Troubleshoot Packet Drops on an ESXi Host

    By DaniloAugust 16, 20260
    HPC

    SlurmDBD Is Down: What Continues Working and What Does Not

    By DaniloAugust 15, 20260
    HPC

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    By DaniloAugust 14, 20260
    Operating Systems

    Linux Server Has Free Memory but Is Swapping: Why?

    By DaniloAugust 13, 20260
    Operating Systems

    How to Determine Whether Packet Loss Is Local or Network Related on Linux

    By DaniloAugust 12, 20260
    Latest Posts

    How to Troubleshoot Packet Drops on an ESXi Host

    August 16, 2026

    SlurmDBD Is Down: What Continues Working and What Does Not

    August 15, 2026

    How to Investigate Jobs Stuck in COMPLETING State on Slurm

    August 14, 2026
    Images from Gallery
    hpc main commands
    linux commands
    install rock linux
    lustre fs
    shell scripting
    vSAN Trace Files
    Categories
    • HPC
    • Operating Systems
    • PowerFlex
    • Virtualization
    • Home
    • About Us
    • Contact
    • Cookie Policy
    • Comment Policy
    • Privacy Policy
    • Terms of Use
    • Disclaimer
    Copyright © 2026, DPC Virtual Tips. All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.

    We use cookies to ensure your best experience on our website. If you continue using our website, we'll assume you agree to our cookie policy