forked from fberson/wvd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavdScalingPlan.bicep
183 lines (180 loc) · 6.74 KB
/
avdScalingPlan.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
//Scaling plan parameters
param scalingPlanName string
param scalingPlanLocation string
param scalingPlanDescription string
param scalingPlanExclusionTag string
param scalingPlanFriendlyName string
@allowed([
'Pooled'
])
param scalingPlanHostPoolType string
param scalingPlanTimeZone string
param scalingPlanhostPoolArmPath string
param scalingPlanEnabled bool = true
//Weekdays schedule parameters
param weekdaysScheduleName string
param weekdaysSchedulerampUpStartTimeHour int
param weekdaysSchedulerampUpStartTimeMinute int
@allowed([
'BreadthFirst'
'DepthFirst'
])
param weekdaysSchedulerampUpLoadBalancingAlgorithm string
param weekdaysSchedulerampUpMinimumHostsPct int
param weekdaysSchedulerampUpCapacityThresholdPct int
param weekdaysSchedulepeakStartTimeHour int
param weekdaysSchedulepeakStartTimeMinute int
param weekdaysSchedulerampDownStartTimeHour int
param weekdaysSchedulerampDownStartTimeMinute int
@allowed([
'BreadthFirst'
'DepthFirst'
])
param weekdaysSchedulerampDownLoadBalancingAlgorithm string
param weekdaysScheduleoffPeakStartTimeHour int
param weekdaysScheduleoffPeakStartTimeMinute int
@allowed([
'BreadthFirst'
'DepthFirst'
])
param weekdaysSchedulepeakLoadBalancingAlgorithm string
param weekdaysSchedulerampDownMinimumHostsPct int
param weekdaysSchedulerampDownCapacityThresholdPct int
param weekdaysSchedulerampDownForceLogoffUsers bool
@allowed([
'ZeroSessions'
'ZeroActiveSessions'
])
param weekdaysSchedulerampDownStopHostsWhen string
param weekdaysrampDownWaitTimeMinutes int
param weekdaysrampDownNotificationMessage string
//weekends schedule parameters
param weekendsScheduleName string
param weekendsSchedulerampUpStartTimeHour int
param weekendsSchedulerampUpStartTimeMinute int
@allowed([
'BreadthFirst'
'DepthFirst'
])
param weekendsSchedulerampUpLoadBalancingAlgorithm string
param weekendsSchedulerampUpMinimumHostsPct int
param weekendsSchedulerampUpCapacityThresholdPct int
param weekendsSchedulepeakStartTimeHour int
param weekendsSchedulepeakStartTimeMinute int
param weekendsSchedulerampDownStartTimeHour int
param weekendsSchedulerampDownStartTimeMinute int
@allowed([
'BreadthFirst'
'DepthFirst'
])
param weekendsSchedulerampDownLoadBalancingAlgorithm string
param weekendsScheduleoffPeakStartTimeHour int
param weekendsScheduleoffPeakStartTimeMinute int
@allowed([
'BreadthFirst'
'DepthFirst'
])
param weekendsSchedulepeakLoadBalancingAlgorithm string
param weekendsSchedulerampDownMinimumHostsPct int
param weekendsSchedulerampDownCapacityThresholdPct int
param weekendsSchedulerampDownForceLogoffUsers bool
@allowed([
'ZeroSessions'
'ZeroActiveSessions'
])
param weekendsSchedulerampDownStopHostsWhen string
param weekendsrampDownWaitTimeMinutes int
param weekendsrampDownNotificationMessage string
@description('Create an VD Scaling plan including a weekdays and weekends schedule')
resource sp 'Microsoft.DesktopVirtualization/scalingPlans@2021-09-03-preview' = {
name: scalingPlanName
location: scalingPlanLocation
properties: {
description: scalingPlanDescription
exclusionTag: scalingPlanExclusionTag
friendlyName: scalingPlanFriendlyName
hostPoolType: scalingPlanHostPoolType
schedules: [
{
rampUpStartTime: {
hour: weekdaysSchedulerampUpStartTimeHour
minute: weekdaysSchedulerampUpStartTimeMinute
}
peakStartTime: {
hour: weekdaysSchedulepeakStartTimeHour
minute: weekdaysSchedulepeakStartTimeMinute
}
rampDownStartTime: {
hour: weekdaysSchedulerampDownStartTimeHour
minute: weekdaysSchedulerampDownStartTimeMinute
}
offPeakStartTime: {
hour: weekdaysScheduleoffPeakStartTimeHour
minute: weekdaysScheduleoffPeakStartTimeMinute
}
name: weekdaysScheduleName
daysOfWeek: [
'Monday'
'Tuesday'
'Wednesday'
'Thursday'
'Friday'
]
rampUpLoadBalancingAlgorithm: weekdaysSchedulerampUpLoadBalancingAlgorithm
rampUpMinimumHostsPct: weekdaysSchedulerampUpMinimumHostsPct
rampUpCapacityThresholdPct: weekdaysSchedulerampUpCapacityThresholdPct
peakLoadBalancingAlgorithm: weekdaysSchedulepeakLoadBalancingAlgorithm
rampDownLoadBalancingAlgorithm: weekdaysSchedulerampDownLoadBalancingAlgorithm
rampDownMinimumHostsPct: weekdaysSchedulerampDownMinimumHostsPct
rampDownCapacityThresholdPct: weekdaysSchedulerampDownCapacityThresholdPct
rampDownForceLogoffUsers: weekdaysSchedulerampDownForceLogoffUsers
rampDownWaitTimeMinutes: weekdaysrampDownWaitTimeMinutes
rampDownNotificationMessage: weekdaysrampDownNotificationMessage
rampDownStopHostsWhen: weekdaysSchedulerampDownStopHostsWhen
offPeakLoadBalancingAlgorithm: weekdaysSchedulepeakLoadBalancingAlgorithm
}
{
rampUpStartTime: {
hour: weekendsSchedulerampUpStartTimeHour
minute: weekendsSchedulerampUpStartTimeMinute
}
peakStartTime: {
hour: weekendsSchedulepeakStartTimeHour
minute: weekendsSchedulepeakStartTimeMinute
}
rampDownStartTime: {
hour: weekendsSchedulerampDownStartTimeHour
minute: weekendsSchedulerampDownStartTimeMinute
}
offPeakStartTime: {
hour: weekendsScheduleoffPeakStartTimeHour
minute: weekendsScheduleoffPeakStartTimeMinute
}
name: weekendsScheduleName
daysOfWeek: [
'Saturday'
'Sunday'
]
rampUpLoadBalancingAlgorithm: weekendsSchedulerampUpLoadBalancingAlgorithm
rampUpMinimumHostsPct: weekendsSchedulerampUpMinimumHostsPct
rampUpCapacityThresholdPct: weekendsSchedulerampUpCapacityThresholdPct
peakLoadBalancingAlgorithm: weekendsSchedulepeakLoadBalancingAlgorithm
rampDownLoadBalancingAlgorithm: weekendsSchedulerampDownLoadBalancingAlgorithm
rampDownMinimumHostsPct: weekendsSchedulerampDownMinimumHostsPct
rampDownCapacityThresholdPct: weekendsSchedulerampDownCapacityThresholdPct
rampDownForceLogoffUsers: weekendsSchedulerampDownForceLogoffUsers
rampDownWaitTimeMinutes: weekendsrampDownWaitTimeMinutes
rampDownNotificationMessage: weekendsrampDownNotificationMessage
rampDownStopHostsWhen: weekendsSchedulerampDownStopHostsWhen
offPeakLoadBalancingAlgorithm: weekendsSchedulepeakLoadBalancingAlgorithm
}
]
timeZone: scalingPlanTimeZone
hostPoolReferences: [
{
hostPoolArmPath: scalingPlanhostPoolArmPath
scalingPlanEnabled: scalingPlanEnabled
}
]
}
}