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) {
|
||||
virtualMachines.forEach((virtualMachine) => {
|
||||
if (virtualMachine.location.toLowerCase() === location.name.toLowerCase() && azure.getResourceGroupFromId(virtualMachine.id).toLowerCase() === resourceGroup.name.toLowerCase()) {
|
||||
let virtualMachineValue: CategoryValue;
|
||||
if (virtualMachine.properties.provisioningState === ProvisioningState.Succeeded) {
|
||||
virtualMachineValue = {
|
||||
name: virtualMachine.id,
|
||||
displayName: virtualMachine.name
|
||||
};
|
||||
} else {
|
||||
virtualMachineValue = {
|
||||
name: virtualMachine.id,
|
||||
displayName: constants.UNAVAILABLE_TARGET_PREFIX(virtualMachine.name)
|
||||
};
|
||||
}
|
||||
virtualMachineValues.push(virtualMachineValue);
|
||||
virtualMachineValues.push({
|
||||
name: virtualMachine.id,
|
||||
displayName: virtualMachine.name
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -303,9 +303,6 @@ export function ACCOUNT_ACCESS_ERROR(account: AzureAccount, error: Error) {
|
||||
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);
|
||||
}
|
||||
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_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 { azureResource } from 'azurecore';
|
||||
import { SqlVMServer } from '../api/azure';
|
||||
import { ProvisioningState } from '../models/migrationLocalStorage';
|
||||
|
||||
export class TargetSelectionPage extends MigrationWizardPage {
|
||||
private _view!: azdata.ModelView;
|
||||
@@ -149,10 +148,6 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
||||
errors.push(constants.INVALID_VIRTUAL_MACHINE_ERROR);
|
||||
break;
|
||||
}
|
||||
if (targetVm.properties.provisioningState !== ProvisioningState.Succeeded) {
|
||||
errors.push(constants.VM_NOT_READY_ERROR(targetVm.name, targetVm.properties.provisioningState));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -408,21 +403,9 @@ export class TargetSelectionPage extends MigrationWizardPage {
|
||||
|
||||
switch (this.migrationStateModel._targetType) {
|
||||
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) {
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user