vSAN how to add diskgroup using powercli
Add host to existing vSAN cluster
Manage VMware Infrastructure using Ruby commands
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*
2. We can check the health of vSAN cluster
Syntax
Get-Cluster|testVsanClusterHeath|fl
3. We can get the vSAN cluster configuration using below command
Get-VsanClusterConfiguraiton|fl
4. Using Get-VsanDiskGropu command we can get disk group details
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
2. Click on Next
3. We need to provide below details
Powercli run commands inside the vm without network connectivity
We need to run some commands inside one of the vm , but its not connect to the network
First we need to connect to the vCenter using powercli
Continue reading “Powercli run commands inside the vm without network connectivity”
How to reset vCenter SSO admin password from shell
1. Get a putty session to vCenter appliance
2. Run belwo command
3. Select Option 03 and it will generate new password for SSO admin
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