Bug 1633516 - [RHV] Wrong number of arguments error during PXE provision from template
Summary: [RHV] Wrong number of arguments error during PXE provision from template
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.10.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.0
Assignee: Boriso
QA Contact: Angelina Vasileva
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-09-27 08:11 UTC by Jan Zmeskal
Modified: 2019-08-19 13:49 UTC (History)
6 users (show)

Fixed In Version: 5.10.0.21
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-12 16:52:54 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Provisioning request (31.08 KB, image/png)
2018-09-27 08:11 UTC, Jan Zmeskal
no flags Details

Description Jan Zmeskal 2018-09-27 08:11:05 UTC
Created attachment 1487651 [details]
Provisioning request

Description of problem:
When you try to provision a VM from template using PXE, the provisioning request fails with this error:
[EVM] VM [test_jzmeskal_pxe] Step [CheckProvisioned] Status [Error Creating VM] Message [[ArgumentError]: wrong number of arguments (given 1, expected 0)]

Version-Release number of selected component (if applicable):
CFME 5.10.0.16
RHV 4.2.7

How reproducible:
100 %

Steps to Reproduce:
1. Have a RHV provider in CFME. Have a PXE server set up.
2. Go to Compute -> Infrastructure -> Virtual Machines. Click Lifecycle -> Provision VMs.
3. Choose a valid template.
4. Make provision request like this:
Catalog -> Provision Type == PXE
Catalog -> PXE -> Image == <choose valid PXE image>
Regarding other options, you can probably go with default.
5. Observe the status of your provision request.

Actual results:
Provision request fails after few minutes with error provided above.

Expected results:
I executed this scenario many times on older version of CFME with the same template/PXE server/PXE image and never had such problem. Therefore I'd expect the provisioning request to succeed with the given configuration.

Additional info:
- You can see the error on line 1097 of evm.log.

Comment 4 Greg McCullough 2018-09-27 12:01:14 UTC
Sending to RHV team.

Enhancement work in PR https://github.com/ManageIQ/manageiq-providers-ovirt/pull/275 added a method override for prepare_customization_template_substitution_options but missed the optional parameter as defined by the original core method here: https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_provision/pxe.rb#L46

The method definition should be:
def prepare_customization_template_substitution_options(mac_address = nil)


Relevant stack trace from attached log:
[----] E, [2018-09-27T03:53:59.026876 #3044:498f7c] ERROR -- : Q-task_id([r53_miq_provision_29]) MIQ(ManageIQ::Providers::Redhat::InfraManager::ProvisionViaPxe#provision_error) [[ArgumentError]: wrong number of arguments (given 1, expected 0)] encountered during phase [create_pxe_configuration_file]
[----] E, [2018-09-27T03:53:59.027104 #3044:498f7c] ERROR -- : Q-task_id([r53_miq_provision_29]) /opt/rh/cfme-gemset/bundler/gems/cfme-providers-ovirt-01a674b45a28/app/models/manageiq/providers/redhat/infra_manager/provision/configuration.rb:54:in `prepare_customization_template_substitution_options'
/var/www/miq/vmdb/app/models/miq_provision/pxe.rb:64:in `create_pxe_files'

Comment 6 CFME Bot 2018-10-02 15:38:12 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/master:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/2f6e0ac931afb280173e8b12d82968ea45f709a8
commit 2f6e0ac931afb280173e8b12d82968ea45f709a8
Author:     Boris Odnopozov <bodnopoz>
AuthorDate: Tue Oct  2 10:07:25 2018 -0400
Commit:     Boris Odnopozov <bodnopoz>
CommitDate: Tue Oct  2 10:07:25 2018 -0400

    Fix PXE provisioning

    Method from core was overridden without an optional parameter which broke
    the PXE provisioning.

    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1633516

 app/models/manageiq/providers/redhat/infra_manager/provision/configuration.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 7 CFME Bot 2018-10-03 13:22:54 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/hammer:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/94891abe377c3e89a973f075fb0ec33ef8255399
commit 94891abe377c3e89a973f075fb0ec33ef8255399
Author:     Piotr Kliczewski <piotr.kliczewski>
AuthorDate: Tue Oct  2 11:38:07 2018 -0400
Commit:     Piotr Kliczewski <piotr.kliczewski>
CommitDate: Tue Oct  2 11:38:07 2018 -0400

    Merge pull request #294 from borod108/bugs/1633516pxe_arg_num

    Fix PXE provisioning

    (cherry picked from commit 5a2a31e8a25d62e29cd6637aa76bda17e5eba8fa)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1633516

 app/models/manageiq/providers/redhat/infra_manager/provision/configuration.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 8 Jan Zmeskal 2018-10-12 11:03:56 UTC
I tried to provision VM from PXE using Reproduction Steps, but I cannot confirm that the problem has been fixed. It is true that I did not see the original error message about wrong number of arguments. However, when using CFME 5.10.0.19, the provisioning failed on this error:

[EVM] VM [test_jzmeskal_pxe_2] Step [CheckProvisioned] Status [Error Creating VM] Message [[NoMethodError]: undefined method `[]' for nil:NilClass]

I have captured logs from the appliance and attached them to this bug. They are in "Failed Verification" archive.

Additional info:
- The VM has actually been created on the provider and was in powered down state. When I tried to run it, I was actually even able to log in but then I encountered a lot of errors (see screenshot in "Failed Verification" archive).
- I've also attached engine.log from RHV engine machine and vdsm.log from the host on which the VM was provisioned .

Comment 11 CFME Bot 2018-10-22 11:11:44 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/master:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/fa1bdf3438dbd39f2bf838083979a49189610330
commit fa1bdf3438dbd39f2bf838083979a49189610330
Author:     Boris Odnopozov <bodnopoz>
AuthorDate: Tue Oct 16 05:44:11 2018 -0400
Commit:     Boris Odnopozov <bodnopoz>
CommitDate: Tue Oct 16 05:44:11 2018 -0400

    Fix pxe provisioning

    Overriding function in the provider did not account for the case when
    prepare_customization_template_substitution_options custom template is not provided.
    Added handling for that case.

    Fix: https://bugzilla.redhat.com/show_bug.cgi?id=1633516

 app/models/manageiq/providers/redhat/infra_manager/provision/configuration.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 12 CFME Bot 2018-10-22 17:32:44 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/hammer:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/222cb03d79ab62818e7c1eb6bfb61319dcc66f77
commit 222cb03d79ab62818e7c1eb6bfb61319dcc66f77
Author:     Piotr Kliczewski <piotr.kliczewski>
AuthorDate: Mon Oct 22 07:07:58 2018 -0400
Commit:     Piotr Kliczewski <piotr.kliczewski>
CommitDate: Mon Oct 22 07:07:58 2018 -0400

    Merge pull request #300 from borod108/bugs/1633516pxe_prov_fail

    Fix pxe provisioning

    (cherry picked from commit c4a82eb13b7ef8c266ee2676008c34194e5a87c2)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1633516

 app/models/manageiq/providers/redhat/infra_manager/provision/configuration.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 13 Jan Zmeskal 2018-10-25 11:38:30 UTC
Verified on 5.10.0.21 following reproduction steps.


Note You need to log in before you can comment on or make changes to this bug.