VMware

ESXCLI commands to configure VMware ESXi hosts for Starwind

Unsure if it survives upgrades yet….

 

Base commands as follows:

esxcli storage nmp device list | grep iSCSI
  Device Display Name: STARWIND iSCSI Disk (eui.46bed2d1ba1297d4)
  Device Display Name: STARWIND iSCSI Disk (eui.e1c4a9d50c1de985)
  Device Display Name: STARWIND iSCSI Disk (eui.75b468162d2473ac)
  Device Display Name: STARWIND iSCSI Disk (eui.0bd446722e88d9a6)

esxcli storage nmp device set --device eui.46bed2d1ba1297d4 --psp VMW_PSP_RR

esxcli storage nmp psp roundrobin deviceconfig set -d eui.46bed2d1ba1297d4 -t iops -I 1

 

Can be put in a script:

for i in `ls /vmfs/devices/disks/ | grep eui. | cut -b 1-20` ; do echo $i; esxcli storage nmp device set --device $i --psp VMW_PSP_RR; esxcli storage nmp psp roundrobin deviceconfig set --device $i -t iops -I 1;done
Posted by admin in VMware

vCenter Error – Exception occurred in install precheck phase

I see this one a fair bit, both in my own lab and in production environments, when doing vCenter updates.

The simplistic solution is to ssh to the vCenter appliance, log on with the root crednetials (not the Single Sign On ones), open a bash shell by typing shell, then removing a conf file:

rm /etc/applmgmt/appliance/software_update_state.conf

Retry the update from the VAMI interface again.

 

Anecdotally, it might coincide with aborted upgrades, but currently unable to confirm.

Posted by admin in VMware

New Edge and vCenter prompts

vCenter under the New Chromium based Edge browser always prompts when using the enhanced authentication plugin or VMRC.

To enable a checkbox to remember your setting, add the following registry key (you will have to create the Edge key)

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge

dword: ExternalProtocolDialogShowAlwaysOpenCheckbox = 1
Posted by admin in VMware

Suppressing System logs on host are stored on non-persistent storage

This occurs is the scratch location is to RAM, rather than a datastore, usually if the ESX boots from flash media (as writing the logs would accelerate flash wear).

Obviously the correct fix is to point it to a datastore:

Syslog.global.logDir = [<datastore-name>] /scratch/log

Syslog.global.logDirUnique = true

(The second is if multiple ESX’s are configured to write logs to same location)

However, there may be scenarios when this is not desirable. For example, if all your datastore storage is VSAN (which doesn’t support having the ESX hosting VSAN writing to its VSAN datastore), and you don’t care about the logs. You simply just need the message suppressed so as not to hide other errors.

Set:

Syslog.global.logHost = udp://127.0.0.1:514

(Or even to a valid syslog server if you have one)

Posted by admin in Computing Blogs, VMware

Using Tape Drive under ESX6

Ultimately, using PCI passthru will always work better if available, but…

esxcli storage nmp device list
naa.500110a00152f5ba
   Device Display Name: HP Serial Attached SCSI Tape (naa.500110a00152f5ba)
   Storage Array Type: VMW_SATP_ALUA
   Storage Array Type Device Config: {implicit_support=on; explicit_support=off; explicit_allow=on; alua_followover=on; action_OnRetryErrors=on; {TPG_id=0,TPG_state=AO}}
   Path Selection Policy: VMW_PSP_MRU
   Path Selection Policy Device Config: Current Path=vmhba3:C2:T0:L0
   Path Selection Policy Device Custom Config:
   Working Paths: vmhba3:C2:T0:L0
   Is USB: false

esxcli storage nmp satp list

esxcli storage nmp satp rule add -s VMW_SATP_LOCAL -V "HP" -M "Ultrium 5-SCSI"

esxcli storage core claiming unclaim -t location -A vmhba3 -C 2 -T 0 -L 0       <<< Must match your HBA

esxcfg-rescan vmhba3                         <<< Must match HBA

esxcli storage nmp device list
naa.600508b1001cac88dec8ea77b73b7083
   Device Display Name: Local HP Disk (naa.600508b1001cac88dec8ea77b73b7083)
   Storage Array Type: VMW_SATP_LOCAL
   Storage Array Type Device Config: SATP VMW_SATP_LOCAL does not support device configuration.
   Path Selection Policy: VMW_PSP_FIXED
   Path Selection Policy Device Config: {preferred=vmhba4:C0:T0:L6;current=vmhba4:C0:T0:L6}
   Path Selection Policy Device Custom Config:
   Working Paths: vmhba4:C0:T0:L6
   Is USB: false

Reboot ESX
References:

ESXi 5, HP P212 and LTO 5 tape drive goes offline

https://kb.vmware.com/s/article/1026157

Posted by admin in Computing Blogs, VMware

Installing VMware Enhanced Client Integration Plugin in Windows 10

Browse to your vcenter, and select Flash option. At login page, download the client using link at bottom, and save to disk.

Run this file from an Administrative user.

For IE:

Add the base vcenter FQDN (or IP, if using just that) to Local Intranet zone.

Download the Trusted certs from link in bottom right of https://<vcenter fqdn>/

Extract download.zip

