Skip to content

Commit 58bee33

Browse files
Compute Placement feature (Azure#27446)
Co-authored-by: Yabo Hu <[email protected]>
1 parent 1159106 commit 58bee33

File tree

86 files changed

+6860
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+6860
-344
lines changed

src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperations.cs

+791-8
Large diffs are not rendered by default.

src/Compute/Compute.Management.Sdk/Generated/AvailabilitySetsOperationsExtensions.cs

+235-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public static AvailabilitySet Get(this IAvailabilitySetsOperations operations, s
200200
/// </param>
201201
/// <param name='expand'>
202202
/// The expand expression to apply to the operation. Allowed values are
203-
/// 'instanceView'.
203+
/// 'virtualMachines/$ref'.
204204
/// </param>
205205
public static IPage<AvailabilitySet> ListBySubscription(this IAvailabilitySetsOperations operations, string expand = default(string))
206206
{
@@ -215,7 +215,7 @@ public static AvailabilitySet Get(this IAvailabilitySetsOperations operations, s
215215
/// </param>
216216
/// <param name='expand'>
217217
/// The expand expression to apply to the operation. Allowed values are
218-
/// 'instanceView'.
218+
/// 'virtualMachines/$ref'.
219219
/// </param>
220220
/// <param name='cancellationToken'>
221221
/// The cancellation token.
@@ -304,6 +304,239 @@ public static IEnumerable<VirtualMachineSize> ListAvailableSizes(this IAvailabil
304304
}
305305
}
306306

307+
/// <summary>
308+
/// Start migration operation on an Availability Set to move its Virtual
309+
/// Machines to a Virtual Machine Scale Set. This should be followed by a
310+
/// migrate operation on each Virtual Machine that triggers a downtime on the
311+
/// Virtual Machine.
312+
/// </summary>
313+
/// <param name='operations'>
314+
/// The operations group for this extension method.
315+
/// </param>
316+
/// <param name='resourceGroupName'>
317+
/// The name of the resource group.
318+
/// </param>
319+
/// <param name='availabilitySetName'>
320+
/// The name of the availability set.
321+
/// </param>
322+
/// <param name='virtualMachineScaleSetFlexible'>
323+
/// Specifies information about the Virtual Machine Scale Set that the
324+
/// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01.
325+
/// </param>
326+
public static void StartMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible)
327+
{
328+
operations.StartMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible).GetAwaiter().GetResult();
329+
}
330+
331+
/// <summary>
332+
/// Start migration operation on an Availability Set to move its Virtual
333+
/// Machines to a Virtual Machine Scale Set. This should be followed by a
334+
/// migrate operation on each Virtual Machine that triggers a downtime on the
335+
/// Virtual Machine.
336+
/// </summary>
337+
/// <param name='operations'>
338+
/// The operations group for this extension method.
339+
/// </param>
340+
/// <param name='resourceGroupName'>
341+
/// The name of the resource group.
342+
/// </param>
343+
/// <param name='availabilitySetName'>
344+
/// The name of the availability set.
345+
/// </param>
346+
/// <param name='virtualMachineScaleSetFlexible'>
347+
/// Specifies information about the Virtual Machine Scale Set that the
348+
/// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01.
349+
/// </param>
350+
/// <param name='cancellationToken'>
351+
/// The cancellation token.
352+
/// </param>
353+
public static async Task StartMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, CancellationToken cancellationToken = default(CancellationToken))
354+
{
355+
(await operations.StartMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible, null, cancellationToken).ConfigureAwait(false)).Dispose();
356+
}
357+
358+
/// <summary>
359+
/// Cancel the migration operation on an Availability Set.
360+
/// </summary>
361+
/// <param name='operations'>
362+
/// The operations group for this extension method.
363+
/// </param>
364+
/// <param name='resourceGroupName'>
365+
/// The name of the resource group.
366+
/// </param>
367+
/// <param name='availabilitySetName'>
368+
/// The name of the availability set.
369+
/// </param>
370+
public static void CancelMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName)
371+
{
372+
operations.CancelMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName).GetAwaiter().GetResult();
373+
}
374+
375+
/// <summary>
376+
/// Cancel the migration operation on an Availability Set.
377+
/// </summary>
378+
/// <param name='operations'>
379+
/// The operations group for this extension method.
380+
/// </param>
381+
/// <param name='resourceGroupName'>
382+
/// The name of the resource group.
383+
/// </param>
384+
/// <param name='availabilitySetName'>
385+
/// The name of the availability set.
386+
/// </param>
387+
/// <param name='cancellationToken'>
388+
/// The cancellation token.
389+
/// </param>
390+
public static async Task CancelMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default(CancellationToken))
391+
{
392+
(await operations.CancelMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
393+
}
394+
395+
/// <summary>
396+
/// Validates that the Virtual Machines in the Availability Set can be migrated
397+
/// to the provided Virtual Machine Scale Set.
398+
/// </summary>
399+
/// <param name='operations'>
400+
/// The operations group for this extension method.
401+
/// </param>
402+
/// <param name='resourceGroupName'>
403+
/// The name of the resource group.
404+
/// </param>
405+
/// <param name='availabilitySetName'>
406+
/// The name of the availability set.
407+
/// </param>
408+
/// <param name='virtualMachineScaleSetFlexible'>
409+
/// Specifies information about the Virtual Machine Scale Set that the
410+
/// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01.
411+
/// </param>
412+
public static void ValidateMigrationToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible)
413+
{
414+
operations.ValidateMigrationToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible).GetAwaiter().GetResult();
415+
}
416+
417+
/// <summary>
418+
/// Validates that the Virtual Machines in the Availability Set can be migrated
419+
/// to the provided Virtual Machine Scale Set.
420+
/// </summary>
421+
/// <param name='operations'>
422+
/// The operations group for this extension method.
423+
/// </param>
424+
/// <param name='resourceGroupName'>
425+
/// The name of the resource group.
426+
/// </param>
427+
/// <param name='availabilitySetName'>
428+
/// The name of the availability set.
429+
/// </param>
430+
/// <param name='virtualMachineScaleSetFlexible'>
431+
/// Specifies information about the Virtual Machine Scale Set that the
432+
/// Availability Set should be migrated to. Minimum api‐version: 2024‐11‐01.
433+
/// </param>
434+
/// <param name='cancellationToken'>
435+
/// The cancellation token.
436+
/// </param>
437+
public static async Task ValidateMigrationToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, SubResource virtualMachineScaleSetFlexible, CancellationToken cancellationToken = default(CancellationToken))
438+
{
439+
(await operations.ValidateMigrationToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetFlexible, null, cancellationToken).ConfigureAwait(false)).Dispose();
440+
}
441+
442+
/// <summary>
443+
/// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual
444+
/// Machines in the Availability Set. This does not trigger a downtime on the
445+
/// Virtual Machines.
446+
/// </summary>
447+
/// <param name='operations'>
448+
/// The operations group for this extension method.
449+
/// </param>
450+
/// <param name='resourceGroupName'>
451+
/// The name of the resource group.
452+
/// </param>
453+
/// <param name='availabilitySetName'>
454+
/// The name of the availability set.
455+
/// </param>
456+
/// <param name='virtualMachineScaleSetName'>
457+
/// Specifies information about the Virtual Machine Scale Set that the
458+
/// Availability Set should be converted to.
459+
/// </param>
460+
public static void ConvertToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string))
461+
{
462+
operations.ConvertToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName).GetAwaiter().GetResult();
463+
}
464+
465+
/// <summary>
466+
/// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual
467+
/// Machines in the Availability Set. This does not trigger a downtime on the
468+
/// Virtual Machines.
469+
/// </summary>
470+
/// <param name='operations'>
471+
/// The operations group for this extension method.
472+
/// </param>
473+
/// <param name='resourceGroupName'>
474+
/// The name of the resource group.
475+
/// </param>
476+
/// <param name='availabilitySetName'>
477+
/// The name of the availability set.
478+
/// </param>
479+
/// <param name='virtualMachineScaleSetName'>
480+
/// Specifies information about the Virtual Machine Scale Set that the
481+
/// Availability Set should be converted to.
482+
/// </param>
483+
/// <param name='cancellationToken'>
484+
/// The cancellation token.
485+
/// </param>
486+
public static async Task ConvertToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), CancellationToken cancellationToken = default(CancellationToken))
487+
{
488+
(await operations.ConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
489+
}
490+
491+
/// <summary>
492+
/// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual
493+
/// Machines in the Availability Set. This does not trigger a downtime on the
494+
/// Virtual Machines.
495+
/// </summary>
496+
/// <param name='operations'>
497+
/// The operations group for this extension method.
498+
/// </param>
499+
/// <param name='resourceGroupName'>
500+
/// The name of the resource group.
501+
/// </param>
502+
/// <param name='availabilitySetName'>
503+
/// The name of the availability set.
504+
/// </param>
505+
/// <param name='virtualMachineScaleSetName'>
506+
/// Specifies information about the Virtual Machine Scale Set that the
507+
/// Availability Set should be converted to.
508+
/// </param>
509+
public static void BeginConvertToVirtualMachineScaleSet(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string))
510+
{
511+
operations.BeginConvertToVirtualMachineScaleSetAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName).GetAwaiter().GetResult();
512+
}
513+
514+
/// <summary>
515+
/// Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual
516+
/// Machines in the Availability Set. This does not trigger a downtime on the
517+
/// Virtual Machines.
518+
/// </summary>
519+
/// <param name='operations'>
520+
/// The operations group for this extension method.
521+
/// </param>
522+
/// <param name='resourceGroupName'>
523+
/// The name of the resource group.
524+
/// </param>
525+
/// <param name='availabilitySetName'>
526+
/// The name of the availability set.
527+
/// </param>
528+
/// <param name='virtualMachineScaleSetName'>
529+
/// Specifies information about the Virtual Machine Scale Set that the
530+
/// Availability Set should be converted to.
531+
/// </param>
532+
/// <param name='cancellationToken'>
533+
/// The cancellation token.
534+
/// </param>
535+
public static async Task BeginConvertToVirtualMachineScaleSetAsync(this IAvailabilitySetsOperations operations, string resourceGroupName, string availabilitySetName, string virtualMachineScaleSetName = default(string), CancellationToken cancellationToken = default(CancellationToken))
536+
{
537+
(await operations.BeginConvertToVirtualMachineScaleSetWithHttpMessagesAsync(resourceGroupName, availabilitySetName, virtualMachineScaleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
538+
}
539+
307540
/// <summary>
308541
/// Lists all availability sets in a subscription.
309542
/// </summary>

src/Compute/Compute.Management.Sdk/Generated/CapacityReservationGroupsOperations.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client)
108108
{
109109
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
110110
}
111-
string apiVersion = "2024-07-01";
111+
string apiVersion = "2024-11-01";
112112
// Tracing
113113
bool _shouldTrace = ServiceClientTracing.IsEnabled;
114114
string _invocationId = null;
@@ -335,7 +335,7 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client)
335335
{
336336
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
337337
}
338-
string apiVersion = "2024-07-01";
338+
string apiVersion = "2024-11-01";
339339
// Tracing
340340
bool _shouldTrace = ServiceClientTracing.IsEnabled;
341341
string _invocationId = null;
@@ -537,7 +537,7 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client)
537537
{
538538
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
539539
}
540-
string apiVersion = "2024-07-01";
540+
string apiVersion = "2024-11-01";
541541
// Tracing
542542
bool _shouldTrace = ServiceClientTracing.IsEnabled;
543543
string _invocationId = null;
@@ -722,7 +722,7 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client)
722722
{
723723
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
724724
}
725-
string apiVersion = "2024-07-01";
725+
string apiVersion = "2024-11-01";
726726
// Tracing
727727
bool _shouldTrace = ServiceClientTracing.IsEnabled;
728728
string _invocationId = null;
@@ -923,7 +923,7 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client)
923923
{
924924
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
925925
}
926-
string apiVersion = "2024-07-01";
926+
string apiVersion = "2024-11-01";
927927
// Tracing
928928
bool _shouldTrace = ServiceClientTracing.IsEnabled;
929929
string _invocationId = null;
@@ -1126,7 +1126,7 @@ internal CapacityReservationGroupsOperations(ComputeManagementClient client)
11261126
{
11271127
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
11281128
}
1129-
string apiVersion = "2024-07-01";
1129+
string apiVersion = "2024-11-01";
11301130
// Tracing
11311131
bool _shouldTrace = ServiceClientTracing.IsEnabled;
11321132
string _invocationId = null;

