Home > Blogs > VMware PowerCLI Blog > Author Archives: Brian Graf

Author Archives: Brian Graf

Brian Graf

About Brian Graf

Brian Graf is a Senior Product Manager - Distributed Resource Management (DRS/HA/DPM) at VMware. Previous to Product Management, Brian worked as a Senior Technical Marketing Manager at VMware, focused on PowerCLI Automation and ESXi Lifecycle technologies. Previous roles also include: Consultant for EMC Consulting. His main focus was Data center migration methodologies and implementations. His background previous to VMware includes Operations Engineering, Virtualization, Business Intelligence, and Exchange/Blackberry Engineering. Get notification of new blog postings and more by following Brian on Twitter: @vBrianGraf

Audit and Manage ESXi Hosts with PowerCLI

It’s not enough in this day and age for administrators to oversee their virtual environments. Increasingly I hear more about the need for updating the ESXi hosts’ drivers and firmware during maintenance windows. I get it, I completely understand this need. So how does an admin keep up on what hardware all of his VMs are running on? What if you need to check the hardware to compare it against the Hardware Compatibility List for a new version?

We’ve made this much easier! Read on!

Introducing Two New Cmdlets

In PowerCLI 6.0 R2 we introduced two new cmdlets to help admins have visibility into the physical hardware their virtual environments are running on.

Get-VMHostHardware

Get-VMHostHardware allows users to query their ESXi hosts and return specific information about each machine. Some of the key information returned includes:

  • VMHost Name
  • Manufacturer
  • Model
  • Serial Number
  • Asset Tag
  • BiosVersion
  • CPU Model
  • CPU Count
  • CPU Core Count Total
  • Mhz Per CPU
  • NicCount
  • and more…

vmhosthardware

This can be very beneficial when running a report on the hardware the virtual environment is running on. Information from this cmdlet, like the Bios Version, can be very helpful when planning the next maintenance window for specific hosts. Now you have two options for determining which hosts need to be updated. First, exporting all results to CSV and then filtering on BIOS version or other property. Second, modify the PowerCLI command to filter results to return exactly the data that you want to see. For example, you may use the following code to bring back each unique BIOS Firmware version across your hosts:

$Hardware = Get-VMhost | where {$_.ConnectionState –eq $true} | Get-VMHostHardware | Sort-Object BiosVersion –Unique

HardwareSorted

We use the ConnectionState property because the Get-VMHostHardware cmdlet cannot query against a disconnected host, so rather than seeing an error for any host that is not connected, we take care of it at this stage.

The additional information provided by this cmdlet will allow you to verify CMDB data as well as feed reports back to CMDBs or other groups in your company.

Get-VMHostPciDevice

Want a cmdlet that will return all PCI Devices on your ESXi Host? Look no further! The new Get-VMHostPciDevice cmdlet will return all the information you ever wanted about your ESXi Host devices. It operates just like the previous cmdlet so you will need to make sure that the hosts are powered-on and connected before running this cmdlet otherwise it will return an error for any host not in this desired state. I find it easiest to export this information to either a CSV or use Out-GridView to pull this information into a nicely formatted window to look through. The code below can be used to bring back all PCI Device information on all ESXi Hosts in your vCenter

Get-VMHost | Get-VMHostPciDevice

image

You could take this information and export it to CSV and save it for future reference or support.

To learn more about these two cmdlets, use the Get-Help cmdlet to see examples or read more about them in the online cmdlet reference here.

Have you updated to PowerCLI 6.0 R3 yet? Why not? Did you know it supports all the way back to vCenter Server 5.0? Download it today from here and gain the latest benefits.

PowerCLI Customer Spotlight #5: Fabian Lenz

Spotlight

 

Back from a small break, we return to spotlight PowerCLI users from the community. Today I am pleased and excited to spotlight Customer #5: Fabian Lenz! Continue reading

PowerCLI 6.0 Release 3 Has Arrived

PowerCLI R3

The PowerCLI team is back and at it again. This time with the release of PowerCLI 6.0 Release 3. This release has some minor updates for those who have moved to PowerCLI 6.0 Release 2.

In this release we introduce a few fixes that were needed in 6.0 Release 2.

What’s New:

Continue reading

Onyx For The Web Client (vSphere 6.0 U1) – Now Available

Screenshot 2015-07-08 15.53.55

Everyone cheered when we released an updated Onyx fling that allowed users to finally record their actions in the vSphere Web Client. (you can read about what Onyx for the Web Client is, and how to install it here: https://blogs.vmware.com/PowerCLI/2015/07/new-fling-onyx-web-client.html).

Continue reading

Want to Change VM Component Protection Settings via PowerCLI? Now you can!

I had a VMware Senior Systems Engineer reach out to me yesterday asking on a customer’s behalf, if there were any PowerCLI cmdlets that could change VMCP settings.

*** If you are not familiar with VM Component Protection, I suggest you take a look at this blog post written by my co-worker Matt Meyer, which describes in detail what VMCP is and what each setting does: https://blogs.vmware.com/vsphere/2015/06/vm-component-protection-vmcp.html ***

I knew that we didn’t have any cmdlets for this yet so the next step for me was to Continue reading

New PowerCLI Example Scripts Github Repository is now Live!

PowerCLI-Github.png

Code is everywhere, and I’m sure there are duplicates of code that we’ve posted on the blog or personally, strewn throughout the interwebs. The idea behind opening this repo is to have a location where we can paste code, functions, and modules from the blog posts as well as anything else cool we come up with.

 

The PowerCLI-Example-Scripts repo runs under the Tech Preview license, which you can read on the github site, describes the condition and terms of use of this code. We encourage everyone to feel free to add to, modify, and send through pull requests so that we can also maintain this as more of a community repo. Just note that there are only a few of us as admins on the repo so it may take a little time to validate and accept anything that comes our way.

We hope you enjoy and look forward to sharing more in this repo, along with seeing what the community sends our way. Happy Friday!

PowerCLI-Example-Scripts

PowerCLI 6.0 Release 2 is Now Generally Available

It is once again our pleasure to introduce the next version of PowerCLI and all of the features and enhancements that come along with it.

powercli60r2

 

I am pleased to announce that PowerCLI 6.0 R2 is now Generally Available to the public. This release is full of enhancements, improvements, and additional product extensiblity. I urge each of you to take a look through the release notes as well after reading this post to get a more full understanding of what we’ve accomplished to help you out in your day-to-day administration.

Continue reading

Does PowerCLI hang when loading? Check to see if Windows is the culprit!

Over the past few months, we’ve heard of several customers who were experiencing issues where the PowerShell window would hang for about 30 seconds with a black screen before allowing the customers to use the console. If you are experiencing similar symptoms, read on. Continue reading

PowerCLI Customer Spotlight #4: Amy Manley

Spotlight

As we continue to highlight PowerCLI users in the community and find out more about them, we are excited to introduce Amy Manley! Continue reading

Using VMware Instant Clone via PowerCLI Extensions Fling

FLINGS.png

In the last post I anounced the new PowerCLI Extensions fling, which allows admins to leverage the Instant Clone abilities found in vSphere 6. Today I’m going to walk you through how to use it.

Prerequisites

To be able to fully leverage PowerCLI Extensions, you will need to meet the following requirements Continue reading