mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
[SQL Migration] Fix SKU recommendations not working for named (non-default) instances (#18697)
* WIP * Change instance name from machine name to full instance name returned by assessment * Get full instance name from source connection profile instead of relying on assessment result * Combine correct machine name with correct instance name
This commit is contained in:
@@ -352,13 +352,21 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
public async getSkuRecommendations(): Promise<SkuRecommendation> {
|
||||
try {
|
||||
const serverInfo = await azdata.connection.getServerInfo(this.sourceConnectionId);
|
||||
const machineName = (<any>serverInfo)['machineName']; // get actual machine name instead of whatever the user entered as the server name (e.g. DESKTOP-xxx instead of localhost)
|
||||
const machineName = (<any>serverInfo)['machineName']; // contains the correct machine name but not necessarily the correct instance name
|
||||
const instanceName = (await this.getSourceConnectionProfile()).serverName; // contains the correct instance name but not necessarily the correct machine name
|
||||
|
||||
let fullInstanceName: string;
|
||||
if (instanceName.includes('\\')) {
|
||||
fullInstanceName = machineName + '\\' + instanceName.substring(instanceName.indexOf('\\') + 1);
|
||||
} else {
|
||||
fullInstanceName = machineName;
|
||||
}
|
||||
|
||||
const response = (await this.migrationService.getSkuRecommendations(
|
||||
this._skuRecommendationPerformanceLocation,
|
||||
this._performanceDataQueryIntervalInSeconds,
|
||||
this._recommendationTargetPlatforms.map(p => p.toString()),
|
||||
machineName,
|
||||
fullInstanceName,
|
||||
this._skuTargetPercentile,
|
||||
this._skuScalingFactor,
|
||||
this._defaultDataPointStartTime,
|
||||
|
||||
Reference in New Issue
Block a user