Idempotency issue when deploying Session Hosts
TMirpuri13 opened this issue · 4 comments
What happened? Provide a clear and concise description of the bug, including deployment details.
As I have to consistently to deploy over development environment to get to the Production environment, I've found an issue recently where it is not processing the 'SessionHostConfig' extension correctly. It seems to because that the "SessionHostConfiguration.log" already exists within the host. Is it possible to include deleting the log before running the extension? Has this come up before in repository's testing?
Please provide the correlation id associated with your error or bug.
N/A - no correleation id attached, only the log below
What was the expected outcome?
The expected outcome is that the session host's extension would idempotently be deployed and this shouldn't affect the overlaying deployment every time. As this doesn't work for one host, eventually the other hosts are offline and the pipeline is unable to modify the extensions when the VM is not running.
Relevant log output
VM has reported a failure when processing extension 'SessionHostConfig' (publisher 'Microsoft.Compute' and type 'CustomScriptExtension'). Error message: 'Command execution finished, but failed because it returned a non-zero exit code of: '1'. The command had an error output of: 'New-Item : The file 'C:\AVDSessionHostConfig.log' already exists.
At
C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.15\Downloads\10\Set-SessionHostConfiguration.ps1:52
char:9
+ New-Item -Path 'C:\' -Name 'AVDSessionHostConfi...' For more information, check the instance view by executing Get-AzVmssVm or Get-AzVm (https://aka.ms/GetAzVm). These commands can be executed using CloudShell (https://aka.ms/CloudShell)'. More information on troubleshooting is available at https://aka.ms/VMExtensionCSEWindowsTroubleshoot. (Code: VMExtensionProvisioningError)
@danycontre - as part of my testing of removing the C:\AVDSessionHostConfig.log in the dev environment has allowed for successful idempotent runs, however the run in preprod is failing for the same reasons above. Manually deleting the file is not a suitable fix to clean up the log each run.
@TMirpuri13 thanks for the insights, we continue to review.
Hi @moisesjgomez @swathibhat1 @danycontre - any updates on this bug please?
Hello @TMirpuri13 Could you help us to better understand your deployment please? Esp. with regards to how you are redeploying the environment to get to production state. The current templates are intended for a greenfield deployment, not necessarily for redeployment. Please help us to better understand your scenario so we may better target a resolution. Thank you!