• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Using the vMA to rescan my HBA’s

repping · Mar 19, 2011 ·

Customer requested output for all HBA controllers of the ESXi hosts. Because ESXi is used we decided to do generate this output through the vMA appliance.

Here is how we did this:

* optional *
$ ssh vi-admin@vMA.appliance
$ vifp addserver ESXi_Host
$ vifp listservers

output:
host1.environment   ESXi
host2.environment   ESXi
vCenter.environment  vCenter
* optional *

The above was just to show how we connect to the vMA, add an ESXi host as a target and display all hosts that are listed.

Now the script that I used is based on a script originally created by William Lam. I liked this script mainly because it used an input file for the hosts and showed me how to loop through this therefore I modified it slightly to the following end-result:

#!/bin/bash
if [ $# -ne 2 ]; then
echo “$0 [VCENTER_SERVER] [HOST_INPUT_FILE]”
exit 1
fi
VCENTER_HOST=$1
HOSTLIST=$2
source /opt/vmware/vma/bin/vifptarget -s ${VCENTER_HOST} > /dev/null 2>&1
if [ $? -eq 0 ]; then
IFS=$’\n’
for VIHOST in $(cat ${HOSTLIST});
do
echo “Rescan HBA for Host: ${VIHOST}”
/usr/bin/esxcfg-rescan -h ${VIHOST} vmhba2
/usr/bin/esxcfg-rescan -h ${VIHOST} vmhba3
echo “Generating output for Host: ${VIHOST}”
/usr/bin/vicfg-mpath -h ${VIHOST} -L > /tmp/output-${VIHOST}.txt
echo
done
unset IFS
else
echo “Unable to intialize vi-fastpass on target ${FIST_HOST}”
fi

The script is run as follows: ./HBArescan vCenter input.csv. Output given can be edited with for instance Excel and will display all HBA information.
-Ray

Share it:

  • Tweet

Related

Management & Automation, Server

Reader Interactions

Comments

  1. m says

    21 March, 2011 at 13:37

    Hi, could not find another way to contact you than this.. I have a question unrelated to this blog post.

    Do you have any experience limiting the network bandwith of a single VM?

    I found the following options, and was hoping you could give me some insight to them:
    ethernetX.rxbw.limit
    ethernetX.txbw.limit

Primary Sidebar

About the author

Duncan Epping is a Chief Technologist in the Office of CTO of the Cloud Platform BU at VMware. He is a VCDX (# 007) and the author of the "vSAN Deep Dive" and the “vSphere Clustering Technical Deep Dive” series.

Upcoming Events

04-Mar-21 | Polish VMUG – Roadshow
09-Mar-21 | Austria VMUG – Roadshow
16-Mar-21 | VMUG Turkey – Roadshow
18-Mar-21 | St Louis Usercon Keynote
26-Mar-21 | Hungary VMUG – Roadshow
08-Apr-21 | VMUG France – Roadshow

Recommended reads

Sponsors

Want to support us? Buy an advert!

Advertisements

Copyright Yellow-Bricks.com © 2021 · Log in