From 5435ecb2a1ba85f151a2de1c344536f1f28a3eb9 Mon Sep 17 00:00:00 2001 From: Naia Scott Date: Mon, 13 Apr 2026 17:01:32 -0400 Subject: [PATCH 1/3] Do not restart for SSDV2 server --- .../postgresql/commands/custom_commands.py | 27 +++++++++---------- ...xible_server_location_capabilities_util.py | 6 +++-- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py b/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py index 7c446a48e3f..cc4686a6ac7 100644 --- a/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py +++ b/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py @@ -624,21 +624,18 @@ def _update_login(server_name, resource_group_name, auth_config, password_auth, def _confirm_restart_server(instance, sku_name, storage_gb, yes): show_confirmation = False - # check if sku_name is changed - if sku_name and sku_name != instance.sku.name: - show_confirmation = True - - # check if requested storage growth is crossing the 4096 threshold - if storage_gb and storage_gb > 4096 and instance.storage.storage_size_gb <= 4096 and instance.storage.type == "": - show_confirmation = True - - # check if storage_gb changed for PremiumV2_LRS - if storage_gb and instance.storage.type == "PremiumV2_LRS" and instance.storage.storage_size_gb != storage_gb: - show_confirmation = True - - if not yes and show_confirmation: - user_confirmation("You are trying to change the compute or the size of storage assigned to your server in a way that \ - requires a server restart. During the restart, you'll experience some downtime of the server. Do you want to proceed?", yes=yes) + if instance.storage.type != "PremiumV2_LRS": + # check if sku_name is changed + if sku_name and sku_name != instance.sku.name: + show_confirmation = True + + # check if requested storage growth is crossing the 4096 threshold + if storage_gb and storage_gb > 4096 and instance.storage.storage_size_gb <= 4096: + show_confirmation = True + + if not yes and show_confirmation: + user_confirmation("You are trying to change the compute or the size of storage assigned to your server in a way that \ + requires a server restart. During the restart, you'll experience some downtime of the server. Do you want to proceed?", yes=yes) def flexible_server_delete(cmd, client, resource_group_name, server_name, yes=False): diff --git a/src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_location_capabilities_util.py b/src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_location_capabilities_util.py index e4358cb3002..78f36c21c86 100644 --- a/src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_location_capabilities_util.py +++ b/src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_location_capabilities_util.py @@ -54,6 +54,7 @@ def _postgres_parse_list_capability(result, is_offer_restriction_check_required= zone_redundant = [feature for feature in supported_features if feature.name == "ZoneRedundantHa"] geo_backup = [feature for feature in supported_features if feature.name == "GeoBackup"] autonomous_tuning = [feature for feature in supported_features if feature.name == "IndexTuning"] + online_resize = [feature for feature in supported_features if feature.name == "OnlineResize"] # Update once capability calls are corrected for each command if restricted == "Enabled" and not is_offer_restriction_check_required: @@ -65,7 +66,7 @@ def _postgres_parse_list_capability(result, is_offer_restriction_check_required= single_az = zone_redundant[0].status != "Enabled" if zone_redundant else True geo_backup_supported = geo_backup[0].status == "Enabled" if geo_backup else False autonomous_tuning_supported = autonomous_tuning[0].status == "Enabled" if autonomous_tuning else False - + online_resize_supported = online_resize[0].status == "Enabled" if online_resize else False tiers = result[0].supported_server_editions tiers_dict = {} for tier_info in tiers: @@ -113,7 +114,8 @@ def _postgres_parse_list_capability(result, is_offer_restriction_check_required= 'zones': zones, 'server_versions': versions, 'supported_server_versions': supported_server_versions, - 'autonomous_tuning_supported': autonomous_tuning_supported + 'autonomous_tuning_supported': autonomous_tuning_supported, + 'online_resize_supported': online_resize_supported } From b7728e71db5fdda58ff6848507cc14269d71543c Mon Sep 17 00:00:00 2001 From: Naia Scott Date: Mon, 13 Apr 2026 17:11:53 -0400 Subject: [PATCH 2/3] fix --- .../postgresql/commands/custom_commands.py | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py b/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py index cc4686a6ac7..65b0c94ce08 100644 --- a/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py +++ b/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py @@ -624,18 +624,17 @@ def _update_login(server_name, resource_group_name, auth_config, password_auth, def _confirm_restart_server(instance, sku_name, storage_gb, yes): show_confirmation = False - if instance.storage.type != "PremiumV2_LRS": - # check if sku_name is changed - if sku_name and sku_name != instance.sku.name: - show_confirmation = True - - # check if requested storage growth is crossing the 4096 threshold - if storage_gb and storage_gb > 4096 and instance.storage.storage_size_gb <= 4096: - show_confirmation = True - - if not yes and show_confirmation: - user_confirmation("You are trying to change the compute or the size of storage assigned to your server in a way that \ - requires a server restart. During the restart, you'll experience some downtime of the server. Do you want to proceed?", yes=yes) + # check if sku_name is changed + if sku_name and sku_name != instance.sku.name: + show_confirmation = True + + # check if requested storage growth is crossing the 4096 threshold + if storage_gb and storage_gb > 4096 and instance.storage.storage_size_gb <= 4096 and instance.storage.type != "PremiumV2_LRS": + show_confirmation = True + + if not yes and show_confirmation: + user_confirmation("You are trying to change the compute or the size of storage assigned to your server in a way that \ + requires a server restart. During the restart, you'll experience some downtime of the server. Do you want to proceed?", yes=yes) def flexible_server_delete(cmd, client, resource_group_name, server_name, yes=False): From df9c0dd4fa913c7331ebb6e3a060602eee736cff Mon Sep 17 00:00:00 2001 From: Naia Scott Date: Tue, 14 Apr 2026 11:03:07 -0400 Subject: [PATCH 3/3] update text --- .../postgresql/commands/custom_commands.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py b/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py index 65b0c94ce08..2537d6c701d 100644 --- a/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py +++ b/src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py @@ -501,10 +501,6 @@ def flexible_server_update_custom_func(cmd, client, instance, if instance.storage.type == "PremiumV2_LRS": instance.storage.tier = None - if sku_name or storage_gb: - logger.warning("You are changing the compute and/or storage size of the server. " - "The server will be restarted for this operation and you will see a short downtime.") - if iops: instance.storage.iops = iops @@ -633,8 +629,8 @@ def _confirm_restart_server(instance, sku_name, storage_gb, yes): show_confirmation = True if not yes and show_confirmation: - user_confirmation("You are trying to change the compute or the size of storage assigned to your server in a way that \ - requires a server restart. During the restart, you'll experience some downtime of the server. Do you want to proceed?", yes=yes) + user_confirmation('You are trying to update the compute or storage size assigned to your server in a way that ' + 'requires a server restart. During the restart, you\'ll experience some downtime of the server. Do you want to proceed?', yes=yes) def flexible_server_delete(cmd, client, resource_group_name, server_name, yes=False):