Bug 1427603 - No payload sent to rhevm4.0 from cfme-5.7.0
Summary: No payload sent to rhevm4.0 from cfme-5.7.0
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.7.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: GA
: 5.8.0
Assignee: Juan Hernández
QA Contact: Ilanit Stein
URL:
Whiteboard: rhev:provision:cloud-init
Depends On: 1448231
Blocks: 1434428
TreeView+ depends on / blocked
 
Reported: 2017-02-28 17:22 UTC by Felix Dewaleyne
Modified: 2020-04-15 15:23 UTC (History)
9 users (show)

Fixed In Version: 5.8.0.7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1434428 (view as bug list)
Environment:
Last Closed: 2017-06-12 16:31:01 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ManageIQ manageiq pull 14139 0 None None None 2017-03-02 17:41:59 UTC

Description Felix Dewaleyne 2017-02-28 17:22:55 UTC
Description of problem:
No payload sent to rhevm4.0 from cfme-5.7.0

Version-Release number of selected component (if applicable):
cfme5.7.0
rhevm4.0.5

How reproducible:
all the time

Steps to Reproduce:
1.provision against rhevm expecting cloud-init to be ran 
2.
3.

Actual results:
no payload can be seen in the debug output of cloudforms or in the informations from rhevm

Expected results:
the payuload is passed to rhev and used for cloud-init

Additional info:

Comment 5 Felix Dewaleyne 2017-03-01 11:30:21 UTC
severity update to reflect severity increas on the ticket

Comment 6 Juan Hernández 2017-03-01 17:52:27 UTC
I am not 100% yet, but I inclined to think that is is related to the type of operating system set in the template. In the failing scenario it is 'Red Hat Enteprise Linux 7.x x64'. Can we ask the customer to change it, using the RHV GUI, to 'Linux' and then try again the provisioning?

Comment 7 Felix Dewaleyne 2017-03-02 14:02:16 UTC
(In reply to Juan Hernández from comment #6)
> I am not 100% yet, but I inclined to think that is is related to the type of
> operating system set in the template. In the failing scenario it is 'Red Hat
> Enteprise Linux 7.x x64'. Can we ask the customer to change it, using the
> RHV GUI, to 'Linux' and then try again the provisioning?

changing it didn't help. Customer is using for his test the official openstack image from us.

Comment 8 Juan Hernández 2017-03-02 14:57:09 UTC
OK. At this point I think that the problem is that in order to enable cloud-init it is necessary to have a customization template that takes the data from the provisiong form and puts it into a cloud-init file that RVH can understand. To do so the user needs to go to Compute -> Infrastructure -> PXE -> Customization templates. Yes, PXE, even if this isn't going to be used with PXE. There click the Configuration button and then the Add a New customization Template. Use "RHV cloud-init" for the name and description (for example), "CentOS-6" (for example) for the Image type and "CloudInit" for the Type. In the "Script" area type something like this:

  host_name: <%= evm[:hostname] %>
  user_name: root
  root_password: <%= MiqPassword.decrypt(evm[:root_password]) %>

Then, when deploying the virtual machine from the template make sure to use this "RHV cloud-init" customization template.

This will not configure all the details of the virtual machine, like the IP addresses, but will be useful to verify that things work correct. Please ask the user to try it, and to check that it sets the host name and password correctly.

I will update the bug later with more information on how to set the IP addresses.

Comment 9 Juan Hernández 2017-03-02 16:17:34 UTC
The configuration of the IP addresses depends on the guest operating system. Assuming that it is RHEL 7 and that NetworkManager is enabled in the template, it should be something like this:

# Configure basic host parameeters:
host_name: <%= evm[:hostname] %>
user_name: root
root_password: <%= MiqPassword.decrypt(evm[:root_password]) %>

# Run commands to configure the network using the NetworkManager command
# line tool:
runcmd:
- nmcli connection down eth0
- nmcli connection modify eth0
  ip4 <%= evm[:ip_addr] %>/<%= evm[:subnet_mask] %>
  gw4 <%= evm[:gateway] %>
  ipv4.dns "<%= evm[:dns_servers] %>"
  ipv4.dns-search "<%= evm[:dns_suffixes] %>"
- nmcli connection up eth0

Comment 10 Juan Hernández 2017-03-02 16:19:09 UTC
Note that the snippet in the previous comment assumes that in the GUI form the network mask has been written using the prefix notation: 24 instead of 255.255.255.0, for example.

Comment 11 Juan Hernández 2017-03-02 17:40:38 UTC
The proposed pull request to add the example customization script is here:

  Add oVirt cloud-init customization template
  https://github.com/ManageIQ/manageiq/pull/14139

Comment 12 Felix Dewaleyne 2017-03-03 13:03:03 UTC
the customer insists he isn't using PXE nor planning to - he mentioned the follwing :
"
When using RHVM  "New VM" button, in Initial Run tab,  Use Cloud-Init/SysPrep , all the configuration data given on this screen is passed to cloud-init via openstack formated cdrom image.  I am expecting CloudForms would pass the settings same way.

Could you please confirm that Cloudforms supports that kind of parameter pass to RHV ? "

from what I understood you still need to build the pxe script, right?

Comment 13 Juan Hernández 2017-03-03 13:15:32 UTC
CloudForms does not support that, unless you use a customization template, as described in comments 8 and 9.

The fact that the customization template is defined in the PXE menu doesn't mean that it is a "PXE script", or that they need to use PXE, it is just the place where customization templates are defined in the GUI.

Comment 14 Oved Ourfali 2017-03-07 13:02:09 UTC
Felix, please report back after the customer tries it out.

Comment 15 Juan Hernández 2017-03-07 13:50:51 UTC
The customer already replied that the problem is solved with the following alternative customization script:

---8<---
# Configure basic host parameeters:
host_name: <%= evm[:hostname] %>
user_name: root
root_password: <%= MiqPassword.decrypt(evm[:root_password]) %>
# network config
network-interfaces: |
  iface eth0 inet static
  address <%= evm[:ip_addr] %>
  netmask <%= evm[:subnet_mask] %>
  gateway <%= evm[:gateway] %>
# network restart
bootcmd:
  - ifdown eth0
  - ifup eth0
--->8---

That is, in my opinion, better than what I suggested in the pull request.

Felix, would be really nice if you can kindly ask the customer to send this as a pull request, similar to the one I proposed. If he doesn't want, or can't I'd like to ask him permission to copy his customization script.

Comment 16 Felix Dewaleyne 2017-03-07 15:01:07 UTC
forwarding the question...

Comment 17 Felix Dewaleyne 2017-03-09 11:33:17 UTC
we're allowed to copy it

Comment 19 Juan Hernández 2017-03-09 13:22:23 UTC
I tested the script suggested by the customer. I liked it more than the one I proposed, because it uses the declarative 'network-interfaces' style instead of calling the 'nmcli' command line tool. Unfortunately it doesn't work correctly if NetworkManager is enabled, which is the default in RHEL 7. I guess that the template used by the customer didn't have NetworkManager enabled. So I am sticking to the script that I proposed initially in the pull request.

Comment 22 Ilanit Stein 2017-05-09 11:08:31 UTC
This bug can't be verified on CFME-5.8.0.13, since without the fix for bug 1448231 RHV just ignores the payload.


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