PowerCLI 4.1.1 introduces three new improvements for HA clusters:
- Ability to edit advanced HA cluster settings
- Cmdlet that retrieves the primary nodes of HA cluster
- Set of new properties that contain runtime HA information
The first of the new features is the ability to edit the advanced settings of HA clusters. There are four new cmdlets that allow you to customize HA settings – Get-AdvancedSetting, New-AdvancedSetting, Set-AdvancedSetting, and Remove-AdvancedSetting.
Let’s see several simple actions with these cmdlets:
- Assign value to isolation address 0 on cluster with name TestCluster
123<strong>New-AdvancedSetting –Entity TestCluster `–Type ClusterHA `–Name 'das.isolationAddress0' –Value '172.16.0.5'</strong> - Get isolation address 0 for all clusters
1234567<strong>Get-Cluster | `Get-AdvancedSetting -Name 'das.isolationAddress0' | `select @{ 'n'='ClusterName'; 'e' = { $_.Entity.Name }}, Value | `ft -AutoSize</strong>ClusterName Value----------- -----TestCluster 172.16.0.5 - This command returns all customized settings for a given cluster
1<strong>Get-AdvancedSetting –Entity TestCluster</strong> - Update the value of an existing advanced setting for all clusters.
12<strong>Get-Cluster | Get-AdvancedSetting -Name 'das.isolationAddress0' | `Set-AdvancedSetting –Value '172.16.0.6'</strong> - Updating can be done also through the New-AdvancedSetting cmdlet and by using the –Force switch. This row adds a value or overrides the already assigned value.
1234<strong>New-AdvancedSetting –Entity TestCluster `–Type ClusterHA `–Name 'das.isolationAddress0' –Value '172.16.0.5' `–Force</strong> - Remove a specific customized setting for all clusters.
12<strong>Get-Cluster | Get-AdvancedSetting -Name 'das.isolationAddress0' | `Remove-AdvancedSetting</strong>
You can refer to the vSphere Availability Guide for the full list of HA advanced settings.
The second improvement is represented by the Get-HAPrimaryVMHost commandlet. This commandlet returns a list of the primary nodes/hosts for a given cluster and it is really simple to use:
- Get the primary nodes of a cluster named TestCluster
1<strong>Get-Cluster TestCluster | Get-HAPrimaryVMHost</strong>
The third new feature is the addition of new properties in Cluster objects. These properties describe HA cluster runtime information and their names are HATotalSlots, HAUsedSlots, HAAvailableSlots, HASlotCpuMhz, HASlotMemoryMb and HASlotNumVCpus.
For example, let’s see how we can create a report that shows the count of total slots and the count of currently used and available slots.
1 2 3 4 5 6 |
<strong>Get-Cluster TestCluster | ` select Name,HATotalSlots,HAUsedSlots,HAAvailableSlots | ` ft –AutoSize</strong> Name HATotalSlots HAUsedSlots HAAvailableSlots ---- ------------ ----------- ---------------- TestCluster 123 36 39 |