Tips for writing Vester test files, part 2

20/02/2019

This post is the second part in a series about writing effective Vester test files. The previous part can be found here.

When there is no easy Get and Set

An example, we want to create a test to check the Cluster DPM settings. The Get-Cluster cmdlet can show many properties, however the options of the corresponding Set-Cluster cmdlet are limited. You can see for yourself running the following command:


PS> help Set-Cluster -Parameter *

Commands like Get-Cluster, Get-VMHost, Get-Datacenter are practical, easy to use but have some limitations, like not showing all info and are not blazing fast.

Time to meet the Get-View cmdlet, a bit less user-friendly, but much quicker and very useful. The equivalent for the Get-Cluster cmdlet is:


PS> Get-View -ViewType ClusterComputeResource

To select a specific Cluster, use the -Filter parameter, like:


PS> Get-View -ViewType ClusterComputeResource -Filter @{"NAME"="Cluster01"}

Another way is:


PS> Get-Cluster -Name Cluster01 | Get-View

Time to create the first DPM test. To test if DPM is enabled, execute the following commands:


PS> $Cluster = Get-Cluster -Name Cluster01 | Get-View

And run this:


PS> $Cluster

You can see all properties, note there is “Configuration” and “ConfigurationEx”. Run both:


PS> $Cluster.Configuration
PS> $Cluster.ConfigurationEx

And note the difference, $Cluster.ConfigurationEx has a “DpmConfigInfo” section. The following line will show the current DPM configuration for Cluster “Cluster01”


PS> $Cluster.ConfigurationEx.DpmConfigInfo.Enabled

Enabled DefaultDpmBehavior HostPowerActionRate Option
------- ------------------ ------------------- ------
True automated 4

We can now write the first part for the DPM enabled test.


$Title = 'DRS Power Management enabled'
$Description = 'Enable Power Management DPM'
$Desired = $cfg.cluster.drsDpmEnable
$Type = 'bool'

# The command(s) to pull the actual value for comparison
# $Object will scope to the folder this test is in (Cluster, Host, etc.)
[ScriptBlock]$Actual = {
($Object | Get-View).Configurationex.DpmConfigInfo.Enabled
}

# The command(s) to match the environment to the config
# Use $Object to help filter, and $Desired to set the correct value
[ScriptBlock]$Fix = {
????
}

Read the rest of this entry »


Tips for writing Vester test files, part 1

10/02/2019

Over the last couple of weeks, I took a look at the Desired State Configuration Resources for VMware (later more on that…).

But above all, I spent quite some time exploring Vester. Vester can be really useful, and it is relatively easy to create additional test files and get more configuration settings under Vester control. While working on new test files, I gathered some lessons learned that can be useful for others.

Naming Test file and the components

Choose a descriptive name for a new test file. Although test files are organized in folders, when the number of test files is increasing descriptive names can be helpful.
What makes a good name? Refer to something that is known and unique.
E.g. For vCenter Clusters, most settings are related to DRS or HA settings, the output of the following command can be helpful:

> Get-Cluster -Name Cluster01 | select *
VsanEnabled               : False
VsanDiskClaimMode         : Manual
HATotalSlots              : 
HAUsedSlots               : 
HAAvailableSlots          : 
HASlotCpuMHz              : 
HASlotMemoryMb            : 
HASlotMemoryGB            : 
HASlotNumVCpus            : 
ParentId                  : Folder-group-h23
ParentFolder              : host
HAEnabled                 : True
HAAdmissionControlEnabled : True
HAFailoverLevel           : 1
HARestartPriority         : Low
HAIsolationResponse       : PowerOff

E.g. Creating a test file for the HA Failover Level, name the test file: “HA-FailoverLevel.Vester.ps1”.
While working on a test file the following variables also play an important role.
The variable $Title is shown during each run of Invoke-Vester and can be used to provide more information then the title of the test file.

Fig. 1

Read the rest of this entry »


Top 25 Virtualization Blogs, News Websites & Newsletters in 2019

07/02/2019

Feedspot, the content reader for reading all your favorite blogs and news websites in one place, has published a Top 25 Virtualization Blogs.

This blog site is rated 20!

The blogs are ranked based on following criteria:

  • Google reputation and Google search ranking
  • Influence and popularity on Facebook, twitter and other social media sites
  • Quality and consistency of posts.
  • Feedspot’s editorial team and expert review

20. Adventures in a Virtual World – Paul Grevink

Adventures in a Virtual World - Paul Grevink

Koedood, Netherlands

About Blog Paul Grevink is an IT Consultant. He is especially interested in subjects concerning Cloud, Virtualization, storage and networking. Paul is specialized in VMware Products, but also has an extended knowledge of Microsoft Windows, Linux and other Open Source products.
Frequency about 1 post per month.
Website paulgrevink.wordpress.com
Facebook fans n/a. Twitter followers 414.

Thank you! Much appreciated!