• Skip to primary navigation
  • Skip to content

jdgreen.io

The personal blog of James Green

  • Home
  • Technology
    • Announcements
    • Industry
    • Reviews/Guides
    • Tech Field Day
    • Interviews
  • Health
    • Food
    • Biohacking
    • Fitness
  • Faith
  • Book Notes
    • Business Books
    • Faith Books
    • Health Books
    • Technology Books
  • About
  • Show Search
Hide Search

plugin

Install/Uninstall plugins with vMA

James Green · Feb 14, 2014 ·

Sometimes you might run into a case (hopefully you don’t!) where a plugin needs to be installed on each ESXi host, but there’s no Update Manager instance handy to pass this out. I dealt with this situation recently by writing a couple of scripts to be run from a vMA that has targeted the vCenter server. It will go out and SCP the files to the host, then install the VIB. Sadly, the plugin didn’t get to stay. On the bright side, I got to generate an uninstall script as well! Below are both scripts. You run them in this fashion:

./install_vib.sh [vCenter server] [file with one host per line.txt]

They aren’t super robust, so make sure your inputs are right!

[code language=”bash”] #!/bin/bash

# run this script from vMA in this fashion: ./script.sh [vCenter Server] [file with on ESXi host on each line]

# validate that input has two parameters
if [ $# -ne 2 ]; then
echo "$0 [VCENTER] [HOSTS_FILE]"
exit 1
fi

# assign input args and username
VCENTER_HOST=$1
HOSTLIST=$2
export VI_USERNAME=root

# target vCenter server
source /opt/vmware/vma/bin/vifptarget -s ${VCENTER_HOST} > /dev/null 2>&1
echo -n "Now connected to: "
source /opt/vmware/vma/bin/vifptarget -d

# take inputs interactively
read -p "Enter VIB name: " VIB_NAME
read -p "Enter full .zip path on vMA: " VIB_PATH
read -s -p "Enter root password: " VI_PASSWORD ; export VI_PASSWORD

# show hosts to operate on
echo "Installing VIB on :"
cat $HOSTLIST

# SCP software, then install
if [ $? -eq 0 ]; then
IFS=$’n’ #one host to a line in the .txt file
for VI_HOST in $(cat ${HOSTLIST});
do
echo "Copying .zip files for ${VI_HOST}…"
echo "Enter password for ‘root’ to SCP file."
scp ${VIB_PATH} root@${VI_HOST}:/opt/$VIB_NAME.zip

echo "Installing VIB for ${VI_HOST}…"
esxcli –server ${VI_HOST} software vib install -n $VIB_NAME -d file:///opt/$VIB_NAME.zip
echo
done
unset IFS
else
echo "Unable to intialize installation.}"
fi

echo "Installation process complete."
[/code]

[Read more…] about Install/Uninstall plugins with vMA

Installing NetApp VAAI plugin for ESXi

James Green · Sep 23, 2013 ·

Often the storage offload capabilities of a storage array (VAAI in vSphere terms) need additional software to integrate with ESXi. This post will walk you through installing the NetApp plugin required to leverage VAAI on an NFS datastore. Good luck!

[Read more…] about Installing NetApp VAAI plugin for ESXi

Copyright © 2021 · Monochrome Pro on Genesis Framework · WordPress · Log in