Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{RDBMS} Add support for osshf cluster #28310

Merged
merged 7 commits into from
Feb 20, 2024

Conversation

ambrahma
Copy link
Member

@ambrahma ambrahma commented Feb 6, 2024

Related command
Add support for OSSHF cluster to fetch private DNS zone domain name

Description
Add support for OSSHF cluster to fetch private DNS zone domain name

Testing Guide
Verified manually
az postgres flexible-server create -g cli-test-do-not-delete-rg-southcentralus -n cli-test-server-pg-flex-ha-vnet-southcentralus -l southcentralus --geo-redundant-backup Enabled --high-availability ZoneRedundant --vnet cli-test-osshf-pg-flex-vnet-southcentralus --subnet cli-test-osshf-pg-flex-subnet-southcentralus --private-dns-zone cli-test-osshf-pg-flex-dns-southcentralus.pg.osshf-scus1-a.mscds.com
Checking the existence of the resource group 'cli-test-do-not-delete-rg-southcentralus'...
Resource group 'cli-test-do-not-delete-rg-southcentralus' exists ? : True
You have supplied a Vnet and Subnet name. Verifying its existence...
Using existing Vnet "cli-test-osshf-pg-flex-vnet-southcentralus" in resource group "cli-test-do-not-delete-rg-southcentralus"
Using existing Subnet "cli-test-osshf-pg-flex-subnet-southcentralus" in resource group "cli-test-do-not-delete-rg-southcentralus"
Do you want to create a new private DNS zone cli-test-osshf-pg-flex-dns-southcentralus.pg.osshf-scus1-a.mscds.com in resource group cli-test-do-not-delete-rg-southcentralus (y/n): y
Creating a private dns zone cli-test-osshf-pg-flex-dns-southcentralus.pg.osshf-scus1-a.mscds.com in resource group "cli-test-do-not-delete-rg-southcentralus"
Creating PostgreSQL Server 'cli-test-server-pg-flex-ha-vnet-southcentralus' in group 'cli-test-do-not-delete-rg-southcentralus'...
Your server 'cli-test-server-pg-flex-ha-vnet-southcentralus' is using sku 'Standard_D2s_v3' (Paid Tier). Please refer to https://aka.ms/postgres-pricing for pricing details
Creating PostgreSQL database 'flexibleserverdb'...
Make a note of your password. If you forget, you would have to reset your password with "az postgres flexible-server update -n cli-test-server-pg-flex-ha-vnet-southcentralus -g cli-test-do-not-delete-rg-southcentralus -p ".
Try using 'az postgres flexible-server connect' command to test out connection.
{
"connectionString": "postgresql://giddyox2:JErrwcvummMoZ7Zxz2coyw@cli-test-server-pg-flex-ha-vnet-southcentralus.osshf-scus1-a.mscds.com/flexibleserverdb?sslmode=require",
"databaseName": "flexibleserverdb",
"host": "cli-test-server-pg-flex-ha-vnet-southcentralus.osshf-scus1-a.mscds.com",
"id": "/subscriptions/4a5d02ab-e0c3-4d39-8031-293ddd4e1875/resourceGroups/cli-test-do-not-delete-rg-southcentralus/providers/Microsoft.DBforPostgreSQL/flexibleServers/cli-test-server-pg-flex-ha-vnet-southcentralus",
"location": "South Central US",
"password": "JErrwcvummMoZ7Zxz2coyw",
"resourceGroup": "cli-test-do-not-delete-rg-southcentralus",
"skuname": "Standard_D2s_v3",
"subnetId": "/subscriptions/4a5d02ab-e0c3-4d39-8031-293ddd4e1875/resourceGroups/cli-test-do-not-delete-rg-southcentralus/providers/Microsoft.Network/virtualNetworks/cli-test-osshf-pg-flex-vnet-southcentralus/subnets/cli-test-osshf-pg-flex-subnet-southcentralus",
"username": "giddyox2",
"version": "13"
}


