Shahar Havivi has uploaded a new change for review. Change subject: engine: RFE add custom UUID for VM ......................................................................
engine: RFE add custom UUID for VM Change-Id: Id0ea7759eea35707e95ca27976c7e8d6ca4b0900 Signed-off-by: Shahar Havivi <shah...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.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 5 files changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/25/36025/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java index 16aee42..97f60eb 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java @@ -8,7 +8,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - import org.apache.commons.codec.CharEncoding; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang.StringUtils; @@ -636,6 +635,10 @@ return false; } + if (vmFromParams.getId() != null && getVmStaticDao().get(vmFromParams.getId()) != null) { + return failCanDoAction(VdcBllMessages.VM_ID_EXISTS); + } + return true; } 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 8009db5..34337a7 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 @@ -719,6 +719,7 @@ MIGRATION_IS_NOT_SUPPORTED(ErrorType.NOT_SUPPORTED), MIGRATION_ON_ERROR_IS_NOT_SUPPORTED(ErrorType.CONFLICT), VM_MIGRATION_IS_NOT_SUPPORTED(ErrorType.CONFLICT), + VM_ID_EXISTS(ErrorType.BAD_PARAMETERS), ACTION_TYPE_FAILED_STORAGE_POOL_IS_NOT_LOCAL(ErrorType.BAD_PARAMETERS), RHEVH_LOCALFS_WRONG_PATH_LOCATION(ErrorType.BAD_PARAMETERS), 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 3f261e7..2aca909 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -203,6 +203,7 @@ MIGRATION_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Migration is not supported in this CPU architecture. MIGRATION_ON_ERROR_IS_NOT_SUPPORTED=Cannot ${action} ${type}. This resilience policy is not supported in this CPU architecture. VM_MIGRATION_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Migration option is not supported in this CPU architecture. +VM_ID_EXISTS=VM Id already exists. ACTION_TYPE_FAILED_VM_CANNOT_BE_HIGHLY_AVAILABLE_AND_PINNED_TO_HOST=Cannot ${action} ${type}. A highly available VM cannot be pinned to a specific Host ACTION_TYPE_FAILED_VM_GUID_ALREADY_EXIST=Cannot ${action} ${type}. VM with the same identifier already exists. ACTION_TYPE_FAILED_VM_ATTACHED_TO_POOL=Cannot ${action} ${type}. VM is attached to a VM Pool. 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 af5c684..1cd8559 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 @@ -529,6 +529,9 @@ @DefaultStringValue("Cannot ${action} ${type}. Migration option is not supported in this CPU architecture.") String VM_MIGRATION_IS_NOT_SUPPORTED(); + @DefaultStringValue("VM Id already exists.") + String VM_ID_EXISTS(); + @DefaultStringValue("CPU pinning format invalid.") String VM_PINNING_FORMAT_INVALID(); 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 ce29748..ca562b1 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 @@ -184,6 +184,7 @@ MIGRATION_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Migration is not supported in this CPU architecture. MIGRATION_ON_ERROR_IS_NOT_SUPPORTED=Cannot ${action} ${type}. This resilience policy is not supported in this CPU architecture. VM_MIGRATION_IS_NOT_SUPPORTED=Cannot ${action} ${type}. Migration option is not supported in this CPU architecture. +VM_ID_EXISTS=VM Id already exists. ACTION_TYPE_FAILED_VM_CANNOT_BE_HIGHLY_AVAILABLE_AND_PINNED_TO_HOST=Cannot ${action} ${type}. A highly available VM cannot be pinned to a specific Host ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_AND_MIGRATABLE=Migratable VM's cannot be pinned to CPU. ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST=Cannot set host CPU pinning when host is not selected -- To view, visit http://gerrit.ovirt.org/36025 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0ea7759eea35707e95ca27976c7e8d6ca4b0900 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shahar Havivi <shav...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches