Questions about: Switch to build managed image instead of VHD (#8167) (#8208) #8234
Replies: 4 comments 6 replies
-
|
Hey! We still preserve a vhd file, but since September 30th it will be prohibited to create a new unmanaged disk on newly created subscriptions in azure, we have to make sure that the ones who would love to get vhd can still do it, i.e. we do not yet migrate to compute galleries / unmanned disks for the time being, just preserve the old approach different way |
Beta Was this translation helpful? Give feedback.
-
|
Do you mean the old way would stop working September 30th 2023 because the temporary VM during packer build is using unmanaged disk and that would be prevented? If so, that makes it more clear for me at least to as why the drastic changes are performed to the helper scripts which also removed support for "the old way". I also missed the small sentence about September 30th 2023 (ref here) that would prevent it from being created, I just saw the big headline about deprecation in September 30th 2025. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
|
Has anyone been able to successfully get the packer output managed image (without the conversion steps in https://github.com/actions/runner-images/blob/main/images.CI/linux-and-win/convert-to-vhd.ps1) working for Windows Server 2022? Linking the Ubuntu packer managed images directly to a VM/VMSS works perfectly, but the Windows 2022 get stuck in a "Creating" state. I can see the screen capture of the windows login screen so it is deploying, but it seems like it is not specializing correctly and getting stuck. As a test, I removed all provisioners from the Windows2022.json file except for generalization, and it works perfect then. {
"type": "powershell",
"inline": [
"if( Test-Path $Env:SystemRoot\\System32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\System32\\Sysprep\\unattend.xml -Force}",
"& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /mode:vm /quiet /quit",
"while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }"
]
}When I add back all of the provisioners which are in the repo it gets stuck in that "creating" state again. I am currently going through the conversion steps in https://github.com/actions/runner-images/blob/main/images.CI/linux-and-win/convert-to-vhd.ps1; to see if I can still repro this issue. I'd rather use the managed image directly because unmanaged disks are quickly being deprecated, the extra conversion steps are very slow, and extra steps makes this process more fragile. Is what I am seeing when trying to use the windows 2022 image directly as produced by Packer with all provisioners present excepted behavior? |
Beta Was this translation helpful? Give feedback.
-
|
We're locking this discussion because it has not had recent activity and/or other members have asked for more information to assist you but received no response. Thank you for helping us maintain a productive and tidy community for all our members. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am really confused about the drastic changes in #8167 and #8208, as both helpers
GenerateResourcesAndImage.ps1andCreateAzureVMFromPackerTemplate.ps1contains breaking changes for anyone else currently using those for integrations based on previous version of create-image-and-azure-resources.md.If the intention is to ensure the VM's are not using unmanaged disks going forward, it becomes weird we are suddenly forced to generate managed image, while it could simply be added that a managed disk would be created based on the storage account page blob VHD artifact, and optionally delete this source page blob thereafter.
Simply adding i.e.
az disk create --name $ManagedDiskName --resource-group $ResourceGroupName --source <URI-to-generated-page-blob-VHD-in-storage-account>After a successful
packer buildwould give you a finished managed disk artifact afterGenerateResourcesAndImage.ps1to be used by the VM to be created inCreateAzureVMFromPackerTemplate.ps1, and it could simply be added without introducing any breaking changes.Another thing that is confusing for me is seeing that you have added steps in your own CI here in the same PR's that seem to be doing the following:
->->->->->->->...and what you have left is a page blob VHD copied to a storage account while everything else added to the other helpers was to not get a page VHD blob? Really confusing.
Could someone give some input why all these drastic changes were needed to be done to the helpers simply to not default to using unmanaged disks ? It seems it could have been made a lot easier and without any breaking changes to the helpers at least.
Beta Was this translation helpful? Give feedback.
All reactions