Import the 2 certs (MMC > Add Snapin > Certificates > Local Computer, right click trusted roots, select import, and point at one of the extracted certs. Repeat import for other)

Run IE as Administrator (ie, use the “Run As Administrator” option, not just run as a user with Admin rights), and browse to vcenter FQDN, select Flash link, then on the popup, uncheck the box to ask every time, and select Allow.

All should work now

(If you use web proxies, ensure that https://vmware-plugin:8094 is in the proxy bypass list)

 

For Firefox

Browse to https://vmware-plugin:8094 (this is added to hosts file during client install) and accept the Exception for duff cert.

Browse to vcenter, and accept any Exceptions for duff certs.

All show work now

 

For Chrome

You’re a moron. Use a browser with some element of security.

Although its trivial to get the client to work, the fact is you should NEVER use Chrome on Windows, until Google go back to the drawing board and rewrite from scratch thinking about security from the start.

Posted by admin in VMware

Finding which VM has a MAC in a VMware environment

All the info I was finding was a grepping of the VMX files (always locked/busy on my ESX6.5 environment) or needed a Windows vCenter to run a Powershell command, not available on the current VCSA.

I found this little gem at https://github.com/lamw/vghetto-scripts/blob/master/shell/vswitchInfo.sh and duplicated here (Sept 2017) in case the original goes missing…

 

# Author: William Lam
# Website: www.virtuallyghetto.com
# Product: VMware ESXi
# Description: Query MACs on internal vSwitch
# Reference: http://www.virtuallyghetto.com/2011/05/how-to-query-for-macs-on-internal.html

if [[ $# -ne 1 ]] && [[ $# -ne 4 ]]; then
echo -e “Usage: $0 -l -v [vSWITCH] -p [PORT]\n”
echo ” -l List all ports of vSwitch(s)”
echo ” -v vSwitch to query”
echo ” -p Port to query on vSwitch”
echo -e “\n\t$0 -l”
echo -e “\t$0 -v vSwitch0 -p 1234\n”
exit 0
fi

if [ ! -e /sbin/vsish ]; then
echo “Script is only supported running on an ESXi host as vsish is not available by default on ESX”
exit 1
fi

VSISH_VSWITCH_PATH=/net/portsets

if [ $# -eq 1 ]; then
for vSwitch in $(vsish -e ls ${VSISH_VSWITCH_PATH});
do
VSWITCH=$(echo ${vSwitch} | sed ‘s/\///g’)
for port in $(vsish -e ls ${VSISH_VSWITCH_PATH}/${vSwitch}ports);
do
PORT=$(echo ${port} | sed ‘s/\///g’)
PORTINFO=$(vsish -e get ${VSISH_VSWITCH_PATH}/${vSwitch}ports/${port}status | sed ‘s/^[ \t]*//;s/[ \t]*$//’);
CLIENT=$(echo ${PORTINFO} | sed ‘s/ /\n/g’ | grep “clientName:” | awk -F “:” ‘{print $2}’)
MACADDRESS=$(echo ${PORTINFO} | sed ‘s/ /\n/g’ | grep “unicastAddr:” | uniq | sed ‘s/unicastAddr://;s/\(.*\)./\1/’)
echo -e “${VSWITCH}\t${PORT}\t${MACADDRESS%%::*}\t${CLIENT}”
done
done
fi

if [ $# -eq 4 ]; then
QUERY_PATH=”${VSISH_VSWITCH_PATH}/${2}/ports/${4}/status”
echo “Querying port path: ${QUERY_PATH}”
PNICS=$(vsish -e ls /net/portsets/${2}/uplinks/ | sed ‘$!N;s/\n/ /;s/\///g’)
echo -e “pNICS for vSwitch: ${PNICS}\n”
vsish -e get “${QUERY_PATH}”
fi

Posted by admin in VMware

Various VMware related snips

Using Tape drive as SCSI passthru, rather than whole controller.

Often causes glitches such as tape drive going offline after backup etc.

Possible solution, from https://communities.vmware.com/thread/334987 is:

Verify if the tape drive is using VMW_SATP_AULA (which is bad)

SSH into esxi 5 console

esxcli storage nmp device list

naa.500110a0014b774a

Device Display Name: HP Serial Attached SCSI Tape (naa.500110a0014b774a)

Storage Array Type: VMW_SATP_ALUA

Storage Array Type Device Config: {implicit_support=on;explicit_support=off; explicit_allow=on;alua_followover=on;{TPG_id=0,TPG_state=AO}}

Path Selection Policy: VMW_PSP_MRU

Path Selection Policy Device Config: Current Path=vmhba2:C0:T0:L0

Path Selection Policy Device Custom Config:

Working Paths: vmhba2:C0:T0:L0

Note: View the Storage Array Type

To change this to VMW_SATP_LOCAL

esxcli storage nmp satp rule add --satp=VMW_SATP_LOCAL --vendor="HP" --model="Ultrium 5-SCSI"

Next you need to remove any claims to that device

esxcli storage core claiming unclaim -t location -A vmhba1 -C 2 -T 0 -L 0

(your vmbha must match!)

esxcfg-rescan vmhba1
esxcli storage nmp device list

 

Reboot esxi host

Then add your Tape via SCSI device in the VM settings

Posted by admin in VMware