Liron Ar has uploaded a new change for review. Change subject: core: wip: Introducing ImportVmFromConfigurationCommand ......................................................................
core: wip: Introducing ImportVmFromConfigurationCommand ImportVmFromConfigurationCommand is used for adding a vm to the engine with a configuration specified in an ovf file. The command adds the vm and related devices as specified in the given configuration and then attempts to attach to the vm the related disks. This is an inital version of the command - still missing some CDA checks and TBD functionality. Change-Id: I217474e2f6b302140d72b662dbe1f8ef90d05c40 Signed-off-by: Liron Aravot <lara...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportVmFromConfigurationParameters.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties M backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 14 files changed, 270 insertions(+), 33 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/15419/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java index b44c18b..f8b2e39 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java @@ -83,7 +83,7 @@ @DisableInPrepareMode @NonTransactiveCommandAttribute(forceCompensation = true) @LockIdNameAttribute -public class ImportVmCommand extends MoveOrCopyTemplateCommand<ImportVmParameters> +public class ImportVmCommand<T extends ImportVmParameters> extends MoveOrCopyTemplateCommand<T> implements QuotaStorageDependent { private static final Log log = LogFactory.getLog(ImportVmCommand.class); @@ -93,7 +93,7 @@ private final List<Guid> imageGuidList = new ArrayList<Guid>(); private final List<String> macsAdded = new ArrayList<String>(); - public ImportVmCommand(ImportVmParameters parameters) { + public ImportVmCommand(T parameters) { super(parameters); setVmId(parameters.getContainerId()); setVm(parameters.getVm()); @@ -510,7 +510,18 @@ @Override protected void executeCommand() { try { - addVmToDb(); + TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { + + @Override + public Void runInTransaction() { + addVmToDb(); + getCompensationContext().stateChanged(); + return null; + } + }); + + freeLock(); + VM vm = getVm(); // if there aren't any images- we can just perform the end // vm related ops @@ -527,20 +538,11 @@ setSucceeded(true); } - private void addVmToDb() { - TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { - - @Override - public Void runInTransaction() { - addVmStatic(); - addVmDynamic(); - addVmInterfaces(); - addVmStatistics(); - getCompensationContext().stateChanged(); - return null; - } - }); - freeLock(); + protected void addVmToDb() { + addVmStatic(); + addVmDynamic(); + addVmInterfaces(); + addVmStatistics(); } private void processImages() { @@ -563,10 +565,14 @@ }); } + protected List<DiskImage> getVmDiskImages() { + return ImagesHandler.filterImageDisks(getVm().getDiskMap().values(), false, false); + } + @Override protected void moveOrCopyAllImageGroups() { moveOrCopyAllImageGroups(getVm().getId(), - ImagesHandler.filterImageDisks(getVm().getDiskMap().values(), false, false)); + getVmDiskImages()); } @Override @@ -611,6 +617,12 @@ } } + protected void addVmActiveSnapshot(Guid snapshotId){ + Snapshot snapshot = addActiveSnapshot(snapshotId); + getVm().getSnapshots().clear(); + getVm().getSnapshots().add(snapshot); + } + protected void addVmImagesAndSnapshots() { Map<Guid, List<DiskImage>> images = getImagesLeaf(getVm().getImages()); @@ -650,9 +662,7 @@ saveDiskImageDynamic(disk); } - Snapshot snapshot = addActiveSnapshot(snapshotId); - getVm().getSnapshots().clear(); - getVm().getSnapshots().add(snapshot); + addVmActiveSnapshot(snapshotId); } else { Guid snapshotId = null; for (DiskImage disk : getVm().getImages()) { @@ -838,17 +848,23 @@ return -1; } - protected void addVmStatic() { + protected void updateVmTemplateId() { + if (getParameters().getCopyCollapse()) { + getVm().setVmtGuid(VmTemplateHandler.BlankVmTemplateId); + } + } + protected void updateCorrectQuataId() { + getVm().getStaticData().setQuotaId(getParameters().getQuotaId()); + } + protected void addVmStatic() { logImportEvents(); getVm().getStaticData().setId(getVmId()); getVm().getStaticData().setCreationDate(new Date()); getVm().getStaticData().setVdsGroupId(getParameters().getVdsGroupId()); getVm().getStaticData().setMinAllocatedMem(computeMinAllocatedMem()); - getVm().getStaticData().setQuotaId(getParameters().getQuotaId()); - if (getParameters().getCopyCollapse()) { - getVm().setVmtGuid(VmTemplateHandler.BlankVmTemplateId); - } + updateVmTemplateId(); + updateCorrectQuataId(); getVmStaticDAO().save(getVm().getStaticData()); getCompensationContext().snapshotNewEntity(getVm().getStaticData()); } @@ -930,10 +946,14 @@ iface.setVmName(getVm().getName()); } + protected VMStatus getStatusForAddedVm() { + return VMStatus.ImageLocked; + } + private void addVmDynamic() { VmDynamic tempVar = new VmDynamic(); tempVar.setId(getVmId()); - tempVar.setStatus(VMStatus.ImageLocked); + tempVar.setStatus(getStatusForAddedVm()); tempVar.setVmHost(""); tempVar.setVmIp(""); tempVar.setAppList(getParameters().getVm().getDynamicData().getAppList()); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java new file mode 100644 index 0000000..bd1165b --- /dev/null +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmFromConfigurationCommand.java @@ -0,0 +1,167 @@ +package org.ovirt.engine.core.bll; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; +import org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter; +import org.ovirt.engine.core.bll.utils.VmDeviceUtils; +import org.ovirt.engine.core.common.AuditLogType; +import org.ovirt.engine.core.common.action.AttachDettachVmDiskParameters; +import org.ovirt.engine.core.common.action.ImportVmFromConfigurationParameters; +import org.ovirt.engine.core.common.action.VdcActionType; +import org.ovirt.engine.core.common.action.VdcReturnValueBase; +import org.ovirt.engine.core.common.businessentities.DiskImage; +import org.ovirt.engine.core.common.businessentities.VM; +import org.ovirt.engine.core.common.businessentities.VMStatus; +import org.ovirt.engine.core.common.businessentities.VmStatic; +import org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; +import org.ovirt.engine.core.common.errors.VdcBllMessages; +import org.ovirt.engine.core.common.locks.LockingGroup; +import org.ovirt.engine.core.common.utils.Pair; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector; +import org.ovirt.engine.core.utils.log.Log; +import org.ovirt.engine.core.utils.log.LogFactory; +import org.ovirt.engine.core.utils.ovf.OvfManager; +import org.ovirt.engine.core.utils.ovf.OvfReaderException; +import org.ovirt.engine.core.utils.transaction.TransactionMethod; +import org.ovirt.engine.core.utils.transaction.TransactionSupport; + +@NonTransactiveCommandAttribute +public class ImportVmFromConfigurationCommand<T extends ImportVmFromConfigurationParameters> extends ImportVmCommand<T> { + + private static final Log log = LogFactory.getLog(ImportVmFromConfigurationCommand.class); + + protected ImportVmFromConfigurationCommand(Guid commandId) { + super(commandId); + } + + public ImportVmFromConfigurationCommand(T parameters) { + super(parameters); + setCommandShouldBeLogged(false); + } + + @Override + public boolean canDoAction() { + if (getVmFromConfiguration() == null) { + return failCanDoAction(VdcBllMessages.VM_CANNOT_IMPORT_FROM_CONFIGURATION_ERROR_PARSING); + } + + if (!acquireLockInternal()) { + return false; + } + + if (!validateNoDuplicateVm()) { + return false; + } + + //TODO: check about template? + + getVm().getStaticData().setVdsGroupId(getParameters().getVdsGroupId()); + setVmId(getVm().getId()); + getParameters().setVm(getVmFromConfiguration()); + return true; + } + + protected VmStatic getVmStaticData() { + return getVmFromConfiguration().getStaticData(); + } + + @Override + protected void addVmImagesAndSnapshots() { + } + + @Override + public void executeCommand() { + //TODO: not executing everything in the same transaction due to current infra limitations, might be updated - in discussions. + TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { + @Override + public Void runInTransaction() { + addVmToDb(); + addActiveSnapshot(Guid.NewGuid()); + VmDeviceUtils.addImportedDevices(getVm().getStaticData(), false, false, true, true); + return null; + } + }); + + if (!getVmDiskImages().isEmpty()){ + AuditLogDirector.log(this, AuditLogType.VM_IMPORT_FROM_CONFIGURATION_VM_CREATED_BEFORE_ATTACHING_DISKS); + } + + AuditLogDirector.log(this, attemptToAttachDisksToImportedVm()); + setActionReturnValue(getVm().getId()); + setSucceeded(true); + } + + private AuditLogType attemptToAttachDisksToImportedVm(){ + List<String> failedDisks = new LinkedList<>(); + for (DiskImage disk : getVmDiskImages()) { + AttachDettachVmDiskParameters params = new AttachDettachVmDiskParameters(getVm().getId(), disk.getId(), disk.getPlugged()); + VdcReturnValueBase returnVal = getBackend().runInternalAction(VdcActionType.AttachDiskToVm, params); + if (!returnVal.getSucceeded()) { + failedDisks.add(disk.getDiskAlias()); + } + } + + if (!failedDisks.isEmpty()) { + this.addCustomValue("DiskAliases", StringUtils.join(failedDisks, ",")); + return AuditLogType.VM_IMPORT_FROM_CONFIGURATION_ATTACH_DISKS_FAILED; + } + + return AuditLogType.VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESFULLY; + } + + protected VM getVmFromConfiguration() { + if (getVm() == null) { + OvfManager ovfManager = new OvfManager(); + setVm(new VM()); + ArrayList<DiskImage> diskImages = new ArrayList<DiskImage>(); + ArrayList<VmNetworkInterface> interfaces = new ArrayList<VmNetworkInterface>(); + try { + ovfManager.ImportVm(getParameters().getVmConfiguration(), getVm(), diskImages, interfaces); + } catch (OvfReaderException e) { + return null; + } + + // add images + getVm().setImages(diskImages); + // add interfaces + getVm().setInterfaces(interfaces); + + // add disk map + Map<Guid, List<DiskImage>> images = ImportVmCommand + .getImagesLeaf(diskImages); + for (Guid id : images.keySet()) { + List<DiskImage> list = images.get(id); + getVm().getDiskMap().put(id, list.get(list.size() - 1)); + } + } + return getVm(); + } + + @Override + protected VMStatus getStatusForAddedVm() { + return VMStatus.Down; + } + + @Override + protected Map<String, Pair<String, String>> getExclusiveLocks() { + HashMap<String, Pair<String,String>> locksMap = new HashMap<>(); + locksMap.put(getVmFromConfiguration().getId().toString(), + LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); + if (!StringUtils.isBlank(getVmFromConfiguration().getName())) { + locksMap.put(getVmFromConfiguration().getName(), + LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM_NAME, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); + } + return null; + } + + @Override + public List<QuotaConsumptionParameter> getQuotaStorageConsumptionParameters() { + return null; + } +} diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java index 3985aa9..fc4e47a 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/VmDeviceUtils.java @@ -383,20 +383,33 @@ * adds imported VM or Template devices * @param entity */ - public static <T extends VmBase> void addImportedDevices(T entity, boolean isImportAsNewEntity) { + public static <T extends VmBase> void addImportedDevices(T entity, boolean isImportAsNewEntity, boolean addDisks, boolean addInterfaces, boolean addOtherDevices) { if (isImportAsNewEntity) { setNewIdInImportedCollections(entity); } List<VmDevice> vmDeviceToAdd = new ArrayList<VmDevice>(); List<VmDevice> vmDeviceToUpdate = new ArrayList<VmDevice>(); VmDeviceDAO dao = DbFacade.getInstance().getVmDeviceDao(); - addImportedDisks(entity, vmDeviceToUpdate); - addImportedInterfaces(entity, vmDeviceToUpdate); - addOtherDevices(entity, vmDeviceToAdd); + + if (addDisks) { + addImportedDisks(entity, vmDeviceToUpdate); + } + + if (addInterfaces) { + addImportedInterfaces(entity, vmDeviceToUpdate); + } + + if (addOtherDevices) { + addOtherDevices(entity, vmDeviceToAdd); + } dao.saveAll(vmDeviceToAdd); dao.updateAll(vmDeviceToUpdate); } + public static <T extends VmBase> void addImportedDevices(T entity, boolean isImportAsNewEntity) { + addImportedDevices(entity, isImportAsNewEntity, true, true, true); + } + public static void setVmDevices(VmBase vmBase) { Map<Guid, VmDevice> vmManagedDeviceMap = new HashMap<Guid, VmDevice>(); List<VmDevice> devices = DbFacade.getInstance().getVmDeviceDao().getVmDeviceByVmId(vmBase.getId()); diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java index ff9ca1c..9bf3af8 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java @@ -154,7 +154,7 @@ ImportVmParameters parameters = createParameters(); parameters.getVm().setName(name); parameters.setImportAsNewEntity(isImportAsNewEntity); - ImportVmCommand command = new ImportVmCommand(parameters); + ImportVmCommand<ImportVmParameters> command = new ImportVmCommand<ImportVmParameters>(parameters); Set<ConstraintViolation<ImportVmParameters>> validate = ValidationUtils.getValidator().validate(parameters, command.getValidationGroups().toArray(new Class<?>[0])); @@ -173,7 +173,7 @@ RandomUtils.instance().nextPropertyString(BusinessEntitiesDefinitions.GENERAL_MAX_SIZE + 1); parameters.getVm().setUserDefinedProperties(tooLongString); parameters.setImportAsNewEntity(true); - ImportVmCommand command = new ImportVmCommand(parameters); + ImportVmCommand<ImportVmParameters> command = new ImportVmCommand<ImportVmParameters>(parameters); Set<ConstraintViolation<ImportVmParameters>> validate = ValidationUtils.getValidator().validate(parameters, command.getValidationGroups().toArray(new Class<?>[0])); diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java index f703017..95a7fdc 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java @@ -360,6 +360,9 @@ VM_PAUSED_EIO(145), VM_PAUSED_EPERM(146), VM_POWER_DOWN_FAILED(147), + VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESFULLY(148), + VM_IMPORT_FROM_CONFIGURATION_VM_CREATED_BEFORE_ATTACHING_DISKS(149), + VM_IMPORT_FROM_CONFIGURATION_ATTACH_DISKS_FAILED(150), USER_ADD_VM_POOL(300), USER_ADD_VM_POOL_FAILED(301), diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportVmFromConfigurationParameters.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportVmFromConfigurationParameters.java new file mode 100644 index 0000000..2c6be2c --- /dev/null +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportVmFromConfigurationParameters.java @@ -0,0 +1,20 @@ +package org.ovirt.engine.core.common.action; + +import org.ovirt.engine.core.compat.Guid; + +public class ImportVmFromConfigurationParameters extends ImportVmParameters{ + String vmConfiguration; + + public ImportVmFromConfigurationParameters(String vmConfiguration, Guid vdsGroupId) { + super(); + this.vmConfiguration = vmConfiguration; + setVdsGroupId(vdsGroupId); + } + + public String getVmConfiguration() { + return vmConfiguration; + } + public void setVmConfiguration(String vmConfiguration) { + this.vmConfiguration = vmConfiguration; + } +} diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java index bdec36f..f96e869 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java @@ -48,6 +48,7 @@ CancelMigrateVm(41, ActionGroup.MIGRATE_VM, false, QuotaDependency.NONE), ActivateDeactivateVmNic(42, QuotaDependency.NONE), AddVmFromSnapshot(52, ActionGroup.CREATE_VM, QuotaDependency.BOTH), + ImportVmFromConfiguration(43, ActionGroup.IMPORT_EXPORT_VM, QuotaDependency.NONE), // VdsCommands AddVds(101, ActionGroup.CREATE_HOST, QuotaDependency.NONE), UpdateVds(102, ActionGroup.EDIT_HOST_CONFIGURATION, false, QuotaDependency.NONE), diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java index 1bec3b4..5fbd2ba 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java @@ -269,6 +269,7 @@ VM_CANNOT_RUN_FROM_DISK_WITHOUT_DISK(ErrorType.CONFLICT), VM_CANNOT_RUN_STATELESS_WHILE_IN_PREVIEW(ErrorType.CONFLICT), VM_CANNOT_RUN_STATELESS_HA(ErrorType.CONFLICT), + VM_CANNOT_IMPORT_FROM_CONFIGURATION_ERROR_PARSING(ErrorType.CONFLICT), VM_CANNOT_IMPORT_VM_EXISTS(ErrorType.CONFLICT), VM_CANNOT_IMPORT_VM_NAME_EXISTS(ErrorType.CONFLICT), VM_CANNOT_SUSPEND_STATELESS_VM(ErrorType.CONFLICT), diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java index 285b023..aef3f34 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java @@ -667,6 +667,9 @@ severities.put(AuditLogType.IMPORTEXPORT_FAILED_TO_IMPORT_TEMPLATE, AuditLogSeverity.WARNING); severities.put(AuditLogType.IMPORTEXPORT_IMPORT_VM_INVALID_INTERFACES, AuditLogSeverity.WARNING); severities.put(AuditLogType.IMPORTEXPORT_IMPORT_TEMPLATE_INVALID_INTERFACES, AuditLogSeverity.NORMAL); + severities.put(AuditLogType.VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESFULLY, AuditLogSeverity.NORMAL); + severities.put(AuditLogType.VM_IMPORT_FROM_CONFIGURATION_VM_CREATED_BEFORE_ATTACHING_DISKS, AuditLogSeverity.NORMAL); + severities.put(AuditLogType.VM_IMPORT_FROM_CONFIGURATION_ATTACH_DISKS_FAILED, AuditLogSeverity.WARNING); } private static void initNetworkSeverities() { diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index fb910b8..f781383 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -40,6 +40,7 @@ -Use the Run-Once command to select a different boot option and rerun the VM. VM_CANNOT_RUN_STATELESS_WHILE_IN_PREVIEW=Cannot ${action} ${type}. Stateless flag on VM conflicts with running the VM in Preview mode. Either remove the Stateless flag from the VM or run the VM not in Preview mode. VM_CANNOT_RUN_STATELESS_HA=Cannot ${action} ${type}. Highly Available Virtual servers can not be run as stateless. +VM_CANNOT_IMPORT_FROM_CONFIGURATION_ERROR_PARSING="Cannot ${action} ${type}. Failed to parse the given configuration." ACTION_TYPE_FAILED_DELETE_PROTECTION_ENABLED=Cannot ${action} ${type}. Delete protection is enabled. In order to delete, disable Delete protection first. RESOURCE_MANAGER_FAILED_ATTACHING_VM_TO_USERS=Failed to attach VM to User. RESOURCE_MANAGER_MIGRATING_VM_IS_NOT_UP=Migration failed, VM is not running. diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties index e2e2513..12ef452 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties @@ -299,6 +299,9 @@ VM_PAUSED_EIO=VM ${VmName} has paused due to storage I/O problem. VM_PAUSED_EPERM=VM ${VmName} has paused due to storage permissions problem. VM_POWER_DOWN_FAILED=Shutdown of VM ${VmName} failed. +VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESFULLY=VM ${VmName} has been successfully imported from the given configuration. +VM_IMPORT_FROM_CONFIGURATION_VM_CREATED_BEFORE_ATTACHING_DISKS=VM ${VmName} has been created from the given configuration, attempting to attach to it the following disk(s) as present in the configuration file ${DisksNames}. +VM_IMPORT_FROM_CONFIGURATION_ATTACH_DISKS_FAILED=Failed to attach to VM ${VmName} the following disk(s): ${DiskAliases}, please refer to the engine log for the failure reason for each disk. VDS_INSTALL=Host ${VdsName} installed VDS_INSTALL_FAILED=Host ${VdsName} installation failed. ${FailedInstallMessage}. VDS_INITIALIZING=Host ${VdsName} is initializing. Message: ${ErrorMessage} diff --git a/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties b/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties index a760995..f45a8d5 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/ExecutionMessages.properties @@ -21,6 +21,7 @@ job.AddDisk=Adding Disk ${DiskAlias} job.RemoveDisk=Removing Disk ${DiskAlias} job.ImportVm=Importing VM ${VM} to Cluster ${VdsGroups} +job.ImportVmFromConfiguration=Importing VM ${VM} from configuration to Cluster ${VdsGroups} job.RemoveVmFromImportExport=Removing VM ${VM} image from Storage Domain ${Storage} job.RemoveVmTemplateFromImportExport=Removing VM Template ${VmTemplate} image from Storage Domain ${Storage} job.ImportVmTemplate=Importing VM Template ${VmTemplate} to Data Center ${StoragePool} diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index a5337dd..d2c5aea 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -91,6 +91,9 @@ @DefaultStringValue("Cannot ${action} ${type}. Highly Available Virtual servers can not be run as stateless.") String VM_CANNOT_RUN_STATELESS_HA(); + @DefaultStringValue("Cannot ${action} ${type}. Failed to parse the given configuration.") + String VM_CANNOT_IMPORT_FROM_CONFIGURATION_ERROR_PARSING(); + @DefaultStringValue("Cannot ${action} ${type}. Delete protection is enabled. In order to delete, disable Delete protection first.") String ACTION_TYPE_FAILED_DELETE_PROTECTION_ENABLED(); diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index c6ebb37..28cb6c9 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -40,6 +40,7 @@ -Use the Run-Once command to select a different boot option and rerun the VM. VM_CANNOT_RUN_STATELESS_WHILE_IN_PREVIEW=Cannot ${action} ${type}. Stateless flag on VM conflicts with running the VM in Preview mode. Either remove the Stateless flag from the VM or run the VM not in Preview mode. VM_CANNOT_RUN_STATELESS_HA=Cannot ${action} ${type}. Highly Available Virtual servers can not be run as stateless. +VM_CANNOT_IMPORT_FROM_CONFIGURATION_ERROR_PARSING="Cannot ${action} ${type}. Failed to parse the given configuration." ACTION_TYPE_FAILED_DELETE_PROTECTION_ENABLED=Cannot ${action} ${type}. Delete protection is enabled. In order to delete, disable Delete protection first. RESOURCE_MANAGER_FAILED_ATTACHING_VM_TO_USERS=Failed to attach VM to User. RESOURCE_MANAGER_MIGRATING_VM_IS_NOT_UP=Migration failed, VM is not running. -- To view, visit http://gerrit.ovirt.org/15419 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I217474e2f6b302140d72b662dbe1f8ef90d05c40 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <lara...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches