mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
[SQL Migration] Remove faulty SQL VM state validation (#19623)
* Remove VM state validation * Remove string too * Remove a few more references
This commit is contained in:
@@ -620,19 +620,10 @@ export async function getVirtualMachinesDropdownValues(virtualMachines: azure.Sq
|
|||||||
if (location && resourceGroup) {
|
if (location && resourceGroup) {
|
||||||
virtualMachines.forEach((virtualMachine) => {
|
virtualMachines.forEach((virtualMachine) => {
|
||||||
if (virtualMachine.location.toLowerCase() === location.name.toLowerCase() && azure.getResourceGroupFromId(virtualMachine.id).toLowerCase() === resourceGroup.name.toLowerCase()) {
|
if (virtualMachine.location.toLowerCase() === location.name.toLowerCase() && azure.getResourceGroupFromId(virtualMachine.id).toLowerCase() === resourceGroup.name.toLowerCase()) {
|
||||||
let virtualMachineValue: CategoryValue;
|
virtualMachineValues.push({
|
||||||
if (virtualMachine.properties.provisioningState === ProvisioningState.Succeeded) {
|
name: virtualMachine.id,
|
||||||
virtualMachineValue = {
|
displayName: virtualMachine.name
|
||||||
name: virtualMachine.id,
|
});
|
||||||
displayName: virtualMachine.name
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
virtualMachineValue = {
|
|
||||||
name: virtualMachine.id,
|
|
||||||
displayName: constants.UNAVAILABLE_TARGET_PREFIX(virtualMachine.name)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
virtualMachineValues.push(virtualMachineValue);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,9 +303,6 @@ export function ACCOUNT_ACCESS_ERROR(account: AzureAccount, error: Error) {
|
|||||||
export function MI_NOT_READY_ERROR(miName: string, state: string): string {
|
export function MI_NOT_READY_ERROR(miName: string, state: string): string {
|
||||||
return localize('sql.migration.mi.not.ready', "The managed instance '{0}' is unavailable for migration because it is currently in the '{1}' state. To continue, select an available managed instance.", miName, state);
|
return localize('sql.migration.mi.not.ready', "The managed instance '{0}' is unavailable for migration because it is currently in the '{1}' state. To continue, select an available managed instance.", miName, state);
|
||||||
}
|
}
|
||||||
export function VM_NOT_READY_ERROR(miName: string, state: string): string {
|
|
||||||
return localize('sql.migration.vm.not.ready', "The virtual machine '{0}' is unavailable for migration because it is currently in the '{1}' state. To continue, select an available virtual machine.", miName, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
export const SELECT_AN_ACCOUNT = localize('sql.migration.select.service.select.a.', "Sign into Azure and select an account");
|
export const SELECT_AN_ACCOUNT = localize('sql.migration.select.service.select.a.', "Sign into Azure and select an account");
|
||||||
export const SELECT_A_TENANT = localize('sql.migration.select.service.select.a.tenant', "Select a tenant");
|
export const SELECT_A_TENANT = localize('sql.migration.select.service.select.a.tenant', "Select a tenant");
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { WIZARD_INPUT_COMPONENT_WIDTH } from './wizardController';
|
|||||||
import * as utils from '../api/utils';
|
import * as utils from '../api/utils';
|
||||||
import { azureResource } from 'azurecore';
|
import { azureResource } from 'azurecore';
|
||||||
import { SqlVMServer } from '../api/azure';
|
import { SqlVMServer } from '../api/azure';
|
||||||
import { ProvisioningState } from '../models/migrationLocalStorage';
|
|
||||||
|
|
||||||
export class TargetSelectionPage extends MigrationWizardPage {
|
export class TargetSelectionPage extends MigrationWizardPage {
|
||||||
private _view!: azdata.ModelView;
|
private _view!: azdata.ModelView;
|
||||||
@@ -149,10 +148,6 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
errors.push(constants.INVALID_VIRTUAL_MACHINE_ERROR);
|
errors.push(constants.INVALID_VIRTUAL_MACHINE_ERROR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (targetVm.properties.provisioningState !== ProvisioningState.Succeeded) {
|
|
||||||
errors.push(constants.VM_NOT_READY_ERROR(targetVm.name, targetVm.properties.provisioningState));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,21 +403,9 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
|||||||
|
|
||||||
switch (this.migrationStateModel._targetType) {
|
switch (this.migrationStateModel._targetType) {
|
||||||
case MigrationTargetType.SQLVM:
|
case MigrationTargetType.SQLVM:
|
||||||
const selectedVm = this.migrationStateModel._targetSqlVirtualMachines.find(vm => vm.name === value || constants.UNAVAILABLE_TARGET_PREFIX(vm.name) === value);
|
const selectedVm = this.migrationStateModel._targetSqlVirtualMachines.find(vm => vm.name === value);
|
||||||
if (selectedVm) {
|
if (selectedVm) {
|
||||||
this.migrationStateModel._targetServerInstance = utils.deepClone(selectedVm)! as SqlVMServer;
|
this.migrationStateModel._targetServerInstance = utils.deepClone(selectedVm)! as SqlVMServer;
|
||||||
|
|
||||||
if (this.migrationStateModel._targetServerInstance.properties.provisioningState !== ProvisioningState.Succeeded) {
|
|
||||||
this.wizard.message = {
|
|
||||||
text: constants.VM_NOT_READY_ERROR(this.migrationStateModel._targetServerInstance.name, this.migrationStateModel._targetServerInstance.properties.provisioningState),
|
|
||||||
level: azdata.window.MessageLevel.Error
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
this.wizard.message = {
|
|
||||||
text: '',
|
|
||||||
level: azdata.window.MessageLevel.Error
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user