Storage

PowerCLI and vSAN: A Comprehensive Guide to vSAN Disk Management

In this blog post, we’ll explore the powerful capabilities of PowerCLI in managing disks within a vSAN cluster and vSAN ESA enabled cluster. Disk management is a critical aspect of maintaining an efficient and optimized virtual storage infrastructure. With the help of specific PowerCLI cmdlets for vSAN cluster, we can manage vSAN disk groups, such as New-VsanDiskGroup, New-VsanDisk, Get-VsanDisk, Remove-VsanDisk, Get-VsanDiskGroup, and Remove-VsanDiskGroup. With Get-VsanEsaEligibleDisk, Add-VsanStoragePoolDisk, Remove-VsanStoragePoolDisk, we can streamline our vSAN ESA storage pool disk management tasks and ensure smooth operations within vSAN or vSAN ESA environment. Let’s dive in!

Managing vSAN Disks Groups and vSAN Disks

In vSAN clusters, vSAN architecture consists of two tiers: a cache tier for the purpose of read caching and write buffering, and a capacity tier for persistent storage. This two-tier design offers supreme performance to VMs while ensuring that data is written to devices in the most efficient way. vSAN uses a logical construct called disk groups to manage the relationship between capacity devices and their cache tier.

Managing vSAN Disk Groups

1. Creating a New Disk Group

To create a new disk group with specific solid-state and hard disk devices, we can use the New-VsanDiskGroup cmdlet. For example, let’s create a new disk group with an SSD and two data disks:

2. Fetching vSAN Disk Groups

To retrieve information about vSAN disk groups, we can use the Get-VsanDiskGroup cmdlet. For instance, to fetch the disk group “DiskGroup02” we can execute the following command. The output will the type of VsanDiskGroup.

3. Removing vSAN Disk Groups

If we need to remove a vSAN disk group, we can use the Remove-VsanDiskGroup cmdlet. We can reuse the result from the Get-VsanDiskGroup command.

vSAN disk groups consist of vSAN disks. We can, therefore,  manage vSAN disks within vSAN disk groups.

4. Adding vSAN Disks to an existing Disk Group

To add a vSAN disk to an existing disk group, we can use the New-VsanDisk cmdlet. For example, we can use the New-VsanDisk cmdlet to add a new disk, “DiskCanonicalName” to this disk group:

5. Fetching vSAN Disks

To fetch vSAN disks based on their ID or disk group information, we can use the Get-VsanDisk cmdlet. For instance, to retrieve information about all disks in a specified vSAN disk group we can execute the following command:

6. Removing vSAN Disks from a Disk Group

If we need to remove a vSAN disk from a disk group, the Remove-VsanDisk cmdlet comes to our rescue. Let’s remove “mpx.vmhba0:C0:T11:L0” disk by using the following command:

Introducing Storage Pool Disks in vSAN ESA

In the vSAN 8.0, we introduced a new storage architecture. In vSAN ESA (Express Storage Architecture), we introduced a new storage format called storage pool disks. These disks provide a more efficient and simplified approach to adding, removing, and managing storage within the ESA environment.

We can claim disks to define a storage pool on a vSAN host. Each host that contributes storage contains a single storage pool of flash devices. Each flash device provides caching and capacity to the cluster. We can create a storage pool with any devices that are compatible for ESA. vSAN creates only one storage pool per host.

In a storage pool, each device provides both caching and capacity in a single tier. This is different from a Disk Group, which has dedicated devices in different tiers of cache and capacity.

Before we add storage pool disks, we can see which one is available to add by using the Get-VsanEsaEligibleDisk cmdlet. The output will be the ScsiLun type.

When we know the disk canonical name from ScsiLun, we can claim disks to define the storage pool on a specified host.

Also, we can query the storage pool disk with the specified VMHost or Cluster, and remove the disk from the defined storage pool disk.

 

By harnessing the power of PowerCLI and leveraging its rich features, you can simplify and optimize your storage infrastructure, ensuring smooth operations within your vSAN cluster.

Happy disk management with PowerCLI in your vSAN environment!