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,862 other subscribers

Archive for the ‘ESXi5.5’ Category

vim-cmd suspending/resuming a bunch of VMs

Posted by jpluimers on 2016/09/13

These two vim-cmd scripts come in very handy:


#!/bin/sh
VMS=`vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}'`
for VM in $VMS ; do
# echo "Probing VM with id: $VM."
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "VM with id $VM has power state $PWR (name = $name)."
done


#!/bin/sh
# https://wiert.me/2021/04/30/vmware-esxi-console-viewing-all-vms-suspending-and-waking-them-up-part-5/
RUNNING=0
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
# echo "Probing VM with id: $vmid."
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})."
if [ "${powerState}" == "Powered on" ] ; then
RUNNING=1
echo "Powered on VM with id ${vmid} and name: $name"
echo "Suspending VM with id ${vmid} and name: $name"
vim-cmd vmsvc/power.suspend ${vmid} > /dev/null &
fi
done
while true ; do
if [ $RUNNING -eq 0 ] ; then
echo "Gone…"
break
fi
RUNNING=0
for vmid in ${vmids} ; do
# echo "Probing VM with id: $vmid."
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})."
if [ "${powerState}" == "Powered on" ] ; then
RUNNING=1
echo "Waiting for id ${vmid} and name: $name…"
fi
done
sleep 1
done
exit 0


#!/bin/sh
SUSPENDED=0
VMS=`vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}'`
VMstateToProcess="Suspended"
for VM in $VMS ; do
# echo "Probing VM with id: $VM."
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "VM with id $VM has power state $PWR (name = $name)."
if [ "$PWR" == "$VMstateToProcess" ] ; then
SUSPENDED=1
echo "Suspended VM with id $VM and name: $name"
echo "Resuming VM with id $VM and name: $name"
# you'd think power.suspendResume is the inverse of power.suspend, but actually power.on is:
vim-cmd vmsvc/power.on $VM > /dev/null &
fi
done
while true ; do
if [ $SUSPENDED -eq 0 ] ; then
echo "Gone…"
break
fi
SUSPENDED=0
for VM in $VMS ; do
PWR=`vim-cmd vmsvc/power.getstate $VM | grep -v "Retrieved runtime info"`
if [ "$PWR" == "$VMstateToProcess" ] ; then
name=`vim-cmd vmsvc/get.config $VM | grep -i "name =" | awk '{print $3}' | head -1 | awk -F'"' '{print $2}'`
echo "Waiting for id $VM and name: $name…"
SUSPENDED=1
fi
done
sleep 1
done

–jeroen

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

Some notes on apcupsd, a SUA3000XLI and a SUA48XLBP battery pack

Posted by jpluimers on 2016/08/22

I’ve had a SUA3000XLI for years using the USB cable and default Windows support as PowerChute Personal Edition would fail to recognise it and abort installation (so I could not use APC drivers as described on youtube).

A while ago, Liander – the energy distribution company – wanted to replace both the gas and electricity meters to become “smart” during day time. The server configuration load was heavy enough for Windows to indicate the UPS would last about 30 minutes. At night that’s not much of a problem but during 1 hour replacement day-time it would be a problem.

So I bought a SUA48XLBP battery pack (and a SUA039 cable as the cable wasn’t long enough to keep an inch or so air space between UPS and battery pack) so the battery would last about 3 times as long.

Windows would still show it would last about 30 minutes. Strange. So I started looking around and it appeared the SUA3000XLI needed calibration which requires PowerChute. Since PowerChute won’t work, I was almost back at square 1. Almost, as I know knew it required calibration.

In the past I had come across apcupcd but that was a long time ago when it supported a limited set of operating systems and a limited set of features so I never installed it.

But when searching how to calibrate the without using PowerChute, it quickly appeared that the apctest part of apcupsd can do just that: soft calibrate the UPS/battery combo. There are some steps and prerequisites (the most important ones are to turn off the apcupsd and provide enough load and 100% battery charge at start).

Spoiler: the combined UPS/battery-pack now lasts for almost 2 hours which is long enough.

Installing apcupsd

I’m describing this from a Windows perspective and it’s dead easy:

  1. download the latest release
  2. run the installer
  3. allow the driver to be installed
    1. indicate it’s OK to install an unsigned driver
    2. now Windows won’t recognise the UPS any more, but in a few steps the apcupsd and helper program will
  4. update the configuration file (no changes needed when it’s a USB connected one)
  5. wait for the service to start
  6. wait for the apctray helper program to start
  7. look in the “system tray” for apctray helper program icon 
  8. optionally configure your system to auto-start apctray after logon

