Smalls1652/SmallsOnline.AVD.ResourceManager

[Feature]: Add custom threshold for deallocation

Opened this issue · 0 comments

What kind of change is this?

Addition

What's the description of the change?

Session hosts are currently configured to deallocate at a hard-set rate of 40 minutes of inactivity between evaluation cycles (2 cycles).

There needs to be a way to set a custom limit, so, for instance, you would want it to deallocate after a hour of inactivity. That would be set to 3 cycles instead.

What are the proposed changes that need to be made?

This one is bit of a tricky one.

The simple solution is to just add a configurable environment setting (Or, as it’s called in Azure, “App Settings”), but that doesn’t seem like the best option to go with.

A more complex solution would be to make it configurable in the database, but that would require some way to make it easily configurable for admins. Personally, I can handle interacting with the CosmosDB account since I’m very familiar with it; however, that’s not user friendly. Maybe start working on an API for configuring all of the bits and pieces of the solution? I’ll open another issue for this, because this would open up an opportunity to allow extra configuration on the backend for admins.

Then there’s the evaluation portion of it. Should it be based off of evaluation cycle counts or the amount of minutes the session host has been inactive? The timer is set to run every 20 minutes, but there’s a possibility I could drop that down to a lower interval to make the deallocations happen at a more granular level. There are two things I’ll have to look into:

  1. The potential cost increase for this. I don’t think this will cause a massive increase as my current forecasted cost for running the Functions app, CosmosDB account, Log Analytics workspace, and Application Insights resources in my Azure subscription is a lot lower than it was originally forecasted to be (Now it’s only $0.74 USD this month, down from just shy of $2 USD).
  2. Improving performance. I believe I’ve seen it take roughly 8 seconds per run. This might not be a huge issue, but it could cause some impact.