List the vmid values, power status and name of all VMs
Back to the listing script vim-cmd-list-all-VMs.sh:
#!/bin/sh
# https://wiert.me/2021/04/29/vmware-esxi-console-viewing-all-vms-suspending-and-waking-them-up-part-4/
vmids=`vim-cmd vmsvc/getallvms | sed -n -E -e "s/^([[:digit:]]+)\s+((\S.+\S)?)\s+(\[\S+\])\s+(.+\.vmx)\s+(\S+)\s+(vmx-[[:digit:]]+)\s*?((\S.+)?)$/\1/p"`
for vmid in ${vmids} ; do
powerState=`vim-cmd vmsvc/power.getstate ${vmid} | sed '1d'`
name=`vim-cmd vmsvc/get.config ${vmid} | sed -n -E -e '/\(vim.vm.ConfigInfo\) \{/,/files = \(vim.vm.FileInfo\) \{/ s/^ +name = "(.*)",.*?/\1/p'`
vmPathName=`vim-cmd vmsvc/get.config ${vmid} | sed -n -E -e '/files = \(vim.vm.FileInfo\) \{/,/tools = \(vim.vm.ToolsConfigInfo\) \{/ s/^ +vmPathName = "(.*)",.*?/\1/p'`
echo "VM with id ${vmid} has power state ${powerState} (name = ${name}; vmPathName = ${vmPathName})."
done
It uses vim-cmd vmsvc/getallvms, vim-cmd vmsvc/power.getstate and vim-cmd vmsvc/get.config with some sed and a for loop from dash to generate a nice list of information.
A long time ago, I already figured out that vim-cmd vmsvc/get.guest # gives all guest information including network information for a running VM that has either VMware Tools or open-vm-tools running (see VMware ESXi console: viewing all VMs, suspending and waking them up: part 3 for the difference between these two tools).
A full output of a sample VM is below the signature.
There are a few places that have the LAN ipAddress. For now, I choose to use only the IPv4 main address from ipAddress, which is in between (vim.vm.GuestInfo) { and net = (vim.vm.GuestInfo.NicInfo) [.
I needed a way to append the directory of a script to the path as all my tool scripts are in there, and I did not want to modify any profile scripts as these might be modified during ESXi upgrade.
First you need the full script filename through readlink then toe parent directory name through dirname:
I created the script below. It is not perfect, but for my situation it gets the job done.
If you do not start a new shell, then the export is lost as a new dash shell process is started for each script that runs from the terminal or console.
# cat /opt/bin/append-script-directory-to-path-and-start-new-shell.sh#!/bin/sh
# Absolute path to this script, e.g. /home/user/bin/foo.sh
# echo "'$0'"
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname "$SCRIPT")
# echo Appending to $PATH: $SCRIPTPATH
export PATH=$PATH:$SCRIPTPATH
sh
Note that I dislike ScanSnap Cloud, as I do not want an intermediate party in between me and my cloud provider.
I much more prefer providers like Google Drive, OneDrive, etc to configure locally and have them upload to the cloud instead of ScanSnap Could also seeing my scanned content.
Today, 20 years ago, the Wayback Machine started to unlock the archived content that the Internet Archive had been crawling since 1996 and make it accessible for the public at large.
Thanks Brewster Kahle for making all of this possible for such a long time!
If you think download speeds are slow for large downloads (or multi-media playback is slow or quality is low) on a fast link, then consider your DNS.
Many people report that using one of the centralised DNS services (like Google/Cloudflare/…) causes slowness because they direct CDN lookups to a small pool of servers that get overloaded.
De niet-reanimerenpenning is een behandelverbod ten aanzien van reanimeren. Een verklaring aan een halskettinkje, voorzien van pasfoto, handtekening, naam en geboortedatum.
Een tatoeage met de tekst die aangeeft dat de drager ervan niet gereanimeerd wil worden, is volgens minister Schippers van Volksgezondheid rechtsgeldig.