Skip to main content

Posts

Showing posts from February, 2019

Powershell cmdlet syntax

Over the years I have been using powershell and Windows Powershell ISE as my default editor. Whenever I was stuck on not knowing the syntax for a cmdlet I would use the Commands windows and find my cmdlet then select Show Details You will get a expanded menu of all the possible syntax/s that are for the cmdlet. Selecting the question mark then brings up more detailed information such as description, syntax and examples. There are times where I work straight on the command line and discovered that there are equivalent commands available to help display this information Get-Command Connect-VIServer -Syntax This would output the syntax/s the cmdlet can accept Another useful command to use it  Get-Help Connect-VIServer -Examples This would output some examples to help you on how to use this cmdlet Below are a few more cmdlets which provides further information about a cmdlet which maybe useful Get-Help Connect-VIServer -Detail

Remember to save your resource pool tree

One of the things that you could lose when you disable DRS for a cluster is your resource pool trees and the settings your resource pools (Memory/CPU reservations etc). Settings such as anti-affinity/affinity, DRS automation level are not included. With so much automation taking place nowadays it is very easy to script something to enable or disable DRS via PowerCLI. A simple line like this  To turn OFF DRS : Get-Cluster -Name "cluster" | Set-Cluster -DrsEnabled: $false To turn ON DRS : Get-Cluster -Name "cluster" | Set-Cluster -DrsEnabled: $true One thing I noticed with this PowerCLI command is that it does not give you an option to save/export your resource pool tree structure and settings. I have seen people asking in VMTN how to use script to export your settings to a CSV file and there are plenty of ways. I am going to walk through how to backup and restore your resource pool tree via the HTML 5 client and