From cc9c885db42018b1a7a4471120562cd6977a67d6 Mon Sep 17 00:00:00 2001 From: william051200 Date: Wed, 6 May 2026 10:58:46 +0800 Subject: [PATCH] Change default vm size or vm sku from Standard_DS1_v2 to Standard_D2s_v5 --- .../azure/cli/command_modules/vm/_breaking_change.py | 12 ------------ .../azure/cli/command_modules/vm/_params.py | 4 ++-- .../azure/cli/command_modules/vm/_validators.py | 4 ++-- src/azure-cli/azure/cli/command_modules/vm/custom.py | 2 +- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/vm/_breaking_change.py b/src/azure-cli/azure/cli/command_modules/vm/_breaking_change.py index ee8fe0d216d..ed111df2d83 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_breaking_change.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_breaking_change.py @@ -4,18 +4,6 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.breaking_change import register_default_value_breaking_change -register_default_value_breaking_change(command_name='vm create', - arg='--size', - current_default='Standard_DS1_v2', - new_default='Standard_D2s_v5', - target_version=None) - -register_default_value_breaking_change(command_name='vmss create', - arg='--vm-sku', - current_default='Standard_DS1_v2', - new_default='Standard_D2s_v5', - target_version=None) - register_default_value_breaking_change(command_name='sig image-version create', arg='--end-of-life-date', current_default=None, diff --git a/src/azure-cli/azure/cli/command_modules/vm/_params.py b/src/azure-cli/azure/cli/command_modules/vm/_params.py index 3d15f0d3f0a..8f2ab87efc6 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_params.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_params.py @@ -739,7 +739,7 @@ def load_arguments(self, _): c.argument('instance_count', help='Number of VMs in the scale set.', type=int) c.argument('disable_overprovision', help='Overprovision option (see https://azure.microsoft.com/documentation/articles/virtual-machine-scale-sets-overview/ for details).', action='store_true') c.argument('health_probe', help='Probe name from the existing load balancer, mainly used for rolling upgrade or automatic repairs') - c.argument('vm_sku', help='Size of VMs in the scale set. Default to "Standard_DS1_v2". See https://azure.microsoft.com/pricing/details/virtual-machines/ for size info.') + c.argument('vm_sku', help='Size of VMs in the scale set. Default to "Standard_D2s_v5". See https://azure.microsoft.com/pricing/details/virtual-machines/ for size info.') c.argument('nsg', help='Name or ID of an existing Network Security Group.', arg_group='Network') c.argument('eviction_policy', resource_type=ResourceType.MGMT_COMPUTE, min_api='2017-12-01', arg_type=get_enum_type(VirtualMachineEvictionPolicyTypes, default=None), help="The eviction policy for virtual machines in a Spot priority scale set. Default eviction policy is Deallocate for a Spot priority scale set") @@ -854,7 +854,7 @@ def load_arguments(self, _): help='Enable the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints') c.argument('spot_restore_timeout', min_api='2021-04-01', help='Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances') - c.argument('vm_sku', help='The new size of the virtual machine instances in the scale set. Default to "Standard_DS1_v2". See https://azure.microsoft.com/pricing/details/virtual-machines/ for size info.', is_preview=True) + c.argument('vm_sku', help='The new size of the virtual machine instances in the scale set. Default to "Standard_D2s_v5". See https://azure.microsoft.com/pricing/details/virtual-machines/ for size info.', is_preview=True) c.argument('ephemeral_os_disk_placement', arg_type=ephemeral_placement_type, help='Only applicable when used with `--vm-sku`. Allows you to choose the Ephemeral OS disk provisioning location.') c.argument('enable_hibernation', arg_type=get_three_state_flag(), min_api='2021-03-01', help='The flag that enable or disable hibernation capability on the VMSS.') diff --git a/src/azure-cli/azure/cli/command_modules/vm/_validators.py b/src/azure-cli/azure/cli/command_modules/vm/_validators.py index 6145b6cee96..47c6d1358fa 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_validators.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_validators.py @@ -1845,7 +1845,7 @@ def process_vmss_create_namespace(cmd, namespace): if namespace.vm_sku is None: from azure.cli.core.cloud import AZURE_US_GOV_CLOUD if cmd.cli_ctx.cloud.name != AZURE_US_GOV_CLOUD.name: - namespace.vm_sku = 'Standard_DS1_v2' + namespace.vm_sku = 'Standard_D2s_v5' else: namespace.vm_sku = 'Standard_D1_v2' @@ -1913,7 +1913,7 @@ def process_vmss_create_namespace(cmd, namespace): if namespace.vm_sku is None: from azure.cli.core.cloud import AZURE_US_GOV_CLOUD if cmd.cli_ctx.cloud.name != AZURE_US_GOV_CLOUD.name: - namespace.vm_sku = 'Standard_DS1_v2' + namespace.vm_sku = 'Standard_D2s_v5' else: namespace.vm_sku = 'Standard_D1_v2' _validate_location(cmd, namespace, namespace.zones, namespace.vm_sku) diff --git a/src/azure-cli/azure/cli/command_modules/vm/custom.py b/src/azure-cli/azure/cli/command_modules/vm/custom.py index 777a7148444..3c941d91c5f 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/custom.py +++ b/src/azure-cli/azure/cli/command_modules/vm/custom.py @@ -904,7 +904,7 @@ def capture_vm(cmd, resource_group_name, vm_name, vhd_name_prefix, # pylint: disable=too-many-locals, unused-argument, too-many-statements, too-many-branches, broad-except -def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_v2', location=None, tags=None, +def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_D2s_v5', location=None, tags=None, no_wait=False, authentication_type=None, admin_password=None, computer_name=None, admin_username=None, ssh_dest_key_path=None, ssh_key_value=None, generate_ssh_keys=False, availability_set=None, nics=None, nsg=None, nsg_rule=None, accelerated_networking=None,