Open JohanVanneuville opened 1 year ago
add news about this? The feature is GA
same problem here, looking forward to using this new feature with TF
Running into the same problem. Thought that I was missing a param but then discovered this issue.
From reading the API spec it seems that the Microsoft.DesktopVirtualization/scalingPlans
resource currently does not support creating schedules containing attributes which are specific to personal host pool types.
I would suggest that the existing azurerm_virtual_desktop_scaling_plan
resource should support omitting a schedules
block and support setting hostPoolType
= "Personal". This is however not supported in the latest GA spec 2023-09-05
.
Based on the latest API 2023-11-01-preview
I assume a new resource would need to be created for this to work natively using the azurerm provider , e.g. azurerm_virtual_desktop_personal_scaling_plan
Workaround for now using AzApi
resource "azapi_resource" "weekdays_personal_schedule_root" {
count = var.enable_scaling ? 1 : 0
type = "Microsoft.DesktopVirtualization/scalingPlans@2023-11-01-preview"
name = "t-gis-avd-scaling"
location = azurerm_virtual_desktop_host_pool.main.location
parent_id = azurerm_resource_group.main.id
body = jsonencode({
properties = {
timeZone = "W. Europe Standard Time",
hostPoolType = "Personal",
exclusionTag = "no-schedule",
schedules = [],
hostPoolReferences = [
{
hostPoolArmPath = azurerm_virtual_desktop_host_pool.main.id,
scalingPlanEnabled = true
}
],
} })
}
resource "azapi_resource" "weekdays_personal_schedule" {
count = var.enable_scaling ? 1 : 0
type = "Microsoft.DesktopVirtualization/scalingPlans/personalSchedules@2023-11-01-preview"
name = "Weekdays"
parent_id = azapi_resource.weekdays_personal_schedule_root[0].id
body = jsonencode({
properties = {
daysOfWeek = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
]
rampUpStartTime = {
hour = 7,
minute = 0
},
rampUpAutoStartHosts = "None",
rampUpStartVMOnConnect = "Enable",
rampUpMinutesToWaitOnDisconnect = 45,
rampUpActionOnDisconnect = "Hibernate",
rampUpMinutesToWaitOnLogoff = 30,
rampUpActionOnLogoff = "Hibernate",
peakStartTime = {
hour = 8,
minute = 0
},
peakStartVMOnConnect = "Enable",
peakMinutesToWaitOnDisconnect = 60,
peakActionOnDisconnect = "Hibernate",
peakMinutesToWaitOnLogoff = 60,
peakActionOnLogoff = "Hibernate",
rampDownStartTime = {
hour = 16,
minute = 30
},
rampDownStartVMOnConnect = "Enable",
rampDownMinutesToWaitOnDisconnect = 45,
rampDownActionOnDisconnect = "Hibernate",
rampDownMinutesToWaitOnLogoff = 30,
rampDownActionOnLogoff = "Hibernate",
offPeakStartTime = {
hour = 17,
minute = 30
},
offPeakStartVMOnConnect = "Enable",
offPeakMinutesToWaitOnDisconnect = 20,
offPeakActionOnDisconnect = "Hibernate",
offPeakMinutesToWaitOnLogoff = 15,
offPeakActionOnLogoff = "Hibernate",
}
})
}
Any good news on this feature?
Is there an existing issue for this?
Community Note
Description
Please include support for personal host pools in the scaling plan resource If I try to add this parameter in the file host_pool_type = "Personal" it doesn't work.
New or Affected Resource(s)/Data Source(s)
azurerm 3.65.0
Potential Terraform Configuration
References
No response