forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfleet.tsp
More file actions
225 lines (180 loc) · 7.91 KB
/
fleet.tsp
File metadata and controls
225 lines (180 loc) · 7.91 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-autorest";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Autorest;
using Azure.ResourceManager;
using OpenAPI;
namespace Microsoft.AzureFleet;
@doc("An Compute Fleet resource")
model Fleet is TrackedResource<FleetProperties> {
@doc("The name of the Compute Fleet")
@key("fleetName")
@segment("fleets")
@pattern("^[^_\\W][\\w-._]{0,79}(?<![-.])$")
@path
name: string;
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "Zones is a valid property"
@doc("Zones in which the Compute Fleet is available")
zones?: Array<string>;
...ManagedServiceIdentityProperty;
...ResourcePlanProperty;
}
@doc("Fleet Update Model")
model FleetUpdate {
...Azure.ResourceManager.Foundations.ArmTagsProperty;
/** Updatable managed service identity */
identity?: ManagedServiceIdentityUpdate;
/** Updatable resource plan */
plan?: ResourcePlanUpdate;
/** RP-specific updatable properties */
properties?: FleetProperties;
}
model ManagedServiceIdentityUpdate
is OptionalProperties<UpdateableProperties<Azure.ResourceManager.Legacy.ManagedServiceIdentityV4>>;
model ResourcePlanUpdate
is OptionalProperties<UpdateableProperties<Azure.ResourceManager.Foundations.Plan>>;
@doc("The status of the current operation.")
@Azure.Core.lroStatus
union ProvisioningState {
string,
ResourceProvisioningState,
@doc("Initial creation in progress.")
Creating: "Creating",
@doc("Update in progress.")
Updating: "Updating",
@doc("Deletion in progress.")
Deleting: "Deleting",
@doc("Resource is being migrated from one subscription or resource group to another.")
Migrating: "Migrating",
}
@doc("Details of the Compute Fleet.")
model FleetProperties {
@visibility("read")
@doc("The status of the last operation.")
provisioningState?: ProvisioningState;
@doc("Configuration Options for Spot instances in Compute Fleet.")
spotPriorityProfile?: SpotPriorityProfile;
@doc("Configuration Options for Regular instances in Compute Fleet.")
regularPriorityProfile?: RegularPriorityProfile;
@extension("x-ms-identifiers", [])
@doc("List of VM sizes supported for Compute Fleet")
vmSizesProfile: Array<VmSizeProfile>;
@doc("Compute Profile to use for running user's workloads.")
computeProfile: ComputeProfile;
}
@doc("Compute Profile to use for running user's workloads.")
model ComputeProfile {
@doc("""
Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile"
""")
baseVirtualMachineProfile: BaseVirtualMachineProfile;
@doc("""
Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines.
The default value will be the latest supported computeApiVersion by Compute Fleet.
""")
computeApiVersion?: string;
@added(Versions.v2024_05_01_preview)
@doc("""
Specifies the number of fault domains to use when creating the underlying VMSS.
A fault domain is a logical group of hardware within an Azure datacenter.
VMs in the same fault domain share a common power source and network switch.
If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible).
This property cannot be updated.
""")
platformFaultDomainCount?: int32;
}
@doc("BaseVirtualMachineProfile")
@useRef("../../../../../compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-09-01/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile")
model BaseVirtualMachineProfile {}
@doc("Specifications about a VM Size. This will also contain the corresponding rank and weight in future.")
model VmSizeProfile {
@doc("The Sku name (e.g. 'Standard_DS1_v2')")
name: string;
@added(Versions.v2024_05_01_preview)
@doc("""
The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized'
The lower the number, the higher the priority. Starting with 0.
""")
@minValue(0)
@maxValue(65535)
rank?: int32;
}
@doc("Contains common properties that are applicable to both Spot and Regular.")
model BasePriorityProfile {
@doc("Total capacity to achieve. It is currently in terms of number of VMs.")
@minValue(0)
capacity?: int32;
@doc("Minimum capacity to achieve which cannot be updated. If we will not be able to \"guarantee\" minimum capacity, we will reject the request in the sync path itself.")
@minValue(0)
minCapacity?: int32;
}
@doc("Configuration Options for Spot instances in Compute Fleet.")
model SpotPriorityProfile is BasePriorityProfile {
#suppress "@azure-tools/typespec-azure-core/casing-style" "maxPricePerVM has VM which does not follow camel casing"
@doc("Price per hour of each Spot VM will never exceed this.")
maxPricePerVM?: float32;
@doc("Eviction Policy to follow when evicting Spot VMs.")
evictionPolicy?: EvictionPolicy;
@doc("Allocation strategy to follow when determining the VM sizes distribution for Spot VMs.")
allocationStrategy?: SpotAllocationStrategy;
@added(Versions.v2024_05_01_preview)
@doc("""
Flag to enable/disable continuous goal seeking for the desired capacity and restoration of evicted Spot VMs.
If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are evicted deleted)
or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity constraint) in order to achieve the desired capacity.
Maintain is enabled by default.
""")
maintain?: boolean;
}
@doc("Spot allocation strategy types for Compute Fleet")
union SpotAllocationStrategy {
string,
@doc("Default. VM sizes distribution will be determined to optimize for both price and capacity.")
PriceCapacityOptimized: "PriceCapacityOptimized",
@doc("VM sizes distribution will be determined to optimize for price. Note: Capacity will still be considered here but will be given much less weight.")
LowestPrice: "LowestPrice",
@doc("VM sizes distribution will be determined to optimize for capacity.")
CapacityOptimized: "CapacityOptimized",
}
@doc("Configuration Options for Regular instances in Compute Fleet.")
model RegularPriorityProfile is BasePriorityProfile {
@doc("Allocation strategy to follow when determining the VM sizes distribution for Regular VMs.")
allocationStrategy?: RegularPriorityAllocationStrategy;
}
@doc("Regular VM Allocation strategy types for Compute Fleet")
union RegularPriorityAllocationStrategy {
string,
@doc("Default. VM sizes distribution will be determined to optimize for price.")
LowestPrice: "LowestPrice",
@added(Versions.v2024_05_01_preview)
@doc("VM sizes distribution will be determined to optimize for the 'priority' as specified for each vm size.")
Prioritized: "Prioritized",
}
@doc("Different kind of eviction policies")
union EvictionPolicy {
string,
@doc("When evicted, the Spot VM will be deleted and the corresponding capacity will be updated to reflect this.")
Delete: "Delete",
@doc("When evicted, the Spot VM will be deallocated/stopped")
Deallocate: "Deallocate",
}
@armResourceOperations
interface Fleets {
get is ArmResourceRead<Fleet>;
#suppress "@azure-tools/typespec-azure-core/invalid-final-state" "MUST CHANGE ON NEXT UPDATE"
@Azure.Core.useFinalStateVia("azure-async-operation")
createOrUpdate is ArmResourceCreateOrUpdateAsync<
Fleet,
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
update is ArmCustomPatchAsync<Fleet, FleetUpdate>;
delete is ArmResourceDeleteWithoutOkAsync<Fleet>;
listByResourceGroup is ArmResourceListByParent<Fleet>;
listBySubscription is ArmListBySubscription<Fleet>;
}