Created attachment 788895 [details] engine log Description of problem: When creating a VM from a template, the VNIC profile drop down box shows the default 'rhevm' profile regardless of the profile in the template and the user can select any VNIC profile. Instead, the box should show the profile in the template and there shouldn't be a way to change it. Version-Release number of selected component (if applicable): engine version: 3.3.0-0.15.master.el6ev How reproducible: 100% Steps to Reproduce: 1. Create a VM with some profile on its VNIC. 2. Create a template from the VM. 3. Open the new VM dialog and select the template. 4. Select a different VNIC profile from the one in the template and create the VM. Actual results: Any VNIC profile can be selected for the new VM's VNIC. When hitting 'ok', the VNIC will be created with the same profile as in the template (regardless of the user's choice). When a different profile is selected than the one in the template, an error is shown saying that the VNIC cannot be updated when the VM is not in up or down state (but the VM still gets created without problems). Expected results: Only the profile in the template should be shown in the dialog and it should be grayed out without an option to change it. Additional info:
"Instead, the box should show the profile in the template and there shouldn't be a way to change it" "Only the profile in the template should be shown in the dialog and it should be grayed out without an option to change it." why? the bug describes *creating* a new VM, not editing it, so why shouldn't profile be editable (i agree default should be the one from the template, *if* the user has permission to that profile).
(In reply to Itamar Heim from comment #1) > "Instead, the box should show the profile in the template and there > shouldn't be a way to change it" > "Only the profile in the template should be shown in the dialog and it > should be grayed out without an option to change it." > > why? > > the bug describes *creating* a new VM, not editing it, so why shouldn't > profile be editable (i agree default should be the one from the template, > *if* the user has permission to that profile). The creation of a VM from template uses the template vnics for the VM nics. The AddVmFromTemplate api doesn't exposes the set of vm interfaces explicitly. The VM interfaces as presented on the 'New VM' dialog are being compared to the current vm vnics, and if there is a difference between them, a specific Update Vnic command is sent. Currently, we support updating vnics only when the VM status is up or down. When the vm is being created, it status changes to ImageLocked which cause the vnic update operation to fail. We can consider extending the supported vm statuses for updating a vnic, so the update operation will be enabled at that time. However, in the list of the vnics on the 'New VM' dialog vnic which aren't using any network/vnic profile will not be presented, therefore cannot be modified (which seems the more reasonable vnics to change, i.e. vnics which their vnic profile no longer exists in the current DC)
or pass the needed information to AddVmFromTemplate so it will be created correctly to begin with?
(In reply to Itamar Heim from comment #3) > or pass the needed information to AddVmFromTemplate so it will be created > correctly to begin with? The only consideration for not supporting it ATM is time. A quick fix would be supporting updating the vnics when the vm is on ImageLocked status (as already supported for adding new vnic). Extending the API of AddVm and AddVmFromTemplate requires further work both on UI and on REST API. I'll open a bug for it, so we could refer to it separately from this one, while this one is relatively easy to fix (though not optimal).
Just to make sure that I understand the desired solution comprises two fixes: 1. The default suggested profile for each VNIC should be that of the template (i.e. the one that existed on the source VM at the time of the template's creation, or blank if that profile had been removed). 2. These selections should stay changeable, but obviously in case they've been changed - the user's choice should be reflected on the newly-created VM. Please confirm or correct me if I got something wrong.
(In reply to Lior Vernia from comment #5) > Just to make sure that I understand the desired solution comprises two fixes: > > 1. The default suggested profile for each VNIC should be that of the > template (i.e. the one that existed on the source VM at the time of the > template's creation, or blank if that profile had been removed). > > 2. These selections should stay changeable, but obviously in case they've > been changed - the user's choice should be reflected on the newly-created VM. > > Please confirm or correct me if I got something wrong. Confirmed. In the scope of this bug the UpdateVmInterface command should support modifying the vnic when the Vm is in ImageLocked status as well (same as in adding new vnic). A follower bug will be open to support extending the AddVm and AddVmFromTemplate api to receive the required vm interfaces so the vm creation as requested will be executed at once.
The fix for the UpdateVmInterface should be addressed as part of fixing bug 996568 "CanDoAction on UpdateVmInterfaceCommand when creating VM from template". So fixing this bug should handle UI side only.
works on is15
Closing - RHEV 3.3 Released