Description of problem:cfme not passing cloud init payload to vm's Version-Release number of selected component (if applicable):5.8.0.13 How reproducible:100% Steps to Reproduce: 1.provision appliance 2.add cloud init script to infra-PXE-customization templates 3.add rhevm provider 4.provision new vm with cloud init script Actual results:script does not run on startup of vm Expected results:script runs successfully Additional info: script I used: #cloud-config write_files: - path: /tmp/test.txt content: | Here is a line. I ran this against a cfme build on rhevm provider which failed, running this against the same template directly on rhevm works as expected. This last worked on 5.8.0.11
This might be related to bug 1427603.
I checked this again with the latest version of the 'fine' branch and in my opinion it works correctly. Can you please check the following in RHV? 1. Make sure that the template uses has the value Linux (or some variant of Linux) in the General -> Operating System field. 2. Make sure that the template has Initial Run -> Use Cloud-Init/Sysprep checked. 3. Start the VM from CFME, and when it is running in RHV, edit it and check that your custom script appears in Initial Run -> Custom Script. 4. Go to the RHV hypervisor where the VM is running (with SSH) and find the corresponding qemu-kvm process: ps -ef | grep qemu-kvm | grep the_name_of_the_vm That long command line should contain an option pointing to the 'payload', something like this: -drive file=/var/run/vdsm/payload/ae3a9cd4-....img Copy that .img file somewhere, and then mount it: # mount -o loop,ro that_file.img /mnt Then explore the content: # find /mnt -type f /mnt/openstack/content/0000 /mnt/openstack/latest/meta_data.json /mnt/openstack/latest/user_data The 'openstack/latest/user_data' file should contain the cloud-init ocnfiguration that CFME sent to RHV. Does it look correct? Does it contain your custom script? We also need to know the version of RHV that you are using.
After studying this with more detail I realized that the payload is correctly passed from CFME to RHV, but then CFME starts the virtual machine without the 'use_cloud_init' parameter. That means that the payload won't actually be used by RHV, even if it is there. I can confirm that this is a regression introduced by the recent changes in the fine branch to implement provisioning with versions 3 or 4 of the RHV API. The proposed pull request to fix this issue is the following: Handle blocks when using `method_missing` https://github.com/ManageIQ/manageiq-providers-ovirt/pull/30 The provider has been separated to a new git repository right after the creation of the 'fine' branch, so an explicit backport will be needed for that branch. This is the pull request: [FINE] Handle blocks when using `method_missing` in oVirt https://github.com/ManageIQ/manageiq/pull/15021
Verified on CFME-5.9.0.12/RHV-4.1.8. * Template for provision: using CFME-5.9.0.11 Template (OS type:RHEL-7), cloud-init 0.7.9. * Customization Template: Using CFME: Compute->Infrastructure->PXE: Customization Template (Image Type: RHEL-6, Type:CloudInit), with content: write_files: - path: "/tmp/test.txt" content: Here is a line. Test flow: On CFME, run VM provision from Template (CFME-5.9.0.11), Native, in the Customize tab choose the above customization template. Test results: Script was passed to RHV side: In Edit VM dialog: Use cloud init option is checked, and custom script contain the above Customization Template content. Also File /tmp/test.txt was created, with: "Here is a line." content.