- Via [Archive.is] NicolettevCronenburg on Twitter: “Ik schrok van je bericht. Je moet gewoon de 2e prik kunnen krijgen volgens het advies van de Gezondheidsraad: … “:
- [Wayback] Wat moet ik weten over vaccinatie met het AstraZeneca-vaccin? | Rijksoverheid.nl
Ik heb al 1 prik met AstraZeneca gehad
Hoe gaat het nu verder met mijn 2e prik?
Alle mensen die al een 1e prik met AstraZeneca hebben gehad, krijgen ook hun 2e prik met AstraZeneca. Het geboortejaar maakt hierbij niet uit. Dat is ook het advies van de Gezondheidsraad.
- [Archive.is] NicolettevCronenburg on Twitter: “:-(, niet OK dit. Ik neem voor mijn 2e prik dan maar een kopie van deze regel mee voor de zekerheid. Wil je deze groep met 1 prik voldoende bescherming bieden, dan is die 2e gewoon nodig! @rivm @Gezondheidsraad…”
- [Wayback] Wat moet ik weten over vaccinatie met het AstraZeneca-vaccin? | Rijksoverheid.nl
- [Archive.is] Jeroen Wiert Pluimers on Twitter: “Ik hoor van de collega van Eega dat mensen bij de GGD worden weggestuurd die voor hun 2e prik AstraZeneca komen, tegen het advies van de Gezondheidsraad in: … “De Gezondheidsraad adviseert verder dat mensen geboren na 1960 die al een eerste vaccinatie 1/”
- [Wayback] Inzet AstraZeneca-vaccin | Advies | Gezondheidsraad
Inzet AstraZeneca-vaccin
…
Mensen onder de 60 die al een eerste prik met het AstraZeneca-vaccin hebben gehad, kunnen wel hun tweede dosis vaccin toegediend krijgen. Er zijn tot op heden wereldwijd geen meldingen van de bijwerking na de tweede dosis, terwijl wereldwijd al enkele miljoenen mensen een tweede dosis vaccin hebben ontvangen.
- [Wayback] Inzet AstraZeneca-vaccin | Advies | Gezondheidsraad
- [Archive.is] Jeroen Wiert Pluimers on Twitter: “met AstraZeneca hebben gekregen, de afspraak voor de tweede prik met AstraZeneca kunnen laten doorgaan.” en … “Mensen onder de 60 die al een eerste prik met het AstraZeneca-vaccin hebben gehad, kunnen wel hun tweede dosis vaccin toegediend krijgen.” 2/”
- [Wayback] Prikken met AstraZeneca voor mensen van 60 jaar en ouder gaat door | RIVM
De Gezondheidsraad adviseert verder dat mensen geboren na 1960 die al een eerste vaccinatie met AstraZeneca hebben gekregen, de afspraak voor de tweede prik met AstraZeneca kunnen laten doorgaan.
- [Wayback] Prikken met AstraZeneca voor mensen van 60 jaar en ouder gaat door | RIVM
AstraZeneca: tweede prik gaat gewoon door (via Rijksoverheid.nl)
Posted by jpluimers on 2021/04/30
Posted in About, LifeHacker, Personal, Power User | Leave a Comment »
Celebrate Email Debt Forgiveness Day!
Posted by jpluimers on 2021/04/30
If there’s an email response you’ve wanted to send but been too anxious to send, you can send it today
[Wayback] Celebrate Email Debt Forgiveness Day! | Email Debt Forgiveness Day
Via: [Archive.is] Ionica Smeets on Twitter: “Voor wie net als ik nog wat achterstallige mails heeft: komende vrijdag is het email debt forgiveness day”
–jeroen
Posted in LifeHacker, Power User | Leave a Comment »
Thoughts on ix500; should I get an ix1500?
Posted by jpluimers on 2021/04/30
Some of my thoughts on [WayBack] AW: Netzwerkfähiger Dokumentenscanner?:
I use a Fujitsu ScanSnap ix500 scanner for this plus a Windows VM that automatically logs on.
- Pictures:
https://commons.wikimedia.org/wiki/C…ScanSnap_iX500
- Blog posts:
https://wiert.me/category/power-user…cansnap/ix500/
- Heise
https://www.google.com/search?q=ix500+site%3Aheise.de
It is out of production now, but I think most of the below holds as the successor ix1500 is very similar (ix500 announcement
https://www.fujitsu.com/sg/about/res…-20181002.html)
Before the ix500, I used a Fujitsu ScanSnap S510 which had similar capabilities as the ix500 but was a lot slower.
Cool things:
- included software can do OCR and scan to a path the Windows user has access to
- the scanner is fast, and does a stack of A4 full duplex automatically at a few seconds per page scanning on the scanner and 5-10 seconds per page OCR on a 1.2 Ghz dual core VM
- no fiddling from within the scanner to get network stuff working, or to keep it up-to-date on protocol changes
Drawbacks:
- the software pops up a dialog after each scan, so I wrote this:
https://bitbucket.org/jeroenp/wiert….onsoleProject/
- you need a Windows PC that is logged on (so the software does work), which means I configured a VM to auto-logon
- WiFi 2.4 Ghz only (no ethernet interface, no 5 Ghz WiFi)
- you need USB on the same VM connected to the scanner once to configure WiFI
- like any hardware/software combination, sometimes the scanner or Windows VM need a reboot, for instance when it looses network or USB connection
The ix1500 has a touch screen instead of 2 buttons, so it might be that it has more standalone functionalities than the ix500.
Since I need a second scanner in a second place, I might get an ix1500 after the summer.
–jeroen
–jeroen
Posted in Fujitsu ScanSnap, Hardware, ix500, LifeHacker, Power User, Scanners | Leave a Comment »
VMware ESXi console: viewing all VMs, suspending and waking them up: part 4
Posted by jpluimers on 2021/04/29
Yesterday we ended with an overview of available and unavailable vim-cmd vmsvc commands and the promise to try running the various power commands on all relevant VMs.
Let’s start with a summary of the commands, so it will be easier to make a list of scripts to run them on relevant VMs.
Available commands
vim-cmd vmsvc/power.getstate vmidvim-cmd vmsvc/power.hibernate vmidvim-cmd vmsvc/power.off vmidvim-cmd vmsvc/power.on vmidvim-cmd vmsvc/power.reboot vmidvim-cmd vmsvc/power.reset vmidvim-cmd vmsvc/power.shutdown vmidvim-cmd vmsvc/power.suspend vmidvim-cmd vmsvc/power.suspendResume vmid
Unavailable commands
vim-cmd vmsvc/power.startup vmidvim-cmd vmsvc/power.resume vmidvim-cmd vmsvc/power.wakeup vmid
List the vmid values, power status and name of all VMs
Getting the vmid
Yesterday I showed a small statement that gives the list of vmid values on an ESXi system:
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"
What I ideally want is not just the vmid and name for each VM from vim-cmd vmsvc/getallvms, but also get the power state information from vim-cmd vmsvc/power.getstate vmid.
For that, we need to parse the output of vim-cmd vmsvc/power.getstate vmid, which can be three outputs:
Retrieved runtime info
Powered offRetrieved runtime info
Powered onRetrieved runtime info
Suspended
So basically it involves deleting the first line which was covered in part 2 of this installment, for example on my system:
# vim-cmd vmsvc/power.getstate 10 | sed '1d' Powered on
Getting VM name
Extracting both vmid and name from vim-cmd vmsvc/getallvms at the same time is not easy, heck even impossible, so I decided to go the vim-cmd vmsvc/get.config vmid way.
Getting multiple values out of some output is already very hard in
bash, where usually the less difficult way is to use arrays. Since Busybox has anashshell (see Busybox sh (actually ash derivative dash): checking exit codes), andashdoes not do arrays, that route is gone.To give you an idea how hard this is in
bashand how to sort of workaround the lack of array support inash:
- [Wayback] shell – How to assign values to multiple variables in command line with bars – Unix & Linux Stack Exchange (explaining how to do this with multiple assignments)
- [Wayback] bash – Extract two values from the output of a command – Unix & Linux Stack Exchange (explaining how to use
teeto pass output to multiple distinct commands)- [Wayback] linux – Extract multiple values using sed – Stack Overflow (how to use
sedto split output over multiple lines)- [Wayback] linux – how to get elements from list in bash? – Super User (on the
basharray syntax)- [Wayback] linux – reading a tuple from a file with awk – Stack Overflow (on how to use multiple arrays in
bash)- [Wayback] shell – How to port to bash-style arrays to ash? – Unix & Linux Stack Exchange (explaining that unlike
bash,ashhas no arrays)
This partial vim-cmd vmsvc/get.config vmid sample output on one of my VMs that shows how to use head -n 31 to get just the first 31 lines of output:
# vim-cmd vmsvc/get.config 10 | head -n 31 Configuration: (vim.vm.ConfigInfo) { changeVersion = "2021-04-07T22:08:30.548274Z", modified = "1970-01-01T00:00:00Z", name = "X9SRI-3F-W10P-EN-MEDIA", guestFullName = "Microsoft Windows 10 (64-bit)", version = "vmx-14", uuid = "564d51ac-f6cf-e40b-b686-2f53a28a4bea", createDate = "2019-05-17T21:37:11.408173Z", instanceUuid = "52403d0e-7ccd-48da-bb21-7e966defccf7", npivNodeWorldWideName = , npivPortWorldWideName = , npivWorldWideNameType = , npivDesiredNodeWwns = , npivDesiredPortWwns = , npivTemporaryDisabled = true, npivOnNonRdmDisks = , locationId = "564d6b18-ecd1-2261-0127-146b3f3bc636", template = false, guestId = "windows9_64Guest", alternateGuestName = "", annotation = "", files = (vim.vm.FileInfo) { vmPathName = "[EVO860_500GB] VM/X9SRI-3F-W10P-EN-MEDIA/X9SRI-3F-W10P-EN-MEDIA.vmx", snapshotDirectory = "[EVO860_500GB] VM/X9SRI-3F-W10P-EN-MEDIA", suspendDirectory = "[EVO860_500GB] VM/X9SRI-3F-W10P-EN-MEDIA", logDirectory = "[EVO860_500GB] VM/X9SRI-3F-W10P-EN-MEDIA", ftMetadataDirectory = }, tools = (vim.vm.ToolsConfigInfo) {
The reason to go the vim-cmd vmsvc/get.config vmid way is that it contains all the configuration info in a kind of JSON format (except the first two lines) and should be relatively easy to parse. Or so at least I hoped.
Basically I am interested in the value of name = "X9SRI-3F-W10P-EN-MEDIA", however, there are multiple name fields in the total configuration:
# vim-cmd vmsvc/get.config 10 | sed -n -E '/name =/p' name = "X9SRI-3F-W10P-EN-MEDIA", name = "EVO860_500GB",
So what I really want is the value of name = "X9SRI-3F-W10P-EN-MEDIA", in between the (vim.vm.ConfigInfo) { and files = (vim.vm.FileInfo) { parts.
This can be done using sed as it allows to specify a range using a start and end value using addresses:
- [Wayback] sed: Addresses in sed
An address is either a decimal number that counts input lines cumulatively across files, a '$' character that addresses the last line of input, or a context address (which consists of a BRE, as described in Regular Expressions in sed , preceded and followed by a delimiter, usually a slash).
An editing command with no addresses shall select every pattern space.
An editing command with one address shall select each pattern space that matches the address.
An editing command with two addresses shall select the inclusive range from the first pattern space that matches the first address through the next pattern space that matches the second. (If the second address is a number less than or equal to the line number first selected, only one line shall be selected.) Starting at the first line following the selected range, sed shall look again for the first address. Thereafter, the process shall be repeated. Omitting either or both of the address components in the following form produces undefined results:
[address[,address]]
- Range Addresses (sed, a stream editor)[Wayback] Range Addresses (sed, a stream editor)
An address range can be specified by specifying two addresses separated by a comma (
,). An address range matches lines starting from where the first address matches, and continues until the second address matches (inclusively):$ seq 10 | sed -n '4,6p' 4 5 6
If the second address is a regexp, then checking for the ending match will start with the line following the line which matched the first address: a range will always span at least two lines (except of course if the input stream ends).
…
- [Wayback] Regexp Addresses (sed, a stream editor)
For example (with some characters escaped because of [Wayback] ERE syntax (sed, a stream editor)):
# vim-cmd vmsvc/get.config 10 | sed -n -E -e '/\(vim.vm.ConfigInfo\) \{/,/files = \(vim.vm.FileInfo\) \{/p' (vim.vm.ConfigInfo) { changeVersion = "2021-04-07T22:08:30.548274Z", modified = "1970-01-01T00:00:00Z", name = "X9SRI-3F-W10P-EN-MEDIA", guestFullName = "Microsoft Windows 10 (64-bit)", version = "vmx-14", uuid = "564d51ac-f6cf-e40b-b686-2f53a28a4bea", createDate = "2019-05-17T21:37:11.408173Z", instanceUuid = "52403d0e-7ccd-48da-bb21-7e966defccf7", npivNodeWorldWideName = , npivPortWorldWideName = , npivWorldWideNameType = , npivDesiredNodeWwns = , npivDesiredPortWwns = , npivTemporaryDisabled = true, npivOnNonRdmDisks = , locationId = "564d6b18-ecd1-2261-0127-146b3f3bc636", template = false, guestId = "windows9_64Guest", alternateGuestName = "", annotation = "", files = (vim.vm.FileInfo) {
With [Wayback] BRE syntax (sed, a stream editor) the filter part would be easier: vim-cmd vmsvc/get.config 10 | sed -n -e '/(vim.vm.ConfigInfo) {/,/files = (vim.vm.FileInfo) {/p', but the print part would be more difficult:
-
# vim-cmd vmsvc/get.config 10 | sed -n -E -e '/\(vim.vm.ConfigInfo\) \{/,/files = \(vim.vm.FileInfo\) \{/ s/^ +name = "(.*)",.*?/1/p' X9SRI-3F-W10P-EN-MEDIA -
# vim-cmd vmsvc/get.config 10 | sed -n -e '/(vim.vm.ConfigInfo) {/,/files = (vim.vm.FileInfo) {/ s/^ +name = "(.*)",.*?/1/p' X9SRI-3F-W10P-EN-MEDIA
Since I am used to extended regular expressions (ERE) over basica regular expressions (BRE), I prefer the first solution.
So getting the name in a variable now becomes this:
# name=`vim-cmd vmsvc/get.config 10 | sed -n -e '/(vim.vm.ConfigInfo) {/,/files = (vim.vm.FileInfo) {/ s/^ +name = "(.*)",.*?/1/p'` # echo ${name} X9SRI-3F-W10P-EN-MEDIA
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
As a bonus, next to powerState, the script also figures out vmPathName in a similar way to name.
–jeroen
Posted in *nix, *nix-tools, ash/dash, ash/dash development, Development, ESXi6, ESXi6.5, ESXi6.7, ESXi7, head, Power User, Scripting, sed, sed script, Software Development, tee, Virtualization, VMware, VMware ESXi | Leave a Comment »
Huurprijswijzigingen die voor 1 juli 2021 ingaan berekenen
Posted by jpluimers on 2021/04/29
Voor mijn link-archief:
- [Wayback/Archive.is] Huurverhoging in 2021 | Passende huur | Woningmarktbeleid
Verhuurders sturen meestal in april de jaarlijkse brief aan hun huurder(s) over de huurverhoging die per 1 juli ingaat. Maar de huurverhoging kan ook op een andere datum ingaan.
- [Wayback/Archive.is] Wat is de maximale huurverhoging in 2021? | Rijksoverheid.nl
Vanaf 1 juli 2021 gaat de huur voor een sociale huurwoning niet omhoog. Ook de huur voor mensen met een hoger inkomen gaat niet omhoog. Dit geldt tot 30 juni 2022. Huurt u in een vrijesectorwoning? Dan geldt er géén maximum huurverhoging.
- [Wayback/Archive.is] Welke regels gelden er voor een huurverhoging? | Rijksoverheid.nl
U woont in een sociale huurwoning. Dan kan uw verhuurder elk jaar uw huur verhogen. De Rijksoverheid bepaalt met hoeveel procent. Let op: vanaf 1 juli 2021 mag uw verhuurder de huur niet verhogen. Dit geldt tot 30 juni 2022. Huurt u een vrijesectorwoning? Dan geldt er geen maximale huurverhoging. Dit verandert misschien in 2021.
- [Wayback/Archive.is] Wat is het verschil tussen een sociale huurwoning en een huurwoning in de vrije sector? | Rijksoverheid.nl
Een sociale huurwoning kent een begrensde huur. De huur mag nooit hoger zijn dan een bepaald bedrag. Dit heet de maximale huurgrens van de woning. Ook mag de huurverhoging nooit te hoog zijn. In de vrije sector gelden deze regels niet.
- [Wayback/Archive.is] Hoe hoog is de inflatie van de consumentenprijzen (CPI is consumentenprijsindex)?
- [Wayback/Archive.is] Bereken huurverhoging vrije sector huurwoning of bedrijfspand
Bereken de jaarlijkse huurverhoging van uw vrije sector huurwoning volgens de consumentenprijsindex (CPI) van het Centraal Bureau voor de Statistiek. Dit wordt ook wel de indexering van de huur genoemd.
- [Archive.is] StatLine – Consumentenprijzen; prijsindex 2015=100
- [Archive.is] StatLine – Consumentenprijzen; prijsindex 2015=100
- [Archive.is] StatLine – Consumentenprijzen; prijsindex 2015=100
–jeroen
Posted in About, Personal | Leave a Comment »
Some links on Delphi and CHM help files
Posted by jpluimers on 2021/04/29
I hardly use help files, but some older systems do, and when porting really old Delphi code, often odd implementations of accessing them through HHCTRL.OCX are used.
Since I tend to forget the correct way using the HtmlHelpViewer unit, here are some links:
- [WayBack] How to Connect HTML Help with your Delphi Application
- [WayBack] How to Integrate a CHM File with Your Application
- [WayBack] How to use CHM HTML Help file with Delphi XE application? – Stack Overflow
Very old code involving the OCX file:
- [WayBack] www.stbbs.net/~junichi/adelieworks/hhwd/files/awhhelp.pas
- [WayBack] MiniHtmlHlp.pas in delphi-nonvcl-librarys | source code search engine
Quote from the first link [WayBack] How to Connect HTML Help with your Delphi Application:
Linking HTML Help (CHM) Files
You should add the “HTMLHelpViewer” unit to the “Uses” clause in the main form of your application. Then set the full path to your CHM file to Application.HelpFile property. To do so, you can add the following line to the main form’s “On Create” event handler:
Application.HelpFile := ExtractFilePath(Application.ExeName) + 'HelpFile.chm';where “HelpFile.chm” is the actual name of your HTML Help file, located in the same directory as your application’s executable file.
Using HTML Help from Code
When you need to display your help file or a specific help topic, or perform others actions, you can use the following calls:
Displaying a help topic
Application.HelpContext(IDH_TOPIC);where
IDH_TOPICis the ContextId value of the topic to display.Displaying the Table of Contents tab
HtmlHelp(0, Application.HelpFile, HH_DISPLAY_TOC, 0);Displaying the Index tab
HtmlHelp(0, Application.HelpFile, HH_DISPLAY_INDEX, DWORD(PWideChar('Test')));Displaying the Search tab
var Query: THH_Fts_QueryW; begin with Query do begin cbStruct := SizeOf(THH_Fts_QueryW); fUniCodeStrings := True; pszSearchQuery := ''; iProximity := 0; fStemmedSearch := True; fTitleOnly := False; fExecute := True; pszWindow := nil; end; HtmlHelp(0, Application.HelpFile, HH_DISPLAY_SEARCH, DWORD(@Query)); end;Performing Keyword Lookup
Application.HelpKeyword('Test');Providing Help for Controls
You can link specific help topics with any controls located on the form. In this case a control will automatically display the corresponding help topic when the user focuses it and presses F1. Also, you can add the standard [?] button to the caption area of the form: using the Object Inspector, set the form’s BorderStyle property as bsDialog and biHelp member of the BorderIcons property to True. Then set the controls’ HelpContext properties that should correspond to the topic ContextId values as defined in your help project.
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
VMware ESXi console: viewing all VMs, suspending and waking them up: part 3
Posted by jpluimers on 2021/04/28
Yesterday’s installment ended with a list of power related vim-cmd vmsvc commands:
Usage: power.getstate vmid Usage: power.hibernate vmid Usage: power.off vmid Usage: power.on vmid Usage: power.reboot vmid Usage: power.reset vmid Usage: power.shutdown vmid Usage: power.suspend vmid Usage: power.suspendResume vmid
Getting vmid values
These all have a vmid parameter, so let’s create a small statement that gives the list of vmid on an ESXi system:
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"
On my system the relevant VMs it returns are these:
10 5
The various power commands
The outcome of the various power commands are not as simple as one might think as they often do not just depend on the current power state of the VM, but also on either VMware Tools or open-vm-tools to be running.
Basically these tools do the same, but their origin is different: open-vm-tools is often included as part of Linux distributions; VMware Tools is often installed separately, see:
- [Wayback] VMware Tools or open-vm-tools – Thomas-Krenn-Wiki
- [Wayback/Archive.is] vmware/open-vm-tools: Official repository of VMware open-vm-tools project
I have made a table for this hoping it makes reading easier, the explanations are by empirical usage, as the documentation in the help dump (see [Wayback] delimited vim-cmd help for each vmsvc command.txt) does not seem to match behaviour.
Command Explanation vim-cmd vmsvc/power.getstate vmidGets the power state of the VM, returning a line Retrieved runtime infofollowed by lines indicating the power state:
Powered offPowered onSuspendedvim-cmd vmsvc/power.hibernate vmidWhen neither VMware Tools or open-vm-tools to be running, you get an error: (vim.fault.ToolsUnavailable) { faultCause = (vmodl.MethodFault) null, faultMessage = msg = "Received SOAP response fault from []: standbyGuest Cannot complete operation because VMware Tools is not running in this virtual machine." }When a hibernate/suspend task is already running, you get an error:
(vim.fault.TaskInProgress) { faultCause = (vmodl.MethodFault) null, faultMessage = , task = 'vim.Task:haTask-12-vim.VirtualMachine.suspend-1006072588' msg = "Received SOAP response fault from []: standbyGuest Another task is already in progress." }Otherwise, depends on the power state of the VM if vmware tools:
Powered off: keeps the power state of the VM asPowered offand shows an error
(vim.fault.InvalidPowerState) { faultCause = (vmodl.MethodFault) null, faultMessage = , requestedState = "poweredOn", existingState = "poweredOff" msg = "Received SOAP response fault from []: standbyGuest The attempted operation cannot be performed in the current state (Powered off)." }Powered on: sets the power state of the VM toSuspendedand shows no output, unless neither VMware Tools, nor open-vm-tools can be communicated with, then you get this error:
(vmodl.fault.SystemError) { faultCause = (vmodl.MethodFault) null, faultMessage = , reason = "Invalid fault" msg = "Received SOAP response fault from []: standbyGuest vim.fault.GenericVmConfigFault" }Suspended: keeps the power state of the VM asSuspendedand shows an error
(vim.fault.InvalidPowerState) { faultCause = (vmodl.MethodFault) null, faultMessage = , requestedState = "poweredOn", existingState = "suspended" msg = "Received SOAP response fault from []: standbyGuest The attempted operation cannot be performed in the current state (Suspended)." }vim-cmd vmsvc/power.off vmidDepends on the power state of the VM and either VMware Tools or open-vm-tools to be running:
Powered off: keeps the power state of the VM asPowered offand shows two lines
Powering off VM: Power off failed
Powered on: powers off the VM (bypasses any VMware Tools or open-vm-tools) and sets power state of the VM toPowered offshowing one line
Powering off VM:Suspended: Hardware powers off the VM (bypasses any VMware Tools or open-vm-tools) and sets power state of the VM toPowered offshowing one line
Powering off VM:vim-cmd vmsvc/power.on vmidDepends on the power state of the VM:
Powered on: keeps power state of the VM asPowered offshowing two lines
Powering on VM: Power on failedPowered off: keeps the power state of the VM asPowered offand shows one line
Powering ofn VM:Suspended: keeps the power state of the VM asSuspendedshowing two lines
Powering on VM: Power on failedThis also undoes a
vim-cmd vmsvc/power.hibernate vmid,vim-cmd vmsvc/power.shutdown vmidorvim-cmd vmsvc/power.suspend vmid.vim-cmd vmsvc/power.reboot vmidDepends on the power state of the VM and either VMware Tools or open-vm-tools to be running:
Powered off: keeps the power state of the VM asPowered offand shows the error
(vim.fault.InvalidPowerState) { faultCause = (vmodl.MethodFault) null, faultMessage = , requestedState = "poweredOn", existingState = "poweredOff" msg = "Received SOAP response fault from []: rebootGuest The attempted operation cannot be performed in the current state (Powered off)." }Powered onand either VMware Tools or open-vm-tools are running: uses VMware Tools or open-vm-tools to reboot the VM: keeps the power state of the VM asPowered on.Powered on, but neither VMware Tools nor open-vm-tools are running: keeps the power state of the VM asPowered onand shows the error
(vim.fault.ToolsUnavailable) { faultCause = (vmodl.MethodFault) null, faultMessage = msg = "Received SOAP response fault from []: rebootGuest Cannot complete operation because VMware Tools is not running in this virtual machine." }Suspended: keeps the power state of the VM asSuspendedand shows the error
(vim.fault.InvalidPowerState) { faultCause = (vmodl.MethodFault) null, faultMessage = , requestedState = "poweredOn", existingState = "suspended" msg = "Received SOAP response fault from []: rebootGuest The attempted operation cannot be performed in the current state (Suspended)." }vim-cmd vmsvc/power.reset vmidDepends on the power state of the VM:
Powered off: keeps the power state of the VM asPowered offand shows two lines
Reset VM: Reset failedPowered on: keeps the power state of the VM asPowered on, bypasses running VMware Tools or open-vm-tools (basically like a hardware reset button) and shows one line
Reset VM:Suspended: keeps the power state of the VM asSuspendedand shows two lines
Reset VM: Reset failedvim-cmd vmsvc/power.shutdown vmidDepends on the power state of the VM and either VMware Tools or open-vm-tools to be running:
Powered off: keeps the power state of the VM asPowered offand shows the error
(vim.fault.InvalidPowerState) { faultCause = (vmodl.MethodFault) null, faultMessage = , requestedState = "poweredOn", existingState = "poweredOff" msg = "Received SOAP response fault from []: shutdownGuest The attempted operation cannot be performed in the current state (Powered off)." }Powered onand either VMware Tools or open-vm-tools are running: uses VMware Tools or open-vm-tools to shutdown the VM and sets the power state of the VM toPowered offwithout showing any output.Powered on, but neither VMware Tools nor open-vm-tools are running: keeps the power state of the VM asPowered onand shows the error
(vim.fault.ToolsUnavailable) { faultCause = (vmodl.MethodFault) null, faultMessage = msg = "Received SOAP response fault from []: shutdownGuest Cannot complete operation because VMware Tools is not running in this virtual machine." }Suspended: keeps the power state of the VM asSuspendedand shows the error
(vim.fault.InvalidPowerState) { faultCause = (vmodl.MethodFault) null, faultMessage = , requestedState = "poweredOn", existingState = "suspended" msg = "Received SOAP response fault from []: shutdownGuest The attempted operation cannot be performed in the current state (Suspended)." }vim-cmd vmsvc/power.suspend vmidWhen neither VMware Tools or open-vm-tools to be running, you get an error: (vim.fault.ToolsUnavailable) { faultCause = (vmodl.MethodFault) null, faultMessage = msg = "Received SOAP response fault from []: standbyGuest Cannot complete operation because VMware Tools is not running in this virtual machine." }When a hibernate/suspend task is already running, you get an error:
(vim.fault.TaskInProgress) { faultCause = (vmodl.MethodFault) null, faultMessage = , task = 'vim.Task:haTask-12-vim.VirtualMachine.suspend-1006072588' msg = "Received SOAP response fault from []: standbyGuest Another task is already in progress." }Otherwise, depends on the power state of the VM:
Powered off: keeps the power state of the VM asPowered offand shows two lines
Suspending VM: Suspend failedPowered on: keeps the power state of the VM asPowered on, and shows one line
Suspending VM:unless neither VMware Tools, nor open-vm-tools can be communicated with, then you get this error:
(vmodl.fault.SystemError) { faultCause = (vmodl.MethodFault) null, faultMessage = , reason = "Invalid fault" msg = "Received SOAP response fault from []: standbyGuest vim.fault.GenericVmConfigFault" }Suspended: keeps the power state of the VM asSuspendedand shows two lines
Suspending VM: Suspend failedvim-cmd vmsvc/power.suspendResume vmidDepends on the power state of the VM:
Powered off: keeps the power state of the VM asPowered offand shows two lines
Suspend/Resuming the VM: Suspend/Resume failedPowered on: keeps the power state of the VM asPowered on, and shows one line
Suspend/Resuming the VM:Suspended: keeps the power state of the VM asSuspendedand shows two lines
Suspend/Resuming the VM: Suspend/Resume failedNote that in the VMware web console, this is shown as “Invoke FSR” which is a Fast Suspend Resume, which I think has to do with vMotion.
Notes:
- there is no command
vim-cmd vmsvc/power.startup vmid(to undovim-cmd vmsvc/power.shutdown vmid), usevim-cmd vmsvc/power.on vmidin stead. - there is no command
vim-cmd vmsvc/power.resume vmid(to undovim-cmd vmsvc/power.suspend vmid), usevim-cmd vmsvc/power.on vmidin stead. - there is no command
vim-cmd vmsvc/power.wakeup vmid(to undovim-cmd vmsvc/power.hibernate vmid), usevim-cmd vmsvc/power.on vmidin stead.
Running the various power commands on all relevant VMs
This will be the topic for the next installment.
–jeroen
Posted in *nix, *nix-tools, ash/dash, ash/dash development, Development, ESXi6, ESXi6.5, ESXi6.7, ESXi7, Power User, Scripting, sed, sed script, Software Development, Virtualization, VMware, VMware ESXi | 1 Comment »
Updating chocolatey itself
Posted by jpluimers on 2021/04/28
I wondered how to update (ore actually choco upgrade as choco update will command will eventually be deprecated) Chocolatey itself.
It appeared my stock upgrade batch file choco upgrade all --exit-when-reboot-detected --yes was already doing it as the magic all will upgrade all packages.
To upgrade just [Wayback] chocolatey itself, remember it is a package, so choco upgrade chocolatey --exit-when-reboot-detected --yes will work fine.
–jeroen
Posted in Chocolatey, Power User, Windows | Leave a Comment »
Little Delphi tip: after “Build the current build group”, do not be surprised debugging fails
Posted by jpluimers on 2021/04/28
The Delphi Build groups are great for quickly building a lot of projects in your project group with their various build configuration.
One very important tip though: it builds in DEBUG, then RELEASE mode, then leaves the IDE thinking all projects have been built in the project manager “Build Configuration”.
That assumption is only true, if no “Build Configuration” is “DEBUG”.
It means that if you start debugging your application right after performing a “Build the current build group”, and those include RELEASE as final mode, that your debugger will be using a RELEASE mode build instead of a DEBUG build.
Quick screenshot:
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
VMware ESXi console: viewing all VMs, suspending and waking them up: part 2
Posted by jpluimers on 2021/04/27
Last week ended up to be a kind of VMware ESXi heavey, and this week will be similar. So it is time for following up on VMware ESXi console: viewing all VMs, suspending and waking them up: part 1.
That one ended with
Then we get this to print some of the capture groups:
vim-cmd vmsvc/getallvms | sed -n -E -e "s/^([[:digit:]]+)\s+((\S.+\S)?)\s+(\[\S+\])\s+(.+\.vmx)\s+(\S+)\s+(vmx-[[:digit:]]+)\s*?((\S.+)?)$/Vmid:\1 Guest:\6 Version:\7 Name:\3 Datastore:\4 File:\5 Annotation:\8/p"With this output:
Vmid:10 Guest:windows9_64Guest Version:vmx-14 Name:X9SRI-3F-W10P-EN-MEDIA Datastore:[EVO860_500GB] File:VM/X9SRI-3F-W10P-EN-MEDIA/X9SRI-3F-W10P-EN-MEDIA.vmx Annotation: Vmid:5 Guest:centos64Guest Version:vmx-11 Name:PPB Local_Virtual Machine_v4.0 Datastore:[EVO860_500GB] File:VM/PPB-Local_Virtual-Machine_v4.0/PPB Local_Virtual Machine_v4.0.vmx Annotation:PowerPanel Business software(Local) provides the service which communicatesFiguring out power state for each VM
This will be in the next installment, as by now this already has become a big blog-post (:
I basically went the vim-cmd vmsvc way instead of the esxcli vm way. My motivation was the easier to understand ID values. They are the basis of virtually all vim-cmd vmsvc based commands:
# vim-cmd vmsvc --help Commands available under vmsvc/: acquiremksticket get.snapshotinfo acquireticket get.spaceNeededForConsolidation createdummyvm get.summary destroy get.tasklist device.connection getallvms device.connusbdev gethostconstraints device.ctlradd message device.ctlrremove power.getstate device.disconnusbdev power.hibernate device.diskadd power.off device.diskaddexisting power.on device.diskextend power.reboot device.diskremove power.reset device.getdevices power.shutdown device.nvdimmadd power.suspend device.nvdimmremove power.suspendResume device.toolsSyncSet queryftcompat devices.createnic reload get.capability setscreenres get.config snapshot.create get.config.cpuidmask snapshot.dumpoption get.configoption snapshot.get get.datastores snapshot.remove get.disabledmethods snapshot.removeall get.environment snapshot.revert get.filelayout snapshot.setoption get.filelayoutex tools.cancelinstall get.guest tools.install get.guestheartbeatStatus tools.upgrade get.managedentitystatus unregister get.networks upgrade get.runtime
My “goto” for getting information is [Wayback] “vim-cmd vmsvc” site:vmware.com – Google Search, and a few sample pages are here:
- [Wayback] Performing common virtual machine-related tasks with command-line utilities (2012964) (showing that there are many tasks only
vim-cmd vmsvccan do, butesxcli vmcannot) - [Wayback] Powering on a virtual machine from the command line when the host cannot be managed using vSphere Client (1038043) (showing how to combine
vim-cmd vmsvc/getallvms,vim-cmd vmsvc/power.getstateandvim-cmd vmsvc/power.on) - [Wayback] Determine the power status of a virtual machine on an ESX or ESXi host (1003737) (showing
vim-cmd vmsvc/getallvms,vim-cmd vmsvc/power.getstateandps –auxwww | grep –i VM_NAME) - [Wayback] Collecting information about tasks in VMware ESXi/ESX (1013003) (showing the relation between VMs and tasks using
vim-cmd vimsvc/task_list,vim-cmd vmsvc/getallvmsandvim-cmd vimsvc/task_info) - [Wayback] Unable to Power off a Virtual Machine in an ESXi host (1014165) (focussing on
vim-cmd vmsvc/getallvms,vim-cmd vmsvc/power.getstate,vim-cmd vmsvc/power.shutdownandvim-cmd vmsvc/power.off) - [Wayback] Reloading a vmx file without removing the virtual machine from inventory (1026043) (showing
vim-cmd vmsvc/getallvmsandvim-cmd vmsvc/reload) - [Wayback] Investigating virtual machine file locks on ESXi hosts (10051) (trying to show how to combine
vim-cmd vmsvc/getallvms,grep,awk,findandxargsto findvmdkfiles, but fails because of parsing errors)
The pattern above is that most of the vim-cmd vmsvc examples are for power state and tasks. Not fully sure why, but my guess is it is what most people use it for. That kind of use what this series of posts also focuses on too, but certainly not the only use. Read the first numbered entry above to get a full grasp of what is possible. I hope to find time in the future to show some more examples outside the power and task realms.
Basically the only time you need to check out esxcli with VMs is when you cannot shut down a VM in a normal way. These links explain what to do in that case:
- [Wayback] Powering off an unresponsive virtual machine on an ESXi host (1004340)
- [Wayback] Unable to Power off a Virtual Machine in an ESXi host (1014165)
So let’s go back to basics, and start with getting info on all vim-cmd vmsvc commands.
Help on all vim-cmd vmsvc commands
Executing vim-cmd help vmsvc (preferred) or vim-cmd help vmsvc --help gives you all commands prepended with the line Commands available under vmsvc/:.
Executing vim-cmd help vmsvc/command prints the help for a single command (but vim-cmd help vmsvc/command -help first prints an error, then the help).
Here are the steps how I got the help help for all commands.
First I needed a list of all commands. This is already a multi-stage process, so below the full command I will explain the bits.
vim-cmd help vmsvc | sed '1d' | xargs -n 1 -r echo | sort
vim-cmd help vmsvcgives all the commands (two per line!) prepended by the lineCommands available under vmsvc/:.sed '1d'stripts that line.xargs -n 1 -r echodoes a lot of things:- It parses the
sed '1d'input line by line, splits each line into parts, combines all the parts, then executesechowith the combined parts - The
-n 1ensures each invocation ofechotakes only a single one of the combined parts -ris just a protection: if there is no input, thenechois never executed, resulting in empty output
- It parses the
sortwill sort all the combined output of all theechoinvocations to undo the horizontal combination of parts thatxargsdid
Now getting the help is doing more of the above, with some more bits to explain:
vim-cmd help vmsvc | sed '1d' | xargs -n 1 -r echo | sort | xargs -n 1 -r -I {} vim-cmd help vmsvc/{}
- Normally,
xargswill execute each command by appending the parameter inserting a space in front of each parameter -I {}will forcexargsto put each argument just as is in the place where{}is used in the argument- This executes
vim-cmd help vmsvc/commandin stead ofvim-cmd help vmsvc/ command
The result is a long blob of text that is very hard to read as there are no separators between the commands. I saved it as a [Wayback] vim-cmd help for each vmsvc command.txt gist.
With a sh -c shell trick, you can add some more information and separation to the output by embedding :
vim-cmd help vmsvc | sed '1d' | xargs -n 1 -r echo | sort | xargs -n 1 -r -I {} sh -c 'echo "-----" ; echo "help for vim-cmd help vmsvc/{}" ; echo ; vim-cmd help vmsvc/{}'
I have added the output to the [Wayback] delimited vim-cmd help for each vmsvc command.txt gist.
Commands taking a vmid parameter
Now that we know how to output all help, we can filter on it.
An interesting one is to filder only commands taking a vmid parameter:
vim-cmd help vmsvc | sed '1d' | xargs -n 1 -r echo | sort | xargs -n 1 -r -I {} vim-cmd help vmsvc/{} | grep -iw vmid
On VMware ESXi 6.7, this gets you the list:
Usage: acquiremksticket vmid Usage: acquireticket vmid ticketType Usage: destroy vmid Usage: device.connection vmid deviceKey connect Usage: device.connusbdev vmid usbid Usage: device.ctlradd vmid ctlr_type bus_number Usage: device.ctlrremove vmid ctlr_type bus_number Usage: device.disconnusbdev vmid usbid Usage: device.diskadd vmid size controller_numer unit_number datastore [ctlr_type] Usage: device.diskaddexisting vmid disk_file controller_number unit_number [ctlr_type] Usage: device.diskextend vmid new_size controller_numer unit_number [ctlr_type] Usage: device.diskremove vmid controller_number unit_number delete_file [controller_type] Usage: device.getdevices vmid Usage: device.nvdimmadd vmid size Usage: device.nvdimmremove vmid deviceKey Usage: device.toolsSyncSet vmid new state Usage: devices.createnic vmid adapter-type network-id [network-type] Usage: get.capability vmid Usage: get.config vmid Usage: get.config.cpuidmask vmid Usage: get.configoption vmid Usage: get.datastores vmid Usage: get.disabledmethods vmid Usage: get.environment vmid Usage: get.filelayout vmid Usage: get.filelayoutex vmid Usage: get.guest vmid Usage: get.guestheartbeatStatus vmid Usage: get.managedentitystatus vmid Usage: get.networks vmid Usage: get.runtime vmid Usage: get.snapshotinfo vmid Usage: get.spaceNeededForConsolidation vmid Usage: get.summary vmid Usage: get.tasklist vmid Usage: message vmid [messageId] [messageChoice] Usage: power.getstate vmid Usage: power.hibernate vmid Usage: power.off vmid Usage: power.on vmid Usage: power.reboot vmid Usage: power.reset vmid Usage: power.shutdown vmid Usage: power.suspend vmid Usage: power.suspendResume vmid Usage: queryftcompat vmid [faultToleranceType] Usage: reload vmid Usage: setscreenres vmid width height Usage: snapshot.create vmid [snapshotName] [snapshotDescription] [includeMemory] [quiesced] Usage: snapshot.get vmid Usage: snapshot.remove vmid snapshotId [removeChildren] Usage: snapshot.removeall vmid Usage: snapshot.revert vmid snapshotId suppressPowerOn Usage: snapshot.setoption [OPTIONS] vmid Usage: tools.cancelinstall vmid Usage: tools.install vmid Usage: tools.upgrade vmid [args] Usage: unregister vmid Usage: upgrade vmid [vm_hwversion]
In the above list, the bold entries have to do with power, that is what this series is supposed to center around, so more on that tomorrow.
–jeroen
Posted in *nix, *nix-tools, ash/dash, ash/dash development, Awk, Development, ESXi6, ESXi6.5, ESXi6.7, ESXi7, fgrep, Power User, Scripting, sed, sed script, sh, Sh Shell, Software Development, sort, Virtualization, VMware, VMware ESXi, xargs | Leave a Comment »









