Tag Archives: PowerCLI - Page 2

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.

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.

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.

With the new release of vSphere PowerCLI 5.5 VMware made the tagging Feature (introduced in vSphere 5.1) scriptable. The new cmdlets are working with vCenter 5.1 and vCenter 5.5. They allow you to assign tags to objects and to search for objects based on their tags. Unfortunately there is no cmdlet to create tags at the moment. The feature is still not available within the API.

Hewlett-Packard introduced a new component called HP Agentless Management within their Gen8 Series. This feature is extensible though an agent running inside the operating system, in that case the ESXi Host. The package (hp-ams) is included in all customized VMware images provided by HP and the HP ESXi Offline Bundles. Unfortunately this package create some issues caused by excessive local logins. This might pointlessly blow up the database and logfiles. You can check that problem by opening the Event-Log provided by the ESXi Host which is flooded with the following messages:

Running commands inside a virtual machine without accessing it can be helpful in some cases. For example when you want to change an IP address from a Linux virtual machine that is not reachable through ssh. VMware provides the VIX (Virtual Infrastructure eXtension) API that helps you to write scripts to automate virtual machine operations and run programs within guest operating systems. I am going to show some basic VIX implementations using PowerCLI.

Do you use special characters in Port Groups or dvSwitch names? Then you might have problems with Scripts, Host Profiles or PowerCLI. Of course, usage of special characters like (&/"%) was always a bad idea, but sometimes you want to have nice-looking objects, as you might assume that names are nonfunctional labels. Unfortunately there are some issues with PowerCLI. And even worse, it is inconsistent. This post shows up a workaround when using special characters in Port Groups.

When you want to add many VMware ESXi Hypervisors to your vCenter inventory, a small one-liner might save you a lot of time. You can add hosts based on consistent host numbering, IP-Addresses or use a textfile for input.