Description of problem: When provisioning a VM through a service and using the functionality of the default naming method, server names are incremented by 2. Version-Release number of selected component (if applicable): 3.1 How reproducible: 100% Steps to Reproduce: 1.Create a RHEV service catalog using changeme as the vm_name 2.Provision a service Actual results: Each time a vm is provisioned through the service catalog, the numerical suffix will increment by two. For example, if $evm.object['vm_prefix'] is 'test', then the VMs provisioned through the service will be, in order, test002, test004, test006, etc. Expected results: The VMs provisioned through services should increment by 1 (one). Additional info:
It seems this is happening because the naming method is being called twice. See the conversation here: Since the method only sets the evm.object[vmname] to derived_name, the :vm_name option is still 'changeme' the second time around. It can be avoided by adding: prov.set_option(:vm_name, derived_name) prov.set_option(:vm_target_name, derived_name) At the bottom of the method. This keeps the process from running the second time and results in VM names that increment by one.
adding conversation referenced in above comment: http://post-office.corp.redhat.com/archives/cf-tech/2015-January/msg00073.html
*** Bug 1198604 has been marked as a duplicate of this bug. ***
New commit detected on manageiq/master: https://github.com/ManageIQ/manageiq/commit/0414a970b68ee5747b08362989990ad24b129df0 commit 0414a970b68ee5747b08362989990ad24b129df0 Author: Madhu Kanoor <mkanoor> AuthorDate: Thu Mar 5 16:02:29 2015 -0500 Commit: Madhu Kanoor <mkanoor> CommitDate: Thu Mar 5 16:02:29 2015 -0500 Removed an extra call to after_request_task_create https://bugzilla.redhat.com/show_bug.cgi?id=1195754 Removed an extra call to after_request_task_create since create_request_task already calls after_request_task_create. after_request_task_create was responsible for setting the vmname. Since it got called twice it increments in even increments, so the vms created via services with $n{x} notation would always start as 002 and then increment by 2. vmdb/app/models/miq_provision_request_template.rb | 1 - 1 file changed, 1 deletion(-)
New commit detected on cfme/5.3.z: https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=8fbf08db965e139ee6979c9980deb887ffaaa10c commit 8fbf08db965e139ee6979c9980deb887ffaaa10c Author: Madhu Kanoor <mkanoor> AuthorDate: Thu Mar 5 16:02:29 2015 -0500 Commit: Madhu Kanoor <mkanoor> CommitDate: Mon Mar 9 16:50:26 2015 -0400 Removed an extra call to after_request_task_create https://bugzilla.redhat.com/show_bug.cgi?id=1195754 Removed an extra call to after_request_task_create since create_request_task already calls after_request_task_create. after_request_task_create was responsible for setting the vmname. Since it got called twice it increments in even increments, so the vms created via services with $n{x} notation would always start as 002 and then increment by 2. vmdb/app/models/miq_provision_request_template.rb | 1 - 1 file changed, 1 deletion(-)
Verified in 5.4.0.0.11.20150309201930_8b6a235 ,increments by one.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1100.html