{ "builders": [ { "type": "vsphere-iso", "name": "srv2019-virtual", "vcenter_server": "{{user `vcenter_server`}}", "username": "{{user `vsphere_username`}}", "password": "{{user `vsphere_password`}}", "insecure_connection": "true", "vm_name": "{{user `vm_guestos`}}-{{user `vm_name`}}-virtual", "datastore": "{{user `vsphere_datastore`}}", "folder": "{{user `vsphere_folder`}}", "datacenter": "{{user `vsphere_datacenter`}}", "host": "{{user `vsphere_host`}}", "boot_order": "disk,cdrom", "guest_os_type": "windows9Server64Guest", "communicator": "winrm", "winrm_username": "administrator", "winrm_password": "{{user `winrm_password`}}", "winrm_timeout": "10m", "cpus": 2, "RAM": 8192, "network_adapters": [ { "network": "{{user `vsphere_network`}}", "network_card": "vmxnet3" } ], "storage": [ { "disk_size": 20480, "disk_thin_provisioned": true } ], "disk_controller_type": "lsilogic-sas", "usb_controller": "xhci", "iso_url": "https://{{user `repo_username`}}:{{user `repo_password`}}@sn.itch.fyi/Repository/iso/Microsoft/Windows%20Server%202019/LTSC/en_windows_server_2019_x64_dvd_4cb967d8.iso", "iso_checksum": "sha256:4c5dd63efee50117986a2e38d4b3a3fbaf3c1c15e2e7ea1d23ef9d8af148dd2d", "iso_paths": [ "[Datastore01.NAS] contentlib-5c2187fa-55c5-4285-b06b-3f5f1ff9428d/e9342f62-6132-4044-bd42-48cab8c77034/VMware-tools-windows-11.2.1-17243207_4f88be10-b163-446b-ad7d-992e63b0e3ac.iso" ], "floppy_files": [ "packer/preseed/Server2019/Autounattend.xml", "packer/preseed/Server2019/Sysprep_Unattend.xml", "scripts/Set-NetworkProfile.ps1", "scripts/Disable-WinRM.ps1", "scripts/Enable-WinRM.ps1", "scripts/Install-VMwareTools.cmd" ], "boot_command": "", "boot_wait": "5m", "shutdown_command": "C:\\Windows\\System32\\Sysprep\\sysprep.exe /generalize /oobe /unattend:A:\\Sysprep_Unattend.xml", "shutdown_timeout": "1h", "export": { "images": false } }, { "type": "vsphere-iso", "name": "srv2019-physical", "vcenter_server": "{{user `vcenter_server`}}", "username": "{{user `vsphere_username`}}", "password": "{{user `vsphere_password`}}", "insecure_connection": "true", "vm_name": "{{user `vm_guestos`}}-{{user `vm_name`}}-physical", "datastore": "{{user `vsphere_datastore`}}", "folder": "{{user `vsphere_folder`}}", "datacenter": "{{user `vsphere_datacenter`}}", "host": "{{user `vsphere_host`}}", "boot_order": "disk,cdrom", "guest_os_type": "windows9Server64Guest", "communicator": "winrm", "winrm_username": "administrator", "winrm_password": "{{user `winrm_password`}}", "winrm_timeout": "10m", "cpus": 2, "RAM": 8192, "network_adapters": [ { "network": "{{user `vsphere_network`}}", "network_card": "vmxnet3" } ], "storage": [ { "disk_size": 20480, "disk_thin_provisioned": true } ], "disk_controller_type": "lsilogic-sas", "usb_controller": "xhci", "iso_url": "https://{{user `repo_username`}}:{{user `repo_password`}}@sn.itch.fyi/Repository/iso/Microsoft/Windows%20Server%202019/LTSC/en_windows_server_2019_x64_dvd_4cb967d8.iso", "iso_checksum": "sha256:4c5dd63efee50117986a2e38d4b3a3fbaf3c1c15e2e7ea1d23ef9d8af148dd2d", "iso_paths": [ "[Datastore01.NAS] contentlib-5c2187fa-55c5-4285-b06b-3f5f1ff9428d/e9342f62-6132-4044-bd42-48cab8c77034/VMware-tools-windows-11.2.1-17243207_4f88be10-b163-446b-ad7d-992e63b0e3ac.iso" ], "floppy_files": [ "packer/preseed/Server2019/Autounattend.xml", "packer/preseed/Server2019/Sysprep_Unattend.xml", "scripts/Set-NetworkProfile.ps1", "scripts/Disable-WinRM.ps1", "scripts/Enable-WinRM.ps1", "scripts/Install-VMwareTools.cmd", "scripts/Uninstall-VMwareTools.Sysprep.cmd" ], "boot_command": "", "boot_wait": "5m", "shutdown_command": "A:\\Uninstall-VMwareTools.Sysprep.cmd", "shutdown_timeout": "1h" } ], "provisioners": [ { "type": "windows-update" }, { "type": "powershell", "inline": [ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12", "Invoke-Expression ((New-Object Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" ] }, { "type": "powershell", "inline": [ "choco config set --name=limit-output --value=LimitOutput", "choco install -y 7zip.install", "choco install -y sysinternals" ], "valid_exit_codes": [0, 3010] }, { "type": "windows-update" }, { "type": "windows-restart", "restart_check_command":"powershell -command \"& {Write-Output 'Probing restart status'}\"" } ], "post-processors": [[ { "only": ["srv2019-virtual"], "type": "shell-local", "inline": [ "pwsh -file scripts/Apply-VMConfigSpec.ps1 \\", " -VMConfigSpec 'Server2019' \\", " -VMName {{user `vm_guestos`}}-{{user `vm_name`}} \\", " -VSpherePassword '{{user `vsphere_password`}}'" ] }, { "only": ["srv2019-virtual"], "type": "vsphere", "host": "{{user `vcenter_server`}}", "username": "{{user `vsphere_username`}}", "password": "{{user `vsphere_password`}}", "insecure": true, "vm_name": "Windows-Server-2019-LTSC", "datacenter": "{{user `vsphere_datacenter`}}", "cluster": "{{user `vsphere_host`}}", "vm_folder": "{{user `vsphere_templatefolder`}}", "datastore": "{{user `vsphere_datastore`}}", "disk_mode": "thin", "vm_network": "{{user `vsphere_network`}}", "overwrite": true, "keep_input_artifact": true }, { "only": ["srv2019-virtual"], "type": "vsphere-template", "host": "{{user `vcenter_server`}}", "username": "{{user `vsphere_username`}}", "password": "{{user `vsphere_password`}}", "insecure": true, "datacenter": "{{user `vsphere_datacenter`}}", "folder": "{{user `vsphere_templatefolder`}}", "reregister_vm": false } ]] }