Description of problem: Inconsistent behavior of blank and custom templates when there is no enough MAC addresses left in MAC Address Pool and misleading error message. - When trying to create new VM from custom template and there is no enough MAC addresses left in the MAC address pool, i get the next error message: Operation Canceled Error while executing action: customTemp: Not enough MAC addresses left in MAC Address Pool. The result when pressing 'close' : operation indeed canceled, vm doesn't created. - Same behavior^^ for VM's from snapshot(clone VM from snapshot). - When trying to create new VM from blank template and there is no enough MAC addresses left in the MAC address pool, i get the next error message: Operation Canceled Error while executing action: blankTemp: Not enough MAC addresses left in MAC Address Pool. The result when pressing 'close': operation actually succeed, VM created, vNIC's created according to free MAC's in the pool. The error message in this case, is misleading. - In both this cases the behavior is different and in case of blank template, the error message is misleading. Version-Release number of selected component (if applicable): 3.5.0-0.32.el6ev 3.6.0-0.0.master.20150217062203.git1012296.el6 How reproducible: 100 Steps to Reproduce: 1. custom template with 3 vNIC's 1. Define MAC pool range of 00:00:00:00:00:05-00:00:00:00:00:06 via engine-config(3.5) or via 'configure'(3.6) 2. Create new VM based on blank template with 3 vNIC's 3. Remove VM from stem 2 4. Try to create new VM based on the custom template from step 1. Actual results: step 2 - when trying to approve operation getting the error message, but VM got created with 2 vNIC's instead of 3. This is expected behavior. step 4 - when trying to approve operation getting the error message and VM doesn't created, operation canceled and new VM window dialog is closed. Expected results: 1. The expected behavior should be the creation of the VM, in both cases. Without any error messages, maybe only warning message about the lack of MAC addresses. VM should be created with numbers of vNIC's according to the number of free MAC addresses. Same for snapshots. 2. The behavior should be consistent for all cases for new VM creation based on templates. 3. And even if i get an error message that saying that operation is canceled, i expect it to actually be canceled. Not like in the example described above, when creating new VM based on blank template. In such case you get operation canceled message, but VM got created in the end.
The problem here is that when creating vm from template, the interfaces are created as part of the addVm command flow in the backend. when creating vm from blank (and setting the nic in the dialog..) then first the vm is created, and the nic is created afterwards by the ui in a different command. although the ui can do some check before calling the add-vm, it might be racy and i am not sure it is worth dealing with.
It's a good thing we're looking to fix Bug 999969 for 3.6 then :) Should make it very easy to also add/remove NICs upon creating of a VM (either from a template or from Blank) in a transactive way.
now that Bug 999969 is solved, can you please check if this is still relevant?
Hi Omer, It's the exact behavior like described in my Description above ^^ So yes, it is still relevant. nothing changed here. Thanks.
Ok, looking into this and the issue is that when creating vm from blank, and setting the nics in the dialog, what actually happens is: 1. add vm from blank (without nics) 2. add nics to the new vm for the user it looks like one operation, but actually he asked is create vm and add nics to it... this is why what is failing is just step 2, adding the nics when creating vm from template with nics, its only one step, the nics are created as part of the add command, so this fails the whole command but if you would choose other template that has no nics, and add nics on the dialog, it would happen as well. what i suggest is to improve the message to describe what has failed, so the user will not be confused: instead of "Not enough MAC addresses left in MAC Address Pool." user will get: "Cannot Add VM. Not enough MAC addresses left in MAC Address Pool." or "Cannot Add NIC. Not enough MAC addresses left in MAC Address Pool."
Verified on - 3.6.0-0.13.master.el6 In case of New VM based on blank template and not enough free MAC addresses we will get the next error message --> "Cannot Add NIC. Not enough MAC addresses left in MAC Address Pool." VM will be created. NIcs will be created according to free MACs left in the pool. In case of New VM based on template with nics and not enough MAC addresses left we will get --> "Cannot Add VM. Not enough MAC addresses left in MAC Address Pool." VM won't be created. Operation canceled.