Tag Archives: PowerCLI

How to use ESXCLI v2 Commands in PowerCLI

PowerCLI, a set of PowerShell extensions for vSphere, is a great tool for automating VMware configuration and management tasks. It allows you to change a lot of ESXi host and vCenter settings. A powerful cmdlet is Get-EsxCli which allows you to run ESXCLI tasks from your PowerCLI console. ESXCLI is the main configuration command on an ESXi host.

This post explains how to use the Get-EsxCli cmdlet with the new V2 interface, which is much more intuitive than the old method.

get-esxcli

Read more »

Getting Started with PowerCLI for Linux (PowerCLI Core)

powerclicoreBased on Microsoft PowerShell Core which enables users to use PowerShell on Linux, Mac and Docker, VMware has started to make PowerCLI compatible with the new PowerShell. This allows to run scripts that were previously only available for Windows on Linux or Mac based systems.

In this post I am going to give a quick startup guide to the installation and configuration of PowerCLI Core.

Read more »

How to properly initialize PowerCLI 6.x in PowerShell ISE

With the release of vSphere 6.0 VMware has started to transform their distribution model of PowerCLI cmdlets from PSSnapins into modules. This is a good thing because modules are the preferred method of adding cmdlets to PowerShell. Unfortunately the changed behavior breaks plenty instructions on how to load VMware PowerCLI in ISE, including my own. The old method works for core cmdlets, but functions related to Distributed Switches or Storage Policies for example are missing.

If you have the latest version of PowerCLI installed but cmdlets are missing in PowerShell ISE, maybe you are using the old method to load cmdlets.

Get-VDSwitch : The term 'Get-VDSwitch' is not recognized as the name of a cmdlet, function, script file, or operable program.

Read more »

vSphere 6.0 Performance Metrics - What is CPU Readiness?

I haven't seen this in any announcement, but there is a new performance metric in vSphere 6.0 called CPU Readiness which is according to the description:

Percent of time the virtual machine is unable to run because it is contending for access to the physical CPU(s).

vsphere-6-cpu-readiness-legend

Read more »

vSphere 6.0 - How to use ESXCLI Commands in PowerCLI

PowerCLI, a set of PowerShell extensions for vSphere, is a great tool for automating VMware configuration and management tasks. It allows you to change a lot of ESXi host and vCenter settings. One powerful cmdlet is Get-EsxCli which allows you to run ESXCLI tasks from your PowerCLI console. ESXCLI is the main configuration command on an ESXi host. This post explains how to use the Get-EsxCli cmdlet.

get-esxcli

Read more »

Create an ESXi ISO that contains all Patches

VMware does only provide installable ISO files for updates (Bold entries of my ESXi Build List), not for patches. This post explains how you can quickly create an installable that contains all patches.

latest-esxi-installable

Read more »

PowerCLI Script to Calculate VSAN VSPP Points

VMware includes Virtual SAN in their VSPP program. Unfortunately their vCloud Usage Meter, the tool that helps to create a license report, does not support Virtual SAN by now. I wrote a little PowerCLI script to gather the required information.

vsan-vspp-script

Read more »

Permanently disable ESXi 5.5 coredump file

The new coredump file feature in vSphere ESXi 5.5 creates a file to extend the coredump partition. This usually happens when you upgrade from a previous version to ESXi 5.5, or you install ESXi to a USB drive or SD card. This coredump file is created on a random VMFS datastoore by using a smart selection algorithm. This random placement causes different kind of problems, for example when you want to delete a datastore. Another problem might occur in an EMC VPLEX deployment where you want to failover VMs to the secondary site in a PDL situation (VMkernel.Boot.terminateVMOnPDL=1 / Disk.AutoremoveOnPDL=0). Datastores that had a coredump file configured can't get mounted back when the volume leaves the PDL state after a site failure has been fixed.

To workaround this issue you might want to permanently disable the coredump file. You can't just disable it, as it gets created automatically after a reboot.

Read more »

VM Export/Import PowerCLI Script

I wrote this little script snippet to export and import virtual machines from one vCenter to another. This might help for migrations where you have to add virtual machines from a datastore manually to the vCenter inventory. This script does not export any virtual machine disks or configuration files. It's only supposed as replacement for adding virtual machines from an existing datastore the the inventory.

Read more »

Howto use ESXCLI in PowerCLI

PowerCLI, a set of PowerShell extensions for vSphere, is a great tool for automating VMware configuration and management tasks. It allows you to change a lot of ESXi host and vCenter settings. One powerful cmdlet is Get-EsxCli which allows you to run ESXCLI tasks from your PowerCLI console. ESXCLI is the main configuration command on an ESXi host. This post explains how to use the Get-EsxCli cmdlet.

get-esxcli

Read more »