This checklist is used to make sure that common guidelines for a pull request are followed.

Copy link

azure-client-tools-bot-prd bot commented Feb 6, 2024

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.11
️✔️3.9
️✔️ams
️✔️latest
️✔️3.11
️✔️3.9
️✔️apim
️✔️latest
️✔️3.11
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.11
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️aro
️✔️latest
️✔️3.11
️✔️3.9
️✔️backup
️✔️latest
️✔️3.11
️✔️3.9
️✔️batch
️✔️latest
️✔️3.11
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.11
️✔️3.9
️✔️billing
️✔️latest
️✔️3.11
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.11
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.11
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️config
️✔️latest
️✔️3.11
️✔️3.9
️✔️configure
️✔️latest
️✔️3.11
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.11
️✔️3.9
️✔️container
️✔️latest
️✔️3.11
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.11
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.11
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️dla
️✔️latest
️✔️3.11
️✔️3.9
️✔️dls
️✔️latest
️✔️3.11
️✔️3.9
️✔️dms
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.11
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.11
️✔️3.9
️✔️find
️✔️latest
️✔️3.11
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.11
️✔️3.9
️✔️identity
️✔️latest
️✔️3.11
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️kusto
️✔️latest
️✔️3.11
️✔️3.9
️✔️lab
️✔️latest
️✔️3.11
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️maps
️✔️latest
️✔️3.11
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.11
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.11
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.11
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.11
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.11
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.11
️✔️3.9
️✔️profile
️✔️latest
️✔️3.11
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.11
️✔️3.9
️✔️redis
️✔️latest
️✔️3.11
️✔️3.9
️✔️relay
️✔️latest
️✔️3.11
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️role
️✔️latest
️✔️3.11
️✔️3.9
️✔️search
️✔️latest
️✔️3.11
️✔️3.9
️✔️security
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.11
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.11
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.11
️✔️3.9
️✔️sql
️✔️latest
️✔️3.11
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.11
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.11
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️util
️✔️latest
️✔️3.11
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9

Copy link

azure-client-tools-bot-prd bot commented Feb 6, 2024

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 6, 2024

RDBMS

@nasc17
Copy link
Member

nasc17 commented Feb 12, 2024

@evelyn-ys can we please have this reviewed. All checks have passed

@evelyn-ys evelyn-ys merged commit 9b3b244 into Azure:dev Feb 20, 2024
54 checks passed
@bebound
Copy link
Contributor

bebound commented Feb 21, 2024

This PR breaks the test, as config.json is not include in the Python package.
You need to add it in package_data like this:

