Manage vSAN using Powercli

Powercli is a command line tool which based on Windows PowerShell. We can use it for automate our tasks. This article will show some of the valuable comnmads we can use to manage our vSAN infrastructure.

1. First will check what are the  available command in powercli relate to the vSAN

Syntax

Get-command *vsan*

image

2. We can check the health of vSAN cluster

Syntax

Get-Cluster|testVsanClusterHeath|fl

image

3. We can get the vSAN cluster configuration using below command

Get-VsanClusterConfiguraiton|fl

image

4. Using Get-VsanDiskGropu command we can get disk group details

Continue reading “Manage vSAN using Powercli”

How to configure SMB share on vSAN

1. First we need to enable file services on vSAN cluster

a. Login to the vCenter

b. Select the cluster

c. Click on Configure

d. Click on Services

e. Click on Enable  on File services

image

2. Click on Next

image

3. We need to provide below details

Continue reading “How to configure SMB share on vSAN”

Powershell script to get VM details with CSV name

$getallvms=(get-vm -ComputerName (Get-ClusterNode))

$result=@()

foreach ($item in $getallvms)

{

$vmname=$item.Name

$vmfullpath=$item.ConfigurationLocation

$vmpathtrim=$vmfullpath.Substring(18)

$pathindex=$vmpathtrim.indexof(“\”)

$csvpathfrom=$vmpathtrim.substring(0,$pathindex)

$properties=@{

Name=$vmname

Path=$csvpathfrom

 #Write-Host $item.name

 }

 $result+=New-Object psobject -Property $properties

}

$result |Sort-Object path