Repository navigation
HostPrep.ps1 v4.3.0: prompt for NTP servers instead of silently defaulting to pool.ntp.org - #7
Merged
Merged
Conversation
…lting When -NtpServers is not supplied on the command line, confirm the NTP server(s) interactively before any host is touched, offering pool.ntp.org as the default that Enter accepts. Passing -NtpServers still runs unattended with no prompt. The public pool is unreachable on the isolated management networks these hosts usually sit on, so silently applying it left every host with a dead time source -- which then surfaces later as confusing certificate and commissioning failures. Reported by a customer. (GitHub issue #6) README and parameter help updated; version bumped in both the .NOTES header and $ScriptMeta. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The requirements section still described the pre-4.1.0 scheme -- a throwaway ed25519 keypair pushed to each host over the HTTPS /host/ssh_root_authorized_keys endpoint. ESXi 9 removed that endpoint; since v4.1.0 the script authenticates with the root password via ssh.exe's SSH_ASKPASS helper. Brings the README in line with the script's own .NOTES header. (GitHub issue #3) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Without PowerCLI the script printed a wall of "not recognized" errors for every PowerCLI cmdlet, then carried on and prompted for the host list, the NTP servers and the root password before finally dying at Connect-VIServer. Check for VMware.VimAutomation.Core at the top of Initialisation -- ahead of the Get-PowerCLIConfiguration calls that error first -- and exit with the install command. Also notes that PowerCLI must be installed for the same PowerShell edition the script runs under, since a 5.1 install is invisible to PowerShell 7. Found while testing the NTP prompt on a machine without PowerCLI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6.
What changed
When
-NtpServersis not supplied on the command line, the script now confirms the NTP server(s) interactively before any host is touched:Pressing Enter still applies
pool.ntp.org— the point is that it becomes a deliberate choice rather than a silent parameter default. Passing-NtpServersbehaves exactly as before and never prompts, so unattended runs are unaffected.The prompt sits after the host list is loaded and before credential gathering, so the operator sees which time source is about to be pushed before typing the root password.
Reported by a customer: on the isolated management networks these hosts usually sit on,
pool.ntp.orgis unreachable, so the silent default left every host with a configured-but-dead time source — which then resurfaces later as confusing certificate and SDDC Manager commissioning failures.Also in this PR
/host/ssh_root_authorized_keysendpoint). ESXi 9 removed that endpoint; since v4.1.0 the script authenticates with the root password viassh.exe'sSSH_ASKPASShelper. The script's own.NOTESheader was already correct — only the README had drifted. (Replace Posh-SSH with the built-in Windows OpenSSH client #3).NOTESheader and$ScriptMeta; changelog and-NtpServersparameter help updated.Testing
Not yet run against a live ESXi host.
The NTP block itself was exercised in isolation with a real
parambinding:-NtpServers ntp1.corp.local,ntp2.corp.localntp1.corp.local, ntp2.corp.localpool.ntp.orgpool.ntp.orgntp1.vcf.labntp1.vcf.lab"ntp1.vcf.lab" , ntp2.vcf.lab ,ntp1.vcf.lab, ntp2.vcf.labQuotes, stray spaces and trailing commas are stripped; empty input falls back to the default rather than clearing the list.
🤖 Generated with Claude Code