src/Compute/Compute.Management.Sdk/Generated/CapacityReservationsOperations.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ internal CapacityReservationsOperations(ComputeManagementClient client)
193193
{
194194
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
195195
}
196-
string apiVersion = "2024-07-01";
196+
string apiVersion = "2024-11-01";
197197
// Tracing
198198
bool _shouldTrace = ServiceClientTracing.IsEnabled;
199199
string _invocationId = null;
@@ -396,7 +396,7 @@ internal CapacityReservationsOperations(ComputeManagementClient client)
396396
{
397397
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
398398
}
399-
string apiVersion = "2024-07-01";
399+
string apiVersion = "2024-11-01";
400400
// Tracing
401401
bool _shouldTrace = ServiceClientTracing.IsEnabled;
402402
string _invocationId = null;
@@ -610,7 +610,7 @@ internal CapacityReservationsOperations(ComputeManagementClient client)
610610
{
611611
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
612612
}
613-
string apiVersion = "2024-07-01";
613+
string apiVersion = "2024-11-01";
614614
// Tracing
615615
bool _shouldTrace = ServiceClientTracing.IsEnabled;
616616
string _invocationId = null;
@@ -845,7 +845,7 @@ internal CapacityReservationsOperations(ComputeManagementClient client)
845845
{
846846
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
847847
}
848-
string apiVersion = "2024-07-01";
848+
string apiVersion = "2024-11-01";
849849
// Tracing
850850
bool _shouldTrace = ServiceClientTracing.IsEnabled;
851851
string _invocationId = null;
@@ -1055,7 +1055,7 @@ internal CapacityReservationsOperations(ComputeManagementClient client)
10551055
{
10561056
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
10571057
}
1058-
string apiVersion = "2024-07-01";
1058+
string apiVersion = "2024-11-01";
10591059
// Tracing
10601060
bool _shouldTrace = ServiceClientTracing.IsEnabled;
10611061
string _invocationId = null;

0 commit comments

Comments
 (0)