Troubleshooting Deploying Server 2019 using Packer

I am working on rebuilding my homelab and I was looking for a way to quickly automate building out my templates onto my VMware environment. I have used Packer in the past for this process but its been so long I had forgot how to do anything. With a quick Google I found this https://github.com/guillermo-musumeci/packer-vsphere-iso-windows-v2 that had everything ready to be customized for my environment. When I ran packer build .\win2019.json I received the following error.

I verified I had all my credentials correct in the credentials.json and I was following all of the instructions. After some troubleshooting I found that I needed to add the variable -var-file. So the completed command was packer build -var-file .\credentials.json .\win2019.base.json.

Set NTP on all host in vCenter

Here is a Powershell script that will set NTP on all the ESX host connected to your vCenter.

First connect to the vCenter using Connect-VIserver then run the following code.

 

#Get Host
write-host “Gathering ESX Host”
$esx = get-vmhost

#Configure NTP server
write-host “configuring NTP”
Add-VmHostNtpServer -VMHost $esx -NtpServer 10.10.16.220

#Allow NTP queries outbound through the firewall
wrtie-host “Setting Firewall Permissions”
Get-VMHostFirewallException -VMHost $esx | where {$_.Name -eq “NTP client”} | Set-VMHostFirewallException -Enabled:$true

#Start NTP client service and set to automatic
write-host “Starting NTP service”
Get-VmHostService -VMHost $esx | Where-Object {$_.key -eq “ntpd”} | Start-VMHostService
Get-VmHostService -VMHost $esx | Where-Object {$_.key -eq “ntpd”} | Set-VMHostService -policy “automatic”

 

Blog at WordPress.com.

Up ↑