A toggle to enable Drain Mode on Startup of host when a startup script is selected

May I ask for an option that when hosts are turned on that they start with Drain Mode Enabled. And once a Host is fully online for Drain Mode to be disabled.

Reason of this ask is due to the below:

V6 SKU’s that have a Temporary D: Drive are no longer initialized/formatted on Startup. You have to run a startup script to enable the disk.

NVMe - Temp NVMe Disks FAQ - Azure Virtual Machines | Microsoft Learn

When enabling a startup script to initialize these new v6 disk…. We set Pagefile and FSLOGIX profiles to run on the D: Temp Drive, as this has crazy good IOPS and fslogix runs like a dream on the D: Drive. This obviously works fine for V5 VDI’s. But now with a startup script enabled to allow this work around…. During the script execution a user can log into the VDI, as the host is actually online and available to connect to.

So we have a small window of bad timing where a user may connect during this script execution. For the Pagefile and FSLOGIX to work on D: the script is set to reboot the host, as otherwise the pagefile stays on C: and Fslogix will keep the users on C: aswell.

I was thinking if there as an ability to set the host to drain mode automatically on Start of host… host turns on… runs its script… still in drain mode… script does its thing of rebooting host… host reboots… still in drain mode… host is online… script does its thing of cleaning up and deleting its self… and THEN drain mode is disabled… and a user can now connect safely.

5

Comments (2 comments)

0
Avatar
Joeri kumbruck

It would be indeed great if we can put AVD session hosts in drain mode from the start on.

I have configured scripted actions to put AVD session host in drain mode, then perform maintenance/cleanup actions and finally get AVD session host out of drain mode, but between the startup of the VM and the first scripted action to put the AVD session host in drain mode, there is a “gap” where users can still logon to the AVD session host and you do not want to have this as maintenance/cleanup actions ware being performed then on the AVD session host while users are already connected to the host.

So it would be a very useful feature to have drain mode enabled before or just at startup of the AVD session host VM.

0
Avatar
Raul Morales

Hi Allan, have you tried deploying the scripted action before the session host is joined to the AVD host pool?

Please sign in to leave a comment.