Tomas Jelinek has submitted this change and it was merged.
Change subject: core: adjustments needed to support instance types
......................................................................
core: adjustments needed to support instance types
Three things had to be changed:
- permissions: the instance types need a bit different permissions than the
template. Since they are not cluster dependent they don't need that
permissions. But at the same time, they need a system level permission to
create template.
- devices: when creating an instance type, the devices are not copied from
a VM (since there is no base VM). Instead a blank template's devices are used
- Since the instace types are stored to vm_static but they are not cluster
dependent, the vds_groups_vm_static had to be removed. Since from now the
VdsGroup can be null, the guarding that it is not where it is not allowed to
be has been moved to the code (mostly canDoAction).
- the instance type field made editable for the VM since some of the fields
which are derived from the instance type are editable on the VM so there
needs to be a way to detach the VM from it's instance type.
More details for the vds_groups_vm_static removal:
There are two types of commands:
- VM related ones: the vdsGroupId can never be null - added the appropriate
guards into the code (mostly canDoAction). An exception is the
RemoveAllVmImagesCommand which can be run also after the VM has been
deleted
- Template related ones: The vdsGroupId can be null if the templateType is
instance type
It has been tested using the
http://gerrit.ovirt.org/#/c/21821
Change-Id: Ifaebd849061efa1637f9fa21d8584212ba0e51f2
Signed-off-by: Tomas Jelinek <tjelinek(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractVmWatchdogCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddWatchdogCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateWatchdogCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmManagementCommandBase.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/cluster/NetworkHelper.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/template/AddVmTemplateInterfaceCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/template/UpdateVmTemplateInterfaceCommand.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/template/VmTemplateInterfaceCommandBase.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/vm/VnicProfileHelper.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/commands/AffinityGroupCRUDCommand.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/AddVmCommandTest.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/action/AddVmTemplateParameters.java
M
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmStatic.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/dao/VmTemplateDAODbFacadeImpl.java
M
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/NetworkDaoDbFacadeImpl.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
M
frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
M packaging/dbscripts/create_views.sql
A packaging/dbscripts/upgrade/03_05_0290_drop_vds_group_id_constraint_from_vm_static.sql
31 files changed, 294 insertions(+), 116 deletions(-)
Approvals:
Tomas Jelinek: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/23828
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifaebd849061efa1637f9fa21d8584212ba0e51f2
Gerrit-PatchSet: 28
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Kobi Ianko <kobi(a)redhat.com>
Gerrit-Reviewer: Lior Vernia <lvernia(a)redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag(a)redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjelinek(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server