The USB connection to the UPS delivers slightly less options than using a serial cable

Using a serial cable instead of a USB one

Read the rest of this entry »

Posted in APC Smart-UPS, apcupsd, ESXi5, ESXi5.1, ESXi5.5, ESXi6, Liander, Power User, UPS, Virtualization, VMware, VMware ESXi, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2003, Windows Server 2003 R2, Windows XP | 1 Comment »

Some links on Hyperthreading, ESXi and vSphere

Posted by jpluimers on 2016/07/22

In case I bump into vSphere/ESXi machines that have hyper threading (HT) enabled:

–jeroen

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

OpenSuSE Tumbleweed notes

Posted by jpluimers on 2016/06/13

After zypper dup (dist-upgrade) or zypper up (update) a zypper ps will list processes using deleted files (i.e. processes that likely need to be restarted).

Some processes that can be restarted without reboot:

To research

  • dhcpcd
  • rs:main
  • agetty
  • lvmetad
  • agetty
  • dmeventd

Some processes that require a reboot:

–jeroen

Posted in *nix, ESXi5, ESXi5.1, ESXi5.5, ESXi6, Linux, openSuSE, Power User, SuSE Linux, Virtualization, VMware, VMware ESXi | Leave a Comment »

Many Cores per Socket or Single-Core Socket Mystery | VirtualPharaohs

Posted by jpluimers on 2016/05/30

Interesting:

Summary:

  1. It is for virtual NUMA, and it depends.
  2. It is only helpful if the host can do NUMA.
  3. It is only relevant when you allocate more than 8 effective cores for a VM.

When neither apply: just use “number of cores per socket” as “number of virtual sockets” might be limited in the guest operating system licensing.

–jeroen

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

“Unable to connect to the MKS”: the port 902 problem.

Posted by jpluimers on 2016/05/23

A message like “Unable to connect to the MKS” usually does not mean you have reached the maximum of 10 connections for a VM.

Usually it means there is some network issue, like a firewall or router misconfiguration.

Port 902 is used (both TCP and UDP) to provide (among others, hence MKS) console connections.

The default MKS port is 902, and you cannot change it.

For vCenter it is even worse as you cannot even go through NAT:

About the only solution is to tunnel through SSH: VMWare vSphere Client Remote Access via SSH Tunnel and redirect ports 443, 902 and 903.

–jeroen

via:

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

Lantronix SpiderDuo Remote KVM Switch: Affordable KVM Over IP Switches

Posted by jpluimers on 2016/05/02

Lantronix SpiderDuo Remote KVM Switch: Affordable KVM Over IP Switches.

Interesting KVM-over-IP solution.

–jeroen

via: A bunch of stuff broke this month, learned a lot fixing it all | TinkerTry IT @ Home.

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

SATA controller links for ZFS and ESXi

Posted by jpluimers on 2016/04/08

Some useful links:

M1015 is still used a lot, but there are many choices for SATA/SAS HBAs that are compatible with ESXi and ZFS.

SATA passthrough for many things seem to have stopped with ESXi 5.5 (5.1 and below should work). Some links related to that:

IDE and USB passthrough of CD/DVD devices seem to be fine though:

OEM adapters:

There are many SFF-8088 to SFF-8087 adapters.

–jeroen

via

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

How too many vCPUs can negatively affect performance | Gabes Virtual World

Posted by jpluimers on 2016/01/03

Interesting:

Think twice before you give VMs extra vCPUs which they don’t really need. You can negatively impact the performance of your environment since the vmkernel has to try and find a time slot in which it can give all vCPUs access to the physical cores.

Source: How too many vCPUs can negatively affect performance | Gabes Virtual World

Related:

–jeroen

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

ESXi Embedded Host Client – VMware Labs

Posted by jpluimers on 2015/12/22

Interesting stuff to play with the next few weeks:

This version of the ESXi Embedded Host Client is written purely in HTML and JavaScript, and is served directly from your ESXi host and should perform much better than any of the existing solutions.

Thanks Paul Braren for sharing this.

Source: ESXi Embedded Host Client – VMware Labs

–jeroen

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