VMware vMA and VIMA


vMA is a VMware RHEL5 (Redhat 5) virtual appliance that provides an environment similar to that of the classic ESX Service Console for centralized management and configuration of your ESX/ESXi host(s). vMA includes both the vCLI and vSphere SDK for Perl along with logging component called "vilogger" and authentication component called "vi-fastpass".

Update: Tips and Tricks with vMA 5.0

Check out the Getting started with vMA guide!

Here are some interesting scripts found on vMA:

The first tool is called bulkAddServers.pl which allows a user to specify a list of host(s) and providing a username/password once and the script will automatically import the entire list, without having to add each host manually and providing the credentials each time. [this works very if you have common account across all your host(s)].

The script is stored in: /opt/vmware/vima/samples/perl/bulkAddServers.pl

Sample file containing host(s) to add:

[vi-admin@rafaeli ~]$ cat hosts_to_add
everest.primp-industries.com
himalaya.primp-industries.com


Sample execution of adding two host(s):

[vi-admin@rafaeli ~]$ sudo /opt/vmware/vima/samples/perl/bulkAddServers.pl --filename hosts_to_add
Do you want to use the same password for all of the hosts (yes/no) : yes
Enter common root password:

All Targets Added Successfully.


Verify host(s) have been added:

[vi-admin@rafaeli ~]$ sudo vifp listservers
everest.primp-industries.com ESX
himalaya.primp-industries.com ESX


The next tool is primarly to help user's execute a command or series of command across a set of ESX(i) host(s), in the past you would need to manually do this for each of the manage host(s) with the vCLI/RCLI tools, say to add/update portgroup on a vSwitch for example. This can be pretty redudant and you could write a quck for loop to do this but VMware wrote a script called mcli which allows a user to execute a command and it's argument against a set of host(s) listed in a file.

The script is stored in: /opt/vmware/vima/samples/perl/mcli.pl


[vi-admin@rafaeli ~]$ /opt/vmware/vima/samples/perl/mcli.pl --help

Invalid arguments

Usage:
./mcli


Sample file containing host(s) to execute command against

[vi-admin@rafaeli ~]$ cat hosts_to_execute_cmd_on
everest.primp-industries.com
himalaya.primp-industries.com


Sample execution to check for syslog configuration

[vi-admin@rafaeli ~]$ /opt/vmware/vima/samples/perl/mcli.pl hosts_to_execute_cmd_on esxcfg-syslog --show

everest.primp-industries.com:
No remote syslog server configured.

himalaya.primp-industries.com:
No remote syslog server configured.



9 comments:

  1. nice ... but what is VIMA ?? other than being in a path

    ReplyDelete
  2. William - Is it possible to build a vMA kind of appliance on windows - as vCLI and vSphere SDK for Perl are available anyhow. what about fast pass? is this an open-source component?

    what are the steps involved here?

    ReplyDelete
  3. @ramd

    vMA includes the following as you may or may not know:

    * vCLI which is basically uses vSphere SDK for Perl which is included when you install vCLI
    * vi-logger component (think syslogd)
    * vi-fastpass

    If you have a management system whether that is Windows or Linux, you can replicate the first two. Install vCLI and you'll automatically get the vSphere SDK for Perl and this can be installed on either a remote Linux or Windows system. You will not have a pretty component such as vi-logger, but it's basically a syslog daemon which you can easily find one on the internet. Only the vi-fastpass component can not be replicated but if you're on Windows, you're most likely using AD and you can use windows passthrough auth or providing your windows credential.

    ReplyDelete
  4. Hi ,

    I have problem when i try to use this mcli script.
    I don't see to ask me for USER / PASS and when i hit enter 2 times after executing command i get this:
    [root@perl]# ./mcli.pl file esxcfg-nics -l

    server.DOMAIN.local:


    Enter username: Enter password: Cannot complete login due to an incorrect user name or password.

    When i type my USER / PASS after "server.DOMAIN.local:" I have result's

    [root@perl]# ./mcli.pl file esxcfg-nics -l

    server.DOMAIN.local:
    root <== here i type user
    <== here i type pass

    Enter username: Enter password:
    Name PCI Driver Link Speed Duplex MAC Address MTU Description
    vmnic0 02:00.0 bnx2 Up 1000Mbps Full 1500 Broadcom Corporation NC382i Integrated Quad Port PCI Express Gigabit Server Adapter
    vmnic1 02:00.1 bnx2 Up 1000Mbps Full 1500 Broadcom Corporation NC382i Integrated Quad Port PCI Express Gigabit Server Adapter

    As you see "Enter username: Enter password:" are after i type my USER / PASS

    Do you know why I can't see prompt for USER / PASS or this is normal.

    I test this situation with two different vMA 4.0 and ESX 3.5 and ESXi 4.1 situation is SAME i don't see asking me for USER / PASS.

    Any ideas.

    ReplyDelete
  5. @Valentin,

    For mcli to work,you must have vi-fastpass (fpauth) enabled targets. Are you able to see these targets when you run the "vifp listservers" command?

    ReplyDelete
  6. I have already configured it.

    [root@ ~]# vifp listservers
    server.DOMAIN.local ESXi

    [root@ ~]# vifpinit server.DOMAIN.local

    [root@ ~][server.DOMAIN.local]# esxcfg-nics -l
    Name PCI Driver Link Speed Duplex MAC Address MTU Descri ption
    vmnic0 02:00.0 bnx2 Up 1000Mbps Full 1500 Broadc om Corporation NC382i Integrated Quad Port PCI Express Gigabit Server Adapter
    vmnic1 02:00.1 bnx2 Up 1000Mbps Full 1500 Broadc om Corporation NC382i Integrated Quad Port PCI Express Gigabit Server Adapter
    [root@ ~][server.DOMAIN.local]#

    My vMA is version 4.0 (ESX host is ESXi 4.1 version) but I try this on ESX 3.5 version and same problem.

    As you see here I can set target and execute command without authentication but when i try to use mcli i get this situation in my last post.

    I'm sure i have something wrong in this env because i my home lab this works.

    ReplyDelete
  7. @Valentin,

    Well first off, if your ESX(i) host is 4.1 and you're vMA is 4.0, that's is an issue. Please use a vMA 4.1, remember it's not forward compatible but it's backwards compatible. It won't break support for ESX 3.5 or 4.0 but it's required to support 4.1 hosts.

    ReplyDelete
  8. Is it possible to port an agent that is running in Service Console of an ESX 4.0 into a vMA so that we can support ESXi 5.0 ? Given that Service Console is gone in 5.0, we are wondering if this is a route we can take. The agent (c++ developed) is used to monitor the adapter card in the ESX host.

    ReplyDelete
  9. The script in my /opt/vmware/vma/samples/perl

    ReplyDelete