Creating Hybrid Diskgroups on DL380 Gen9 using Powercli

One of the downsides of the web interface is that it is very difficult to group the disks by array controller when creating a diskgroup. You would have to determine the disks manually and then manually select the disks. From my discussions with VMware TMMs, the only reason to have a diskgroup span PCI controllers is when you have a NVMe device, otherwise they should stay within a PCI device in order to keep that as a unit of failure. In a hybrid configuration, a failure in a ssd results in a failure of the entire diskgroup, thus making that diskgroup a sort-of failure domain.

I wanted to see if I could script the creation of a vsan diskgroup. Luckily I came across a script by Alan Renouf. Unfortunately it only dealt with a single diskgroup and not the multiple diskgroup with one diskgroup per array controller. Also I found a few issues with the script.

Below is my PowerCLI script to create a diskgroup that is aligned with each P440 (or P440ar) controller. If you use different controllers you could probably tweak the script a bit for your needs. All flash would probably need to differentiate the write cache disk bye model or size.