Skip to content

Commit cf3f48a

Browse files
authored
[RDBMS] az postgres flexible-server create/update/restore: Premium SSD V2 is no longer supported with Burstable compute tier (#31948)
1 parent 4d9eb14 commit cf3f48a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from .validators import pg_arguments_validator, validate_server_name, validate_and_format_restore_point_in_time, \
4444
validate_postgres_replica, validate_georestore_network, pg_byok_validator, validate_migration_runtime_server, \
4545
validate_resource_group, check_resource_group, validate_citus_cluster, cluster_byok_validator, validate_backup_name, \
46-
validate_virtual_endpoint_name_availability, validate_database_name, compare_sku_names, is_citus_cluster
46+
validate_virtual_endpoint_name_availability, validate_database_name, compare_sku_names, is_citus_cluster, pg_restore_validator
4747

4848
logger = get_logger(__name__)
4949
DEFAULT_DB_NAME = 'flexibleserverdb'
@@ -274,6 +274,7 @@ def flexible_server_restore(cmd, client,
274274
cluster_byok_validator(byok_identity, byok_key, backup_byok_identity, backup_byok_key, geo_redundant_backup, source_server_object)
275275
pg_byok_validator(byok_identity, byok_key, backup_byok_identity, backup_byok_key, geo_redundant_backup)
276276

277+
pg_restore_validator(source_server_object.sku.tier, storage_type=storage_type)
277278
storage = postgresql_flexibleservers.models.Storage(type=storage_type if source_server_object.storage.type != "PremiumV2_LRS" else None)
278279

279280
parameters = postgresql_flexibleservers.models.Server(

src/azure-cli/azure/cli/command_modules/rdbms/validators.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def pg_arguments_validator(db_context, location, tier, sku_name, storage_gb, ser
340340
else:
341341
supported_storageV2_size = None
342342
_pg_storage_type_validator(storage_type, auto_grow, high_availability, geo_redundant_backup, performance_tier,
343-
supported_storageV2_size, iops, throughput, instance)
343+
tier, supported_storageV2_size, iops, throughput, instance)
344344
_pg_storage_performance_tier_validator(performance_tier,
345345
sku_info,
346346
tier,
@@ -905,7 +905,7 @@ def validate_identities(cmd, namespace):
905905
namespace.identities = [_validate_identity(cmd, namespace, identity) for identity in namespace.identities]
906906

907907

908-
def _pg_storage_type_validator(storage_type, auto_grow, high_availability, geo_redundant_backup, performance_tier,
908+
def _pg_storage_type_validator(storage_type, auto_grow, high_availability, geo_redundant_backup, performance_tier, tier,
909909
supported_storageV2_size, iops, throughput, instance):
910910
is_create_ssdv2 = storage_type == "PremiumV2_LRS"
911911
is_update_ssdv2 = instance is not None and instance.storage.type == "PremiumV2_LRS"
@@ -928,13 +928,22 @@ def _pg_storage_type_validator(storage_type, auto_grow, high_availability, geo_r
928928
raise ValidationError("Geo-redundancy is not supported for servers with Premium SSD V2.")
929929
if performance_tier:
930930
raise ValidationError("Performance tier is not supported for servers with Premium SSD V2.")
931+
if tier and tier.lower() == 'burstable':
932+
raise ValidationError("Burstable tier is not supported for servers with Premium SSD V2.")
931933
else:
932934
if throughput is not None:
933935
raise CLIError('Updating throughput is only capable for server created with Premium SSD v2.')
934936
if iops is not None:
935937
raise CLIError('Updating storage iops is only capable for server created with Premium SSD v2.')
936938

937939

940+
def pg_restore_validator(compute_tier, **args):
941+
is_ssdv2_enabled = args.get('storage_type', None) == "PremiumV2_LRS"
942+
943+
if is_ssdv2_enabled and compute_tier.lower() == 'burstable':
944+
raise ValidationError("Burstable tier is not supported for servers with Premium SSD V2.")
945+
946+
938947
def _pg_authentication_validator(password_auth, is_microsoft_entra_auth_enabled,
939948
admin_name, admin_id, admin_type, instance):
940949
if instance is None:

0 commit comments

Comments
 (0)