Home > Blogs > VMware PowerCLI Blog > Monthly Archives: September 2018

Monthly Archives: September 2018

PowerCLI at VMworld EMEA 2018

VMworld Barcelona

The schedule builder is live, so that means VMworld EMEA is almost here! Earlier this year, at VMworld US, we had an amazing amount of PowerCLI and automation-based sessions and we’re bringing a bunch of them to Barcelona! There are more sessions than last year, a re-vamped PowerCLI Hands-On-Lab including an expert-led Hands-On Lab, a solid set of community sessions, and the return of the fantastic Hackathon event. If you haven’t already registered, the time is quickly ticking away!

Make sure to add the following sessions to your schedule and catch up with the PowerCLI team and the amazing PowerCLI community members!

Sessions

Session: DEV3504BE – Development at VMware: A Look at How PowerCLI Has Evolved Over the Years
Date: Tuesday, Nov 6, 5:00 p.m. – 6:00 p.m.
Speakers: Kamen Nikolov & Kyle Ruddy
Kamen and Kyle will give attendees a behind the scenes look into the PowerCLI development process and the many ways PowerCLI has evolved over the last 10+ years.

Session: VIN1992BE – A Deep(er) Dive with PowerCLI 10
Date: Thursday, Nov 8, 9:00 a.m. – 10:00 a.m.
Speakers: Luc Dekens & Kyle Ruddy
Luc and Kyle will take a look at the more advanced use-cases when using PowerCLI to automate actions in your environment. From proper object handling to diagnosing speed issues to debugging and more, this session is going to be a deep dive into the “what’s possible” with PowerCLI.

Session: HCI2522BE – Getting Started with vSAN Automation
Date: Thursday, Nov 8, 3:00 p.m. – 4:00 p.m.
Speakers: Alan Renouf & William Lam
Alan and William show attendess how to get started automating all the aspects of vSAN with tools such as PowerCLI and the vSAN management SDKs.

Session: NET1642BE – NSX-PowerOps: Day2 Ops, NSX Health, Security, and Automated Documentation
Date: Thursday, Nov 8, 12:00 p.m. – 1:00 p.m.
Speakers: Hammad Alam & Puneet Chawla
Hammad and Puneet will discuss a community-built tool, NSX-PowerOps, which uses tools like PowerCLI and PowerNSX to create documentation of your environment.

Session: VIN2527BE – Top 10 Automation Requests and How You Can Save Time
Date: Tuesday, Nov 6, 2:00 p.m. – 3:00 p.m.
Speakers: Alan Renouf & William Lam
Alan and William walk through the top ten automation requests and how to complete them in a variety of languages, including PowerCLI.

VMware {code} Power Sessions

Session: CODE5609E – It’s Magic! Automating VMware Cloud on AWS
Date: Wednesday, Nov 7, 1:30 p.m. – 2:00 p.m.
Speaker: Adam Osterholt
Adam discusses how to start interacting with the VMware Cloud on AWS APIs with PowerCLI to automate your scalable, highly resilient, infrastructure in the cloud.

Session: CODE5606E – Building a Front-End for PowerCLI Scripts
Date: Wednesday, Nov 7, 2:30 p.m. – 3:00 p.m.
Speaker: Lino Telera
Lino will show how one could interact with their PowerCLI scripts using middleware and frontend frameworks.

Session: CODE5629E – vSphere Integration and Automation: Choose Your Tool
Date: Wednesday, Nov 7, 3:30 p.m. – 4:00 p.m.
Speaker: Ivaylo Ivanov
Ivaylo will walk attendees through a comparison of the numerous ways users can choose to automate their vSphere environments.

vBrownBag Sessions

Session: VMTN5507E – Dev 4 the Ops Team
Date: Wednesday, Nov 7, 2:30 p.m. – 2:45 p.m.
Speaker: Chris Bradshaw
Chris will walk through the importance of having some form of coding experience and some easy ways to start, using none other than PowerCLI.

Hands on Labs

Lab: SPL-1911-05-SDC_E – VMware vSphere Automation – PowerCLI
Date: Anytime the HOL area is open and available
Get hands-on with VMware PowerCLI. Gain familiarity with the tool, and then dive deeper into the functionality available with real world examples. Both new and experienced users are sure to learn something new about automating their environments.

Session: ELW-1911-05-SDC_E – Expert-Led Workshop – VMware vSphere Automation – PowerCLI
Date: Tuesday, Nov 6, 2:00 p.m. – 3:30 p.m.
Speaker: Howard Shoobe
Howard will show attendees how to get hands-on with VMware PowerCLI. You will gain familiarity with the tool, and then dive deeper into the functionality available with real world examples.