package_data={
'azure.cli.command_modules.acr': ['*.json'],

2024-02-20T04:23:36.0151081Z During handling of the above exception, another exception occurred:
2024-02-20T04:23:36.0151218Z 
2024-02-20T04:23:36.0151820Z self = <command_modules.rdbms.tests.latest.test_rdbms_flexible_commands.FlexibleServerPrivateDnsZoneScenarioTest testMethod=test_postgres_flexible_server_existing_private_dns_zone>
2024-02-20T04:23:36.0152327Z server_resource_group = 'clitest.rg000001'
2024-02-20T04:23:36.0152658Z vnet_resource_group = 'clitest.rg000002'
2024-02-20T04:23:36.0152775Z 
2024-02-20T04:23:36.0152963Z     @AllowLargeResponse()
2024-02-20T04:23:36.0153346Z     @ResourceGroupPreparer(location=postgres_location, parameter_name='server_resource_group')
2024-02-20T04:23:36.0153813Z     @ResourceGroupPreparer(location=postgres_location, parameter_name='vnet_resource_group')
2024-02-20T04:23:36.0154186Z     def test_postgres_flexible_server_existing_private_dns_zone(self, server_resource_group, vnet_resource_group):
2024-02-20T04:23:36.0154691Z >       self._test_flexible_server_existing_private_dns_zone('postgres', server_resource_group, vnet_resource_group)
2024-02-20T04:23:36.0154865Z 
2024-02-20T04:23:36.0155301Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1715: 
2024-02-20T04:23:36.0155915Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-02-20T04:23:36.0156481Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1766: in _test_flexible_server_existing_private_dns_zone
2024-02-20T04:23:36.0157019Z     self.cmd('{} flexible-server create -g {} -n {} -l {} --private-dns-zone {} --subnet {} --yes'.format(
2024-02-20T04:23:36.0157462Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:175: in cmd
2024-02-20T04:23:36.0157818Z     return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
2024-02-20T04:23:36.0158264Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:250: in __init__
2024-02-20T04:23:36.0158597Z     self._in_process_execute(cli_ctx, command, expect_failure=expect_failure)
2024-02-20T04:23:36.0159043Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/testsdk/base.py:313: in _in_process_execute
2024-02-20T04:23:36.0159472Z     raise ex.exception
2024-02-20T04:23:36.0159818Z /usr/lib64/az/lib/python3.9/site-packages/knack/cli.py:233: in invoke
2024-02-20T04:23:36.0160102Z     cmd_result = self.invocation.execute(args)
2024-02-20T04:23:36.0160504Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py:664: in execute
2024-02-20T04:23:36.0160775Z     raise ex
2024-02-20T04:23:36.0161171Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py:729: in _run_jobs_serially
2024-02-20T04:23:36.0161498Z     results.append(self._run_job(expanded_arg, cmd_copy))
2024-02-20T04:23:36.0161921Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py:698: in _run_job
2024-02-20T04:23:36.0162203Z     result = cmd_copy(params)
2024-02-20T04:23:36.0162600Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py:334: in __call__
2024-02-20T04:23:36.0162887Z     return self.handler(*args, **kwargs)
2024-02-20T04:23:36.0163320Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py:121: in handler
2024-02-20T04:23:36.0163620Z     return op(**command_args)
2024-02-20T04:23:36.0164100Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py:98: in flexible_server_create
2024-02-20T04:23:36.0164489Z     network, start_ip, end_ip = flexible_server_provision_network_resource(cmd=cmd,
2024-02-20T04:23:36.0165044Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py:976: in flexible_server_provision_network_resource
2024-02-20T04:23:36.0165431Z     private_dns_zone_id = prepare_private_dns_zone(db_context,
2024-02-20T04:23:36.0165943Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/flexible_server_virtual_network.py:356: in prepare_private_dns_zone
2024-02-20T04:23:36.0166453Z     cluster = get_cloud_cluster(cmd, location.replace('/ +/g', '').lower(), vnet_subscription)
2024-02-20T04:23:36.0166962Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/_config_reader.py:33: in get_cloud_cluster
2024-02-20T04:23:36.0167265Z     cloud = get_cloud(cmd)
2024-02-20T04:23:36.0167680Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/_config_reader.py:27: in get_cloud
2024-02-20T04:23:36.0167983Z     config = get_config_json()
2024-02-20T04:23:36.0168228Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-02-20T04:23:36.0168348Z 
2024-02-20T04:23:36.0168537Z     def get_config_json():
2024-02-20T04:23:36.0168871Z         global _config  # pylint:disable=global-statement
2024-02-20T04:23:36.0169114Z         if _config is not None:
2024-02-20T04:23:36.0169317Z             return _config
2024-02-20T04:23:36.0169562Z         script_dir = os.path.dirname(os.path.realpath(__file__))
2024-02-20T04:23:36.0169847Z >       with open(os.path.join(script_dir, "config.json"), "r") as f:
2024-02-20T04:23:36.0170364Z E       FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/config.json'
2024-02-20T04:23:36.0170799Z 
2024-02-20T04:23:36.0171224Z /usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/rdbms/_config_reader.py:18: FileNotFoundError

@bebound
Copy link
Contributor

bebound commented Feb 21, 2024

Fixed in #28419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Backup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants