Skip to content

Commit 045bbfb

Browse files
authored
[Compute] BREAKING CHANGE: vmss create: rename orchestration mode values (#16726)
* [Compute] vmss create: rename orchestration mode values * update
1 parent 09daa60 commit 045bbfb

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/azure-cli/azure/cli/command_modules/vm/_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ def load_arguments(self, _):
549549
help="The eviction policy for virtual machines in a Spot priority scale set. Default eviction policy is Deallocate for a Spot priority scale set")
550550
c.argument('application_security_groups', resource_type=ResourceType.MGMT_COMPUTE, min_api='2018-06-01', nargs='+', options_list=['--asgs'], help='Space-separated list of existing application security groups to associate with the VM.', arg_group='Network', validator=validate_asg_names_or_ids)
551551
c.argument('computer_name_prefix', help='Computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long')
552-
c.argument('orchestration_mode', help='Choose how virtual machines are managed by the scale set. In VM mode, you manually create and add a virtual machine of any configuration to the scale set. In ScaleSetVM mode, you define a virtual machine model and Azure will generate identical instances based on that model.',
553-
arg_type=get_enum_type(['VM', 'ScaleSetVM']), is_preview=True)
552+
c.argument('orchestration_mode', help='Choose how virtual machines are managed by the scale set. In Uniform mode, you define a virtual machine model and Azure will generate identical instances based on that model. In Flexible mode, you manually create and add a virtual machine of any configuration to the scale set or generate identical instances based on virtual machine model defined for the scale set.',
553+
arg_type=get_enum_type(['Uniform', 'Flexible']), is_preview=True)
554554
c.argument('scale_in_policy', scale_in_policy_type)
555555
c.argument('automatic_repairs_grace_period', min_api='2018-10-01',
556556
help='The amount of time (in minutes, between 30 and 90) for which automatic repairs are suspended due to a state change on VM.')

src/azure-cli/azure/cli/command_modules/vm/custom.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,7 +2342,7 @@ def create_vmss(cmd, vmss_name, resource_group_name, image=None,
23422342
identity_role_id=None, zones=None, priority=None, eviction_policy=None,
23432343
application_security_groups=None, ultra_ssd_enabled=None, ephemeral_os_disk=None,
23442344
proximity_placement_group=None, aux_subscriptions=None, terminate_notification_time=None,
2345-
max_price=None, computer_name_prefix=None, orchestration_mode='ScaleSetVM', scale_in_policy=None,
2345+
max_price=None, computer_name_prefix=None, orchestration_mode='Uniform', scale_in_policy=None,
23462346
os_disk_encryption_set=None, data_disk_encryption_sets=None, data_disk_iops=None, data_disk_mbps=None,
23472347
automatic_repairs_grace_period=None, specialized=None, os_disk_size_gb=None, encryption_at_host=None,
23482348
host_group=None):
@@ -2358,9 +2358,9 @@ def create_vmss(cmd, vmss_name, resource_group_name, image=None,
23582358
# Build up the ARM template
23592359
master_template = ArmTemplateBuilder()
23602360

2361-
scale_set_vm_str = 'ScaleSetVM'
2362-
vm_str = 'VM'
2363-
if orchestration_mode.lower() == scale_set_vm_str.lower():
2361+
uniform_str = 'Uniform'
2362+
flexible_str = 'Flexible'
2363+
if orchestration_mode.lower() == uniform_str.lower():
23642364
from msrestazure.tools import resource_id, is_valid_resource_id
23652365

23662366
storage_sku = disk_info['os'].get('storageAccountType')
@@ -2601,9 +2601,9 @@ def _get_public_ip_address_allocation(value, sku):
26012601
master_template.add_resource(build_msi_role_assignment(vmss_name, vmss_id, identity_role_id,
26022602
role_assignment_guid, identity_scope, False))
26032603

2604-
elif orchestration_mode.lower() == vm_str.lower():
2604+
elif orchestration_mode.lower() == flexible_str.lower():
26052605
if platform_fault_domain_count is None:
2606-
raise CLIError("usage error: --platform-fault-domain-count is required in VM mode")
2606+
raise CLIError("usage error: --platform-fault-domain-count is required in Flexible mode")
26072607
vmss_resource = {
26082608
'type': 'Microsoft.Compute/virtualMachineScaleSets',
26092609
'name': vmss_name,
@@ -2623,13 +2623,13 @@ def _get_public_ip_address_allocation(value, sku):
26232623
'id': proximity_placement_group
26242624
}
26252625
else:
2626-
raise CLIError('usage error: --orchestration-mode (ScaleSet | VM)')
2626+
raise CLIError('usage error: --orchestration-mode (Uniform | Flexible)')
26272627

26282628
master_template.add_resource(vmss_resource)
26292629
master_template.add_output('VMSS', vmss_name, 'Microsoft.Compute', 'virtualMachineScaleSets',
26302630
output_type='object')
26312631

2632-
if orchestration_mode.lower() == scale_set_vm_str.lower() and admin_password:
2632+
if orchestration_mode.lower() == uniform_str.lower() and admin_password:
26332633
master_template.add_secure_parameter('adminPassword', admin_password)
26342634

26352635
template = master_template.build()
@@ -2667,7 +2667,7 @@ def _get_public_ip_address_allocation(value, sku):
26672667
deployment_result = DeploymentOutputLongRunningOperation(cmd.cli_ctx)(
26682668
sdk_no_wait(no_wait, client.create_or_update, resource_group_name, deployment_name, properties))
26692669

2670-
if orchestration_mode.lower() == scale_set_vm_str.lower() and assign_identity is not None:
2670+
if orchestration_mode.lower() == uniform_str.lower() and assign_identity is not None:
26712671
vmss_info = get_vmss(cmd, resource_group_name, vmss_name)
26722672
if enable_local_identity and not identity_scope:
26732673
_show_missing_access_warning(resource_group_name, vmss_name, 'vmss')

src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4939,7 +4939,7 @@ def test_vmss_orchestration_mode(self, resource_group):
49394939
})
49404940

49414941
self.cmd('ppg create -g {rg} -n {ppg}')
4942-
self.cmd('vmss create -g {rg} -n {vmss} --orchestration-mode VM --single-placement-group false --ppg {ppg} '
4942+
self.cmd('vmss create -g {rg} -n {vmss} --orchestration-mode Flexible --single-placement-group false --ppg {ppg} '
49434943
'--platform-fault-domain-count 3 --generate-ssh-keys')
49444944

49454945

0 commit comments

Comments
 (0)