Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/datamigration/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Release History
===============

0.2.0
++++++
* Bug fix for Multiple connection strings in az datamigration get-assessment command.
* [NEW COMMAND] az datamigration performance-data-collection - Collect performance data for given SQL Server instance(s).
* [NEW COMMAND] az datamigration get-sku-recommendation - Give SKU recommendations for Azure SQL offerings.

0.1.0
++++++
* Initial release.
10 changes: 10 additions & 0 deletions src/datamigration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ az datamigration get-assessment --connection-string "Data Source=LabServer.datab
az datamigration register-integration-runtime --auth-key "IR@00000-0000000-000000-aaaaa-bbbb-cccc"
```

##### Performance-data-collection #####
```
az datamigration performance-data-collection --connection-string "Data Source=LabServer.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" --output-folder "C:\\PerfCollectionOutput" --number-of-interation 5 --perf-query-interval 10 --static-query-interval 60
```

##### Get-sku-recommendation #####
```
az datamigration get-sku-recommendation --output-folder "C:\\PerfCollectionOutput" --database-allow-list AdventureWorks, AdventureWorks2 --display-result --overwrite
```

#### datamigration sql-managed-instance ####
##### Create (Backup source Fileshare) #####
```
Expand Down
24 changes: 24 additions & 0 deletions src/datamigration/azext_datamigration/manual/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,30 @@
az datamigration get-assessment --config-file-path "C:\\Users\\user\\document\\config.json"
"""

helps['datamigration performance-data-collection'] = """
type: command
short-summary: Collect performance data for given SQL Server instance(s).
examples:
- name: Collect performance data of a given SQL Server using connection string.
text: |-
az datamigration performance-data-collection --connection-string "Data Source=LabServer.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" --output-folder "C:\\PerfCollectionOutput" --number-of-interation 5 --perf-query-interval 10 --static-query-interval 60
- name: Collect performance data of a given SQL Server using assessment config file.
text: |-
az datamigration performance-data-collection --config-file-path "C:\\Users\\user\\document\\config.json"
"""

helps['datamigration get-sku-recommendation'] = """
type: command
short-summary: Give SKU recommendations for Azure SQL offerings.
examples:
- name: Get SKU recommendation for given SQL Server using command line.
text: |-
az datamigration get-sku-recommendation --output-folder "C:\\PerfCollectionOutput" --database-allow-list AdventureWorks, AdventureWorks2 --display-result --overwrite
- name: Get SKU recommendation for given SQL Server using assessment config file.
text: |-
az datamigration get-sku-recommendation --config-file-path "C:\\Users\\user\\document\\config.json"
"""

helps['datamigration register-integration-runtime'] = """
type: command
short-summary: Register Database Migration Service on Integration Runtime
Expand Down
28 changes: 26 additions & 2 deletions src/datamigration/azext_datamigration/manual/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,40 @@
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines
# pylint: disable=too-many-statements
# pylint: disable=line-too-long


def load_arguments(self, _):

with self.argument_context('datamigration get-assessment') as c:
c.argument('connection_string', nargs='+', help='Sql Server Connection Strings')
c.argument('connection_string', nargs='+', help='SQL Server Connection Strings')
c.argument('output_folder', type=str, help='Output folder to store assessment report')
c.argument('config_file_path', type=str, help='Path of the ConfigFile')
c.argument('overwrite', help='Enable this parameter to overwrite the existing assessment report')

with self.argument_context('datamigration performance-data-collection') as c:
c.argument('connection_string', nargs='+', help='SQL Server Connection Strings')
c.argument('output_folder', type=str, help='Output folder to store performance data')
c.argument('perf_query_interval', type=int, help='Interval at which to query performance data, in seconds.')
c.argument('static_query_interval', type=int, help='Interval at which to query and persist static configuration data, in seconds.')
c.argument('number_of_interation', type=int, help='Number of iterations of performance data collection to perform before persisting to file. For example, with default values, performance data will be persisted every 30 seconds * 20 iterations = 10 minutes. Minimum: 2.')
c.argument('config_file_path', type=str, help='Path of the ConfigFile')

with self.argument_context('datamigration get-sku-recommendation') as c:
c.argument('output_folder', type=str, help='Output folder where performance data of the SQL Server is stored. The value here must be the same as the one used in PerfDataCollection')
c.argument('target_platform', type=str, help='Target platform for SKU recommendation: either AzureSqlDatabase, AzureSqlManagedInstance, AzureSqlVirtualMachine, or Any. If Any is selected, then SKU recommendations for all three target platforms will be evaluated, and the best fit will be returned.')
c.argument('target_sql_instance', type=str, help='Name of the SQL instance for which SKU should be recommendeded. Default: outputFolder will be scanned for files created by the PerfDataCollection action, and recommendations will be provided for every instance found.')
c.argument('target_percentile', type=int, help='Percentile of data points to be used during aggregation of the performance data. Only used for baseline (non-elastic) strategy.')
c.argument('scaling_factor', type=int, help='Scaling (comfort) factor used during SKU recommendation. For example, if it is determined that there is a 4 vCore CPU requirement with a scaling factor of 150%, then the true CPU requirement will be 6 vCores.')
c.argument('start_time', type=str, help='UTC start time of performance data points to consider during aggregation, in YYYY-MM-DD HH:MM format. Only used for baseline (non-elastic) strategy. Default: all data points collected will be considered.')
c.argument('end_time', type=str, help='UTC end time of performance data points to consider during aggregation, in YYYY-MM-DD HH:MM format. Only used for baseline (non-elastic) strategy. Default: all data points collected will be considered.')
c.argument('overwrite', help='Whether or not to overwrite any existing SKU recommendation reports. Enable this paramater to overwrite.')
c.argument('display_result', help='Whether or not to print the SKU recommendation results to the console. Enable this parameter to display result.')
c.argument('elastic_strategy', help='Whether or not to use the elastic strategy for SKU recommendations based on resource usage profiling. Enable this parameter to use elastic strategy.')
c.argument('database_allow_list', nargs='+', help='Space separated list of names of databases to be allowed for SKU recommendation consideration while excluding all others. Only set one of the following or neither: databaseAllowList, databaseDenyList. Default: null.')
c.argument('database_deny_list', nargs='+', help='Space separated list of names of databases to not be considered for SKU recommendation. Only set one of the following or neither: databaseAllowList, databaseDenyList. Default: null.')
c.argument('config_file_path', type=str, help='Path of the ConfigFile')

with self.argument_context('datamigration register-integration-runtime') as c:
c.argument('auth_key', type=str, help='AuthKey of Sql Migration Service')
c.argument('auth_key', type=str, help='AuthKey of SQL Migration Service')
c.argument('ir_path', type=str, help='Path of Integration Runtime MSI')
14 changes: 5 additions & 9 deletions src/datamigration/azext_datamigration/manual/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@

def load_command_table(self, _):

with self.command_group(
'datamigration get-assessment'
) as g:
g.custom_command('', 'datamigration_assessment')

with self.command_group(
'datamigration register-integration-runtime'
) as g:
g.custom_command('', 'datamigration_register_ir')
with self.command_group('datamigration') as g:
g.custom_command('get-assessment', 'datamigration_assessment')
g.custom_command('performance-data-collection', 'datamigration_performance_data_collection')
g.custom_command('get-sku-recommendation', 'datamigration_get_sku_recommendation')
g.custom_command('register-integration-runtime', 'datamigration_register_ir')
Loading