As VMware administrators, we have a number of options available to us for automation. You can use VMware Orchestrator, PowerCLI and the vSphere Management Assistant.
While VMware vSphere Management Assistant (vMA) may not be as powerful as vCenter Orchestrator (vCO) and PowerCLI, it's much simpler. Administering a vSphere infrastructure requires flexibility. You need to create scripts that can access all your ESXi hosts and vCenter, run them without having to re-authenticate multiple times, and store them in a centralized repository. While you could use PowerCLI or vCO to accomplish many of the same tasks, you wouldn't have a centralized VM appliance.
With a few quick tips, you'll find vMA is a useful free tool that all sysadmins should have installed in their vSphere infrastructure.
What is VMware vMA?
Previously called VMware Infrastructure Management Assistant, or VIMA, before vSphere 4, vMA is a free virtual appliance used to manage your virtual infrastructure from the command line. VMware originally created vMA when it made the move from ESX Server, which had a local Linux console, to ESXi, which has no local Linux management tool.
VMware vMA is a SUSE Enterprise Linux VM that can be downloaded by anyone who has a registered vSphere license or who is evaluating vSphere. With the Open Virtualization Format (OVF) virtual appliance downloaded, you import it into your virtual infrastructure and, through the command line interface (CLI), use it to administer your vSphere infrastructure.
VMware vMA contains the vSphere command line interface (vCLI) and the Perl SDK and is able to run scripts or agents on VMs running in the vSphere infrastructure.
Deploying and configuring VMware vMA
You can download the vSphere Management Assistant virtual appliance, version 5.5, here.
After downloading vMA, deploy it like any other virtual appliance, using the Deploy OVF Template option. During the deployment, you can choose to use thick or thin provisioning, as well as static or dynamic IP addressing. The deployment should only take a few minutes and, as it's a virtual appliance, the operating system and applications are already installed.
Once deployed, you can open the vMA console from the vSphere client to perform the initial configuration. Once it is configured, connect to vMA using SSH by connecting to the IP address. While vMA is a command-line tool, there is a virtual appliance GUI, but it's used only for things like rebooting the appliance, upgrading it, configuring the time zone or setting IP address configuration. Here's what the administrative GUI looks like:
Before going to the Web GUI, you'll need to open the vMA console from the vSphere client and complete the configuration.
The default credentials for vMA are:
- Administrative user: vi-admin
- vi-admin password: vmware (but you will be prompted to configure a complex password during initial configuration)
Using the vSphere Management Assistant
With vMA up and running, how can it help you? The first thing you should do is to tell vMA about your ESXi servers or your vCenter Server. Do this with:
vifp addserver [hostname]
You will be prompted for the root password for each of your hosts.
Here's what the syntax looks like:
Once added, you can do vifp listservers to verify that your hosts -- or vCenter -- are added.
With your hosts -- or vCenter Server -- added, you can run most of the common command-line tools that you would use if you were connected to the console of an ESXi host.
However, before you run a command, you'll need to select a host with vifptarget –s [host]
When you do so, your command prompt will change to tell you that you are connected to a particular host, as shown in the screenshot below.
Then I can do a typical CLI command like esxcli without having to specify the host, username or password, like this:
esxcli network ip interface list
I could, of course, also write Linux-based shell scripts or run agents and not have to enter the hostname, username or password.