|
39 | 39 | customNetworkingSpec, customNetworkingVMSS = getCustomNetworkingVMSS() |
40 | 40 | spotVMSpec, spotVMVMSS = getSpotVMVMSS() |
41 | 41 | ephemeralSpec, ephemeralVMSS = getEPHVMSSS() |
| 42 | + resourceDiskSpec, resourceDiskVMSS = getResourceDiskVMSS() |
42 | 43 | evictionSpec, evictionVMSS = getEvictionPolicyVMSS() |
43 | 44 | maxPriceSpec, maxPriceVMSS = getMaxPriceVMSS() |
44 | 45 | encryptionSpec, encryptionVMSS = getEncryptionVMSS() |
@@ -233,6 +234,32 @@ func getEPHVMSSS() (ScaleSetSpec, armcompute.VirtualMachineScaleSet) { |
233 | 234 | return spec, vmss |
234 | 235 | } |
235 | 236 |
|
| 237 | +func getResourceDiskVMSS() (ScaleSetSpec, armcompute.VirtualMachineScaleSet) { |
| 238 | + spec := newDefaultVMSSSpec() |
| 239 | + spec.Size = vmSizeEPH |
| 240 | + spec.SKU = resourceskus.SKU{ |
| 241 | + Capabilities: []*armcompute.ResourceSKUCapabilities{ |
| 242 | + { |
| 243 | + Name: ptr.To(resourceskus.EphemeralOSDisk), |
| 244 | + Value: ptr.To("True"), |
| 245 | + }, |
| 246 | + }, |
| 247 | + } |
| 248 | + spec.SpotVMOptions = &infrav1.SpotVMOptions{} |
| 249 | + spec.OSDisk.DiffDiskSettings = &infrav1.DiffDiskSettings{ |
| 250 | + Option: string(armcompute.DiffDiskOptionsLocal), |
| 251 | + Placement: ptr.To(infrav1.DiffDiskPlacementResourceDisk), |
| 252 | + } |
| 253 | + vmss := newDefaultVMSS(vmSizeEPH) |
| 254 | + vmss.Properties.VirtualMachineProfile.StorageProfile.OSDisk.DiffDiskSettings = &armcompute.DiffDiskSettings{ |
| 255 | + Option: ptr.To(armcompute.DiffDiskOptionsLocal), |
| 256 | + Placement: ptr.To(armcompute.DiffDiskPlacementResourceDisk), |
| 257 | + } |
| 258 | + vmss.Properties.VirtualMachineProfile.Priority = ptr.To(armcompute.VirtualMachinePriorityTypesSpot) |
| 259 | + |
| 260 | + return spec, vmss |
| 261 | +} |
| 262 | + |
236 | 263 | func getEvictionPolicyVMSS() (ScaleSetSpec, armcompute.VirtualMachineScaleSet) { |
237 | 264 | spec := newDefaultVMSSSpec() |
238 | 265 | spec.Size = vmSizeEPH |
@@ -586,6 +613,13 @@ func TestScaleSetParameters(t *testing.T) { |
586 | 613 | expected: ephemeralVMSS, |
587 | 614 | expectedError: "", |
588 | 615 | }, |
| 616 | + { |
| 617 | + name: "spot vm and ephemeral disk with resourceDisk placement vmss", |
| 618 | + spec: resourceDiskSpec, |
| 619 | + existing: nil, |
| 620 | + expected: resourceDiskVMSS, |
| 621 | + expectedError: "", |
| 622 | + }, |
589 | 623 | { |
590 | 624 | name: "spot vm and eviction policy vmss", |
591 | 625 | spec: evictionSpec, |
|
0 commit comments