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.
Ruby vSphere Console (RVC) - If you do not know what that is, you should definately give it a try. RVC is a Ruby based command line interface for vSphere and can be used to manage VMware ESXi and vCenter. Initially published as Fling, it grew into a fully implemented feature in vSphere 5.5. The vSphere inventory is presented in a tree structure, allowing you to navigate and run commands against vCenter objects. Many basic administrativ tasks can be done much more efficiently than clicking through the vSphere Client.
This guide covers some basic tasks and the procedure of how to use RVC with:
- vCenter Server Appliance (VCSA)
- Windows-based vCenter Server
With the release of vSphere 5.5, VMware supports a new command line utility: Ruby vSphere Console (RVC). RVC is a Ruby based interactive object oriented command line utility. It was initially released as a Fling some years ago. RVC has support for both, the Windows version of vCenter Server and the vCenter Server Appliance (VCSA). It is similar to other command line tools like PowerCLI or ESXCLI and can be used to manage and troubleshoot vSphere environments. In this post I am going to show how to install RVC on the vSphere Management Assistant (vMA).
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.
New Tag related cmdlets in vSphere 5.5:
- Get-Tag - retrieves the tag assignments of objects.
- New-TagAssignment - assigns a tag to the specified object.
- Remove-TagAssignment - removes a tag from the specified object.
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.
When you virtualize Linux Operating Systems with VMware you have 3 opportunities when it comes to the decision which VMware Tools to install. The well-known VMware Tools that come with the ESXi Hypervisor and can be installed from the vSphere Client, the VMware Operating System Specific Package (OSPs) and the open source project open-vm-tools. This post explains the differences between the variants and helps you to understand the advantages to choose the right package for your environment.
If you use Linux Guests inside VMware I encourage you to comment on what kind of VMware Tools you are using.
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.
Within vSphere 5.1 a new feature called Tags has been introduced by VMware. Tags are an enhancement of Custom Attributes and enables users to categorize inventory objects. They are a great approach for organizing or reporting tasks. Tags can be associated to the following object types:
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.