Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer in Azure only applies the first update found (win-10 and win-11) #125

Open
simonlock opened this issue Mar 13, 2023 · 1 comment
Open

Comments

@simonlock
Copy link

Packer in Azure using packer 1.8.5:

image offer: windows-10
publisher: MicrosoftWindowsDesktop
image sku: win10-22h2-avd-g2

and

image offer: windows-11
publisher: MicrosoftWindowsDesktop
image sku: win11-22h2-avd-g2

I've found that instructing a restart provisioner and also a second (or even third) windows update provisioner finds additional updates but still fails to install them.
The addon is no longer handling reboots or continues correctly, it seems. and is only installing the very first update found.
I've also tried the updated plugin @ version "0.14.2" but the problem is the same.

As described above I've tried the following:

provisioner "windows-update" {
search_criteria = "IsInstalled=0"
filters = [
"exclude:$_.Title -like 'Preview'",
"include:$true",
]
update_limit = 25
}

provisioner "windows-restart" {
}

provisioner "windows-update" {
search_criteria = "IsInstalled=0"
filters = [
"exclude:$_.Title -like 'Preview'",
"include:$true",
]
update_limit = 25
}

In the following output, only KB5012170 gets installed properly. Furthermore, not all available updates are found.

azure-arm.test-acg: Uploading the Windows update elevated script...�[0m
azure-arm.test-acg: Uploading the Windows update check for reboot required elevated script...�[0m
azure-arm.test-acg: Uploading the Windows update script...�[0m
azure-arm.test-acg: Running Windows update...�[0m
azure-arm.test-acg: Searching for Windows updates...�[0m
azure-arm.test-acg: Found Windows update (2022-11-10; 0.04 MB): 2022-08 Security Update for Windows 11 22H2 for x64-based Systems (KB5012170)�[0m
azure-arm.test-acg: Found Windows update (2023-02-14; 40.79 MB): Windows Malicious Software Removal Tool x64 - v5.110 (KB890830)�[0m
azure-arm.test-acg: Found Windows update (2023-03-13; 100.34 MB): Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.383.1708.0)�[0m
azure-arm.test-acg: Downloading Windows updates (3 updates; 141.17 MB)...�[0m
azure-arm.test-acg: Installing Windows updates...�[0m
azure-arm.test-acg: Waiting for operation to complete (system performance: 3% cpu; 13% memory)...�[0m
azure-arm.test-acg: Waiting for operation to complete (system performance: 1% cpu; 15% memory)...�[0m
azure-arm.test-acg: Waiting for operation to complete (system performance: 3% cpu; 13% memory)...�[0m
azure-arm.test-acg: Restarting Machine�[0m
azure-arm.test-acg: Waiting for machine to restart...�[0m
azure-arm.test-acg: pkrvmxvtbbdxe98 restarted.�[0m
azure-arm.test-acg: Machine successfully restarted, moving on�[0m
azure-arm.test-acg: Uploading the Windows update elevated script...�[0m
azure-arm.test-acg: Uploading the Windows update check for reboot required elevated script...�[0m
azure-arm.test-acg: Uploading the Windows update script...�[0m
azure-arm.test-acg: Running Windows update...�[0m
azure-arm.test-acg: Searching for Windows updates...�[0m
azure-arm.test-acg: Found Windows update (2023-02-14; 9.4 MB): Update for Microsoft Defender Antivirus antimalware platform - KB4052623 (Version 4.18.2301.6)�[0m
azure-arm.test-acg: Downloading Windows updates (1 updates; 9.4 MB)...�[0m
azure-arm.test-acg: Installing Windows updates...�[0m

Any help or suggestions in fixing this would be really appreciated.

@simonlock
Copy link
Author

The problem also exists when using Packer 1.8.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant