Skip to content

Commit 5cc89aa

Browse files
authored
[POSTGRESQL] az postgres flexible-server update: Restart is no longer required for scaling storage size of Premium SSDv2 server (#33178)
1 parent fba9603 commit 5cc89aa

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

src/azure-cli/azure/cli/command_modules/postgresql/commands/custom_commands.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,6 @@ def flexible_server_update_custom_func(cmd, client, instance,
501501
if instance.storage.type == "PremiumV2_LRS":
502502
instance.storage.tier = None
503503

504-
if sku_name or storage_gb:
505-
logger.warning("You are changing the compute and/or storage size of the server. "
506-
"The server will be restarted for this operation and you will see a short downtime.")
507-
508504
if iops:
509505
instance.storage.iops = iops
510506

@@ -629,16 +625,12 @@ def _confirm_restart_server(instance, sku_name, storage_gb, yes):
629625
show_confirmation = True
630626

631627
# check if requested storage growth is crossing the 4096 threshold
632-
if storage_gb and storage_gb > 4096 and instance.storage.storage_size_gb <= 4096 and instance.storage.type == "":
633-
show_confirmation = True
634-
635-
# check if storage_gb changed for PremiumV2_LRS
636-
if storage_gb and instance.storage.type == "PremiumV2_LRS" and instance.storage.storage_size_gb != storage_gb:
628+
if storage_gb and storage_gb > 4096 and instance.storage.storage_size_gb <= 4096 and instance.storage.type != "PremiumV2_LRS":
637629
show_confirmation = True
638630

639631
if not yes and show_confirmation:
640-
user_confirmation("You are trying to change the compute or the size of storage assigned to your server in a way that \
641-
requires a server restart. During the restart, you'll experience some downtime of the server. Do you want to proceed?", yes=yes)
632+
user_confirmation('You are trying to update the compute or storage size assigned to your server in a way that '
633+
'requires a server restart. During the restart, you\'ll experience some downtime of the server. Do you want to proceed?', yes=yes)
642634

643635

644636
def flexible_server_delete(cmd, client, resource_group_name, server_name, yes=False):

src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_location_capabilities_util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def _postgres_parse_list_capability(result, is_offer_restriction_check_required=
5454
zone_redundant = [feature for feature in supported_features if feature.name == "ZoneRedundantHa"]
5555
geo_backup = [feature for feature in supported_features if feature.name == "GeoBackup"]
5656
autonomous_tuning = [feature for feature in supported_features if feature.name == "IndexTuning"]
57+
online_resize = [feature for feature in supported_features if feature.name == "OnlineResize"]
5758

5859
# Update once capability calls are corrected for each command
5960
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=
6566
single_az = zone_redundant[0].status != "Enabled" if zone_redundant else True
6667
geo_backup_supported = geo_backup[0].status == "Enabled" if geo_backup else False
6768
autonomous_tuning_supported = autonomous_tuning[0].status == "Enabled" if autonomous_tuning else False
68-
69+
online_resize_supported = online_resize[0].status == "Enabled" if online_resize else False
6970
tiers = result[0].supported_server_editions
7071
tiers_dict = {}
7172
for tier_info in tiers:
@@ -113,7 +114,8 @@ def _postgres_parse_list_capability(result, is_offer_restriction_check_required=
113114
'zones': zones,
114115
'server_versions': versions,
115116
'supported_server_versions': supported_server_versions,
116-
'autonomous_tuning_supported': autonomous_tuning_supported
117+
'autonomous_tuning_supported': autonomous_tuning_supported,
118+
'online_resize_supported': online_resize_supported
117119
}
118120

119121

0 commit comments

Comments
 (0)