Thursday, February 9, 2017

Virtual SAN and PowerCLI

Creating a vsan cluster with manual disk claim mode:

new-cluster -name cluster_name -vsanenabled -location datacenter_name

Viewing disk groups:


Creating a disk group:

new-vsandiskgroup -vmhost hostname -ssdcanonicalname disk_name -datadiskcanonicalname  disk_name,disk_name

Removing a disk group:

remove-vsandiskgroup -vsandiskgroup disk_group_name -confirm:$false

Removing a disk from a disk group:

remove-vsandisk -vsandisk disk_name -confirm:$false

Adding  a disk to a disk group:

new-vsandisk -canonicalname disk_name -vsandiskgroup disk_group_name

Viewing attributes of a vsan disk:

get-vsandisk -canonicalname disk_name -vmhost esxi_name

Viewing vsan storage policies:

get-spbmstoragepolicy -name policy_name

Creating a vsan storage policy:

new-spbmstoragepolicy -name policy_name -anyofrulesets

Removing a vsan storage policy:

remove-spbmstoragepolicy -storagepolicy policy_name

Exporting a vsan storage policy:

export-spbmstoragepolicy -storagepolicy policy_name -filepath C:\location -force

Importing a vsan storagepolicy:

import-spbmstoragepolicy -storagepolicy policy_name -filepath C:\location

Viewing fault domains:

get-vsanfaultdomain -cluster cluster_name

Creating a vsan fault domain:

new-vsanfaultdomain -name domain_name -vmhost hostname1, hostname2

Removing a vsan fault domain:

remove-vsanfaultdomain -vsanfaultdomain domain_name -confirm:$false

Viewing vsan disk space usage:

get-vsanspaceusage -cluster cluster_name