Archive for the ‘VMware’ Category
Posted by jpluimers on 2016/09/20
In the 2009 past , sdelete used the -c parameter to zero wipe clean a hard drive and -z would clean it with a random pattern.
That has changed. Somewhere along the lines, -c and -z has swapped meaning which I didn’t notice.
This resulted in many of my virtual machines image backups were a lot larger than they needed to be.
The reason is that now:
-c does a clean free space with a random DoD conformant pattern (which does not compress well)
-z writes zeros in the free space
Incidently, -c is a lot slower than -z as well .
TL;DR: use this command
sdelete -z C:
Where C: is the drive to zero clean the free space.
–jeroen
Posted in Batch-Files , Development , Fusion , Hyper-V , Power User , Proxmox , Scripting , sdelete , Software Development , SysInternals , View , VirtualBox , Virtualization , VMware , VMware ESXi , VMware Workstation , Windows | Leave a Comment »
Posted by jpluimers on 2016/09/16
Often it is better to configure more than just a single pool.ntp.org server in case the IP-address of the name gets cached too long and it becomes unresponsive during that period.
So it is better to configure multiple, choose from this list from [WayBack ] pool.ntp.org: How do I setup NTP to use the pool? .
0.pool.ntp.org
1.pool.ntp.org
2.pool.ntp.org
3.pool.ntp.org
Here are the steps for one server where you need to repeat the steps after entering pool.ntp.org :
To configure NTP on ESX/ESXi 4.1 and ESXi 5.x hosts using the vSphere Client:
Connect to the ESX/ESXi host using the vSphere Client.
Select a host in the inventory.
Click the Configuration tab.
Click Time Configuration .
Click Properties .
Click Options .
Click NTP Settings .
Click Add .
Enter the NTP Server name. For example, pool.ntp.org .
Note : When entering the multiple NTP Server names, use a comma (,) followed by a space ( ) between the entries.
Click OK .
Click the General tab.
Click Start automatically under Startup Policy .
Note : It is recommended to set the time manually prior to starting the service.
Click Start and click OK .
Click OK to exit.
–jeroen
via:
Posted in ESXi4 , ESXi5 , ESXi5.1 , ESXi5.5 , Power User , Virtualization , VMware , VMware ESXi | Leave a Comment »
Posted by jpluimers on 2016/09/14
The ESXi console top to show processes is not available *, the alternative is esxtop . But that can show garbage because the ESXi console has a very limited support of terminals **.
For instance, when connecting from a Mac OS X terminal through ssh , this is my terminal:
# echo $TERM
xterm-256color
The solution:
TERM=xterm esxtop
–jeroen
via: VMware KB: Output of esxtop defaults to non-interactive CSV with unknown TermInfo .
Read the rest of this entry »
Posted in *nix , *nix-tools , bash , bash , Development , ESXi5 , ESXi5.1 , ESXi5.5 , ESXi6 , Power User , Scripting , Virtualization , VMware , VMware ESXi | 2 Comments »
Posted by jpluimers on 2016/09/13
These two vim-cmd scripts come in very handy:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 »
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 :
download the latest release
run the installer
allow the driver to be installed
indicate it’s OK to install an unsigned driver
now Windows won’t recognise the UPS any more, but in a few steps the apcupsd and helper program will
update the configuration file (no changes needed when it’s a USB connected one)
wait for the service to start
wait for the apctray helper program to start
look in the “system tray” for apctray helper program icon
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 »
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 »
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 »
Posted by jpluimers on 2016/05/30
Interesting:
Summary:
It is for virtual NUMA, and it depends.
It is only helpful if the host can do NUMA.
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 »
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 »