The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,651 other followers

Archive for the ‘Virtualization’ Category

My LSI adapters and ESXi 6.5

Posted by jpluimers on 2019/05/03

So I won’t forget:

Direct download links in September 2017:

[WayBack] How to upgrade LSI MegaRaid SAS controller firmware using FreeDOS – Teksupport.in

Notes:

LSI provider install (SIM-S, SIMS, CIM, WEBM):

  1. Download the latest version (at the time of writing VMW-ESX-5.5.0-lsiprovider-500.04.V0.66-0002-5751577.zip)
  2. Unzip into /tmp
  3. esxcli software vib install -f -v /tmp/vmware-esx-provider-lsiprovider.vib
  4. wait for the VIB install to complete
  5. suspend or shutdown all VMs
  6. reboot the ESXi machine
  7. esxcli system wbem set --enable true
  8. Browse to https://192.168.71.91/ui/#/host/monitor/hardware/storage to see if SIM-S is working

MegaRAID Storage Manager (MSM) operation notes

A few tricky things to get right:

  • waiting: MSM is unbelievably slow (starting on SSD takes 10 seconds; discovery 30; connecting to host 60 – without any indication something is happening; fetching host data another 60;
  • old MSM versions are unstable (especially 14.x and lower), so keep current
  • ensure the hosts file on both the ESXi and Windows side match (otherwise it won’t discover anything, or discover as 0.0.0.0)
  • enable promiscuous mode on your vSwitch
  • if all else fails, disable any firewalls then enable bit by bit to see where it went wrong

Great installation steps:

MegaCLI installs

  1. Download the latest version that has VMware support (at the time of writing 8-07-07_MegaCLI.zip)
  2. Unzip into /tmp
  3. esxcli software vib install -f -v /tmp/VmwareMN/vmware-esx-MegaCli-8.07.07.vib
  4. wait for the VIB install to complete

Now you can the command /opt/lsi/MegaCLI/MegaCli (yes the casing of these two is different!) but you must to it in that directory, or ensure the LD_LIBARY_PATH contains /opt/lsi/MegaCLI.

StorCLI installs

Based on [WayBackStorCLI unter VMware vSphere installieren – Thomas-Krenn-Wiki

  1. Download the latest version that has VMware support (at the time of writing 1.23.02_StorCLI.zip)
  2. Recursively uncompress the ZIP file into /tmp**
  3. esxcli software vib install -f -v /tmp/storcli_All_OS/Vmware-OP/vmware-esx-storcli-1.23.02.vib
  4. wait for the VIB install to complete

Now you can the command /opt/lsi/storcli/storcli but you must to it in that directory, or ensure the LD_LIBARY_PATH contains /opt/lsi/storcli.

Example:

execute-storcli.sh /cALL show all | grep 'Controller = \|Model = \|Serial Number = \|Firmware'a

The vib file in "Vmware-NDS/" folder works with native driver.
The vib file in "Vmware-MN/" folder works with VMKlinux driver.

So I did a bit more searching based on the files in the VMware directories and came up with this list:

  • storcli_All_OS/Vmware/storcli.zip
    • Looks like it targets ESXi 3.x and older
  • storcli_All_OS/Vmware-MN/vmware-esx-storcli-1.23.02.vib wit  storcli_All_OS/Vmware-MN/VMWARE_MN_Readme.txt
    • Targets the vmklinux drivers that are being phased out with ESXi 5.5 and up
  • storcli_All_OS/Vmware-OP/vmware-esx-storcli-1.23.02.vib with storcli_All_OS/Vmware-OP/VMWARE_MN_NDS_Readme.txt
    • Targets the New Driver architecture introduced with ESXi 5.5 and used more and more since then

Background reading:

** unzip doesn’t work:

# unzip -d /tmp/ 1.23.02_StorCLI.zip
Archive: 1.23.02_StorCLI.zip
inflating: 1.23.02_StorCLI.txt
unzip: short read

But a combination of 7za and unzip does work:

# 7za x -o/tmp/ 1.23.02_StorCLI.zip
7-Zip (a) [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,32 bits,20 CPUs Intel(R) Xeon(R) CPU E5-2630L v4 @ 1.80GHz (406F1),ASM,AES-NI)

Scanning the drive for archives:
1 file, 48778476 bytes (47 MiB)

Extracting archive: 1.23.02_StorCLI.zip
--
Path = 1.23.02_StorCLI.zip
Type = zip
Physical Size = 48778476

Everything is Ok

Files: 2
Size: 48928561
Compressed: 48778476

# unzip -d /tmp/ /tmp/storcli_All_OS.zip 
Archive:  /tmp/storcli_All_OS.zip
   creating: storcli_All_OS/
   creating: storcli_All_OS/EFI/
  inflating: storcli_All_OS/EFI/license.txt
   creating: storcli_All_OS/EFI/UDK/
  inflating: storcli_All_OS/EFI/UDK/license.txt
  inflating: storcli_All_OS/EFI/UDK/storcli.efi
   creating: storcli_All_OS/FreeBSD/
  inflating: storcli_All_OS/FreeBSD/FreeBSD_readme.txt
  inflating: storcli_All_OS/FreeBSD/license.txt
  inflating: storcli_All_OS/FreeBSD/storcli.tar
  inflating: storcli_All_OS/FreeBSD/storcli64.tar
   creating: storcli_All_OS/Linux/
  inflating: storcli_All_OS/Linux/license.txt
  inflating: storcli_All_OS/Linux/LINUX_Readme.txt
  inflating: storcli_All_OS/Linux/storcli-1.23.02-1.noarch.rpm
   creating: storcli_All_OS/Linux-OEL-Sparc/
  inflating: storcli_All_OS/Linux-OEL-Sparc/license_OELSparc.txt
  inflating: storcli_All_OS/Linux-OEL-Sparc/storcli64-1.23.02-1.sparc64.rpm
   creating: storcli_All_OS/Linux-ppc/
   creating: storcli_All_OS/Linux-ppc/Big Endian/
  inflating: storcli_All_OS/Linux-ppc/Big Endian/license.txt
  inflating: storcli_All_OS/Linux-ppc/Big Endian/storcli.tar
   creating: storcli_All_OS/Linux-ppc/Little Endian/
  inflating: storcli_All_OS/Linux-ppc/Little Endian/license.txt
  inflating: storcli_All_OS/Linux-ppc/Little Endian/Readme.txt
  inflating: storcli_All_OS/Linux-ppc/Little Endian/storcli64_1.23.02_ppc64el.deb
   creating: storcli_All_OS/Solaris/
  inflating: storcli_All_OS/Solaris/license.txt
  inflating: storcli_All_OS/Solaris/SOLARIS_Readme.txt
  inflating: storcli_All_OS/Solaris/storcli.pkg
   creating: storcli_All_OS/Solaris Sparc/
  inflating: storcli_All_OS/Solaris Sparc/license.txt
  inflating: storcli_All_OS/Solaris Sparc/storcli.pkg
   creating: storcli_All_OS/Ubuntu/
  inflating: storcli_All_OS/Ubuntu/read_me.txt
  inflating: storcli_All_OS/Ubuntu/storcli_1.23.02_all.deb
   creating: storcli_All_OS/Vmware/
  inflating: storcli_All_OS/Vmware/license.txt
   creating: storcli_All_OS/Vmware/Linux/
  inflating: storcli_All_OS/Vmware/Linux/storcliKL-1.23.02-1.noarch.rpm
  inflating: storcli_All_OS/Vmware/Rel_read_me.txt.txt
  inflating: storcli_All_OS/Vmware/storcli.zip
   creating: storcli_All_OS/Vmware/Windows/
  inflating: storcli_All_OS/Vmware/Windows/StorCLIKL.zip
   creating: storcli_All_OS/Vmware-MN/
  inflating: storcli_All_OS/Vmware-MN/license.txt
  inflating: storcli_All_OS/Vmware-MN/vmware-esx-storcli-1.23.02.vib
  inflating: storcli_All_OS/Vmware-MN/VMWARE_MN_Readme.txt
   creating: storcli_All_OS/Vmware-OP/
  inflating: storcli_All_OS/Vmware-OP/license.txt
  inflating: storcli_All_OS/Vmware-OP/vmware-esx-storcli-1.23.02.vib
  inflating: storcli_All_OS/Vmware-OP/VMWARE_MN_NDS_Readme.txt
   creating: storcli_All_OS/Windows/
  inflating: storcli_All_OS/Windows/license.txt
  inflating: storcli_All_OS/Windows/storcli.exe
  inflating: storcli_All_OS/Windows/storcli64.exe
  inflating: storcli_All_OS/Windows/WIN_ReadMe.txt

9260-8i firmware update

  1. Download the latest firmware (at the time of writing 12.15.0-0239_MR_2108_SAS_FW_2.130.403-4660.zip) into /tmp
  2. unzip -d /tmp/ /tmp/12.15.0-0239_MR_2108_SAS_FW_2.130.403-4660.zip
  3. Find out the controller number
  4. Where 0 is the controller number, execute/opt/lsi/storcli/storcli /c0 download file=/tmp/mr2108fw.rom
  5. Wait for the firmware update to complete
  6. Suspend or shutdown all VMs
  7. Reboot

–jeroen

Posted in ESXi6.5, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

Show SCSI / HBA modules in ESXi 6.5 with file and version information

Posted by jpluimers on 2019/05/02

A small script I made: Show SCSI / HBA modules in ESXi 6.5 with file and version information:

MODULES=`esxcfg-scsidevs --hbas | awk 'FNR > 0 {print $2}'`
for MODULE in $MODULES ; do
    # echo "Probing $MODULE"
    vmkload_mod --showinfo $MODULE | grep 'file: \|Version'
done

The script is based on ideas from [WayBackDetermining Network/Storage firmware and driver version in ESXi 4.x and later (1027206) | VMware KB

It works in at least ESXi 6.5 where it shows this on one of my systems:

 input file: /usr/lib/vmware/vmkmod/lsi_msgpt3
 Version: 12.00.02.00-11vmw.650.0.0.4564106
 input file: /usr/lib/vmware/vmkmod/vmw_ahci
 Version: 1.0.0-39vmw.650.1.26.5969303
 input file: /usr/lib/vmware/vmkmod/vmw_ahci
 Version: 1.0.0-39vmw.650.1.26.5969303
 input file: /usr/lib/vmware/vmkmod/vmw_ahci
 Version: 1.0.0-39vmw.650.1.26.5969303
 input file: /usr/lib/vmware/vmkmod/lsi_mr3
 Version: 6.910.18.00-1vmw.650.0.0.4564106
 input file: /usr/lib/vmware/vmkmod/megaraid_sas
 Version: Version 6.603.55.00.2vmw, Build: 4564106, Interface: 9.2 Built on: Oct 26 2016
 input file: /usr/lib/vmware/vmkmod/vmkusb
 Version: 0.1-1vmw.650.1.26.5969303

–jeroen

Read the rest of this entry »

Posted in bash, Development, ESXi6.5, Power User, Scripting, Software Development, Virtualization, VMware, VMware ESXi | Leave a Comment »

bash – aliasing cd to pushd – is it a good idea? – Unix & Linux Stack Exchange

Posted by jpluimers on 2019/04/30

On my research list: [WayBackbash – aliasing cd to pushd – is it a good idea? – Unix & Linux Stack Exchange

It has a nice discussion on complements to pushd/popd/cd/dirs including a very nice set of navd scripts that eases the navigation of the directory stack.

I found it because the ESXi busybox does not have pushd and popd and a cd won’t work from inside a shell script: [WayBacklinux – Why doesn’t “cd” work in a bash shell script? – Stack Overflow

It also made me find out that the ESXi busybox does support cd - to go to the previous directory. More info on that cd syntax is at [WayBack] bash – Difference between “cd -” and “cd ~-” – Unix & Linux Stack Exchange

–jeroen

Posted in *nix, bash, Development, ESXi5, ESXi5.1, ESXi5.5, ESXi6, ESXi6.5, Power User, Scripting, Software Development, Virtualization, VMware, VMware ESXi | Leave a Comment »

lamw/ghettoVCB: ghettoVCB

Posted by jpluimers on 2019/04/29

I found out that I had some very old draft notes below, but since then the source has moved to github: lamw/ghettoVCB: ghettoVCB.

Since I find VIB easier to use than the Offline Bundle (for differences see [WayBackVIB vs. Offline Bundle and [WayBack] VMware Front Experience: ESXi Community Packaging Tools) these are the VIB steps to get it installed:

  1. Download https://github.com/lamw/ghettoVCB/raw/master/vghetto-ghettoVCB.vib
  2. Put it in the /tmp directory on your ESXi box (using for instance FileZilla, WinSCP, SCP or other tools)
  3. Install it using esxcli software vib install -v /tmp/vghetto-ghettoVCB.vib -f

Then use it to make backups or restores as described at:

Note that contrary to the documentation, the config file has moved to /etc/ghettovcb/ghettoVCB.conf.

Because of Keeping your root visorfs clean: point the path to your own binaries stored on a vmfs volume I’m using a copy of that stored in my local-bin directory (which is backed-up by rsync to another disk) and a small ghettoVcb.sh bootstrap script referencing that config-file, so the backup command for one command now is this:

ghettoVcb.sh -m diaspore.opensuse-Tumbleweed-x64

or this for all VMs (about 2 hours from NVME SSD to HDD; will probably make this a 2 stage thing):

ghettoVcb.sh -a

VMs are backed-up under the directory specified in VM_BACKUP_VOLUME(below that’s ./) in a schema like this:

./diaspore.opensuse-Tumbleweed-x64
./diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64-2017-09-24_16-07-08
./diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64-2017-09-24_16-07-08/diaspore.opensuse-Tumbleweed-x64.vmx
./diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64-2017-09-24_16-07-08/diaspore.opensuse-Tumbleweed-x64-flat.vmdk
./diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64-2017-09-24_16-07-08/diaspore.opensuse-Tumbleweed-x64.vmdk
./diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64-2017-09-24_16-07-08/STATUS.ok

In the future, I might move to an NFS based back-up based on these links:

–jeroen

Very old notes:

 

–jeroen

Posted in ESXi4, ESXi5, ESXi5.1, ESXi5.5, ESXi6, ESXi6.5, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

Keeping your root visorfs clean: point the path to your own binaries stored on a vmfs volume

Posted by jpluimers on 2019/04/26

Some interesting commands derived from [WayBackESXi/ESX error: No free space left on device (1007638) | VMware KB:

  • finding large files:
    find / -path "/vmfs" -prune -o -type f -size +50000k -exec ls -lh '{}' \;
  • finding space on the root file system (which is not listed in df -h):
    stat -f /

This was in the process of trying to keep my local binaries out of [WayBackVisorFS: A Special-purpose File System for Efficient Handling of System Images – VMware Labs as it is inherently small in size (both total size and number of inodes) as it is a RAM disk based file system.

Based on that, at [WayBackTrouble shooting – esx.problem.visorfs.ramdisk.full – DefinIT I found this even more useful statement vdf -h | grep "%\|Ramdisk" which shows the exact usage of what’s in this filesystem. Example output on one of my systems:

# vdf -h | grep "%\|Ramdisk"
Ramdisk                   Size      Used Available Use% Mounted on
root                       32M        1M       30M   6% --
etc                        28M      184K       27M   0% --
opt                        32M        0B       32M   0% --
var                        48M      352K       47M   0% --
tmp                       256M        4K      255M   0% --
iofilters                  32M        0B       32M   0% --
hostdstats                678M        4M      673M   0% --

The easiest is not to store them in the root file system at all, but then you need to alter the default path:

# echo $PATH
/bin:/sbin

Since my local binaries are at /vmfs/volumes/Samsung512NVME/local-bin/, I wanted to persist this path change:

export PATH=$PATH:/vmfs/volumes/Samsung512NVME/local-bin/

Basically you can do this with any current directory on your system: export PATH=$PATH:`pwd`

The easiest way to persist that path is to ensure you can shoehorn the effect in a file that gets started during bootup.

The standard – but unsupported – way to do that is shown for instance by:

Final solution

So, edit vi /etc/rc.local.d/local.sh, then shutdown all your VMs and reboot the system to verify the effects. However inserting that export isn’t enough. This is the line you need to add before the exit 0:

sed -i -e 's!PATH=/bin:/sbin!PATH=/bin:/sbin:/vmfs/volumes/Samsung512NVME/local-bin/!' /etc/profile

Related

  • [WayBack] ESXi: Aliases definieren › /dev/blog/ID10T
  • [Archive.is] Solved: How to keep a .profile in / of ESXi? |VMware Communities

    ESXi does not remove that file on boot-up, it simply does not save it. ESXi runs from memory. So if you created some file (i.e. /.profile) it is only in “memory-disk”, not in disk-image which is loaded again at the next boot-up.

    Either create custom vib and install it as every other, or use rc.local which is persistent (any changes you make to this file survive boot-up). You can create & save that file somewhere else and use rc.local to copy it to /, or use rc.local with shell commands to create .profile at every boot-up.

    Wait a minute, you are using ESXi 6.0, right? I’m not sure if there is /etc/rc.local, but it used to be in 5.0/5.5…

    I edited /etc/rc.local.d/local.sh to copy the file that I keep on one of my datastores. After reboot, it worked fine. (So, yes, this does work in 6.0.) Thanks!

    I’m glad it worked for you. BTW you are right: instead of single file /etc/rc.local (as in 5.0) there is now the whole sub-dir /etc/rc.local.d/ but functionality is the same…

–jeroen

Posted in ESXi5, ESXi5.1, ESXi5.5, ESXi6, ESXi6.5, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

 
%d bloggers like this: