VMware PowerCLI is a command-line scripting tool built on Windows PowerShell. It provides an array of cmdlets to efficiently automate repetitive tasks, create reports as well as be used as a guardrail to ascertain possible outcomes of administrative operations.
PowerCLI is the preferred and widely used utility to manage and automate the vSphere suite of products, including VMware vSAN. Each new release of PowerCLI adds to the extensive list of cmdlets to ease administration. PowerCLI 12 now includes new cmdlets to provision and manage vSAN File Service introduced with vSAN 7.
List of new cmdlets introduced:
You can access the complete set of PowerCLI cmdlets and their usage here - PowerCLI Reference.
Here is an example of using the new cmdlets to create a File Share on a vSAN cluster:
Add vSAN File Service OVF
Set-PowerCLIConfiguration -WebOperationTimeoutSeconds 3600
Enable vSAN File Service
$fsnet = Get-VirtualNetwork
$conf = Set-VsanClusterConfiguration $conf -FileServiceEnabled $true -FileServiceNetwork $fsnet
Create a File Service domain and provide network details
$ipConfig=New-VsanFileServerIpConfig -IpAddress "X.X.X.X" -SubnetMask "Y.Y.Y.Y" -Fqdn "randomname.eng.vmware.com" -Gateway "Z.Z.Z.Z" -IsPrimary
New-VsanFileServiceDomain -Name “vcflab-fsx” -VsanFileServerIpConfig $ipConfig -DnsServerAddress "10.198.16.1" -DnsSuffix “labs.satb.eng.vmware.com” -Cluster $conf.Cluster
Create file shares that can be presented to clients
$domain = Get-VsanFileServiceDomain New-VsanFileShare -FileServiceDomain $domain -Name "vcflabx"
Verify that File Service domain is created with the intended file shares
VMware Cloud Foundation is the best-in-class hybrid cloud platform powered by vSAN to run any workload. Automation is essential to build and manage hybrid cloud infrastructure at scale efficiently, and PowerCLI is a powerful tool that enables automation. PowerCLI 12 provides Day-0 support for several new features included with vSphere 7, specifically flagship features such as vSAN File Service, as demonstrated in this blog post. PowerCLI drastically improves operational efficiency and eases administration.