Hackathon

And last, but certainly not least, the VMware {code} Hackathon! If you’ve never been or haven’t heard of it, this is a fantastic event to get involved with other community members to do some coding in a cool location! There’s no requirement to even know how to code.

Session: CODEHACK – VMware {code} Hackathon
Date: Monday, Aug 27, 6:30 p.m. – 11:30 p.m.
Join VMware {code} for the third annual hackathon!

Summary

If you’re looking for PowerCLI content, VMworld EMEA is the place to be! With 5 sessions, 4 community sessions, multiple meet the experts, and several hands-on activities, there’s something for everyone regardless of skill level. Make sure you’re registered for VMworld and get these sessions added to your schedule today!

Discovering VMs with Specific VMware Tools Versions

A recent knowledge base (KB) article was released regarding an issue impacting a specific version of VMware Tools. The KB in question is 57796, which describes the possibility of a guest level network connectivity issues or even a purple diagnostic screen (PSOD).

Before getting to the discovery process, I want to cover some of the specifics for this KB. I do this because we’re going to need to be aware of these as we build out our one-liners and the subsequent reporting script.

The issue in the KB may be found when combined with the following:

  • VMware Tools version 10.3.0
  • ESXi 6.5 Hosts
  • VM Hardware 13
  • Windows Server 2012 or newer -OR- Windows 8 or newer

Now that we know what we’re looking for, lets cover some methods we’ll be using to make this easier.

Properties, Hash Tables, and More

Since we’re going to be focused on VMs, we’ll be making use of the Get-VM cmdlet. However, the information we need isn’t available as part of the cmdlet’s default response. We’ll need to choose specific VM properties to display.

Discovering those properties can be done in a couple different ways. If we just want to find out what properties are available and how they’re defined, we can use the Get-Member cmdlet. If we want to find out the values for all of those properties, we can use the Format-Table cmdlet. Both of these cmdlets can be used in the same way, by using the Get-VM cmdlet and passing the output to the desired cmdlet with a pipeline.

Example Code:
Show Properties for Virtual Machine Objects

In this case we’re going to be referencing the ‘Name’ property and an additional property which is available as part of the listed ‘Guest’ property, which is actually defined as an object. The property we’re looking for in the Guest object is named ‘ToolsVersion’.

We can output these specific properties using the Select-Object cmdlet. In order to properly display the ‘ToolsVersion’ property, we’ll be using a hash table to create a calculated property. The hash table is created with an ampersand and curly brackets. We can establish the calculated property with ‘name’ and ‘expression’ values.

Listing VMs and their VM Tools Versions

First things first, let’s figure out how to display our VMs’ names and their VM Tools version using the Select-Object cmdlet and a calculated property for the Tools Version.

Example Code:

PowerCLI - Get VMs and list Name and Tools Version

Listing VM Specific Information from the KB

In the example above, we can see there’s one particular VM which may be impacted by the KB. So, the next step is to obtain the rest of the information about each of the VMs.

We’ve already obtained the VM’s name and VMware Tools version properties. Now we need to figure out the ESXi host version, VM Hardware version, and what OS is in use.

The ESXi host version can be found using the VMHost property. This property returns the full ESXi host object. Since we’re working with the full object, we can return the ‘Version’ property by way of the calculated property method we used previously.

The VM Hardware version can be found by referencing the ‘HardwareVersion’ property.

The last property we’re interested in is the OS type. This too is available as a sub-property to ‘Guest’. There’s a couple to choose from, but for this example we’ll start with the ‘GuestFamily’ property.

Example Code:

Obtain requisite information for each VM per the KB

Listing Only Applicable VMs

For our last example, let’s take this process a step further and display only the susceptible VMs.

We’ll do this with the Where-Object cmdlet. We’ll use this cmdlet, in combination with a script block, to validate that each of those properties match those items listed in the KB.

We’ll be validating the following properties:

ToolsVersion 10.3.0
VMHostVersion 6.5.0
HardwareVersion vmx-13
GuestFamily windowsGuest

Example Code:

View only potentially impacted VMs

Summary

Knowledge Base article 57796 details a specific issue which has the potential to impact environments. We can use PowerCLI to easily poll our environment to obtain, and even isolate, the specific VMs which may be impacted.

Let us know in the comments how you’re building on what’s available here to create reports and even remediations!