-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ovirt_vms does not proceed cloud-init when state is running. Manual start works #45900
Comments
Files identified in the description: If these files are inaccurate, please update the |
I had the same issue.
|
+label ovirt |
!component =lib/ansible/modules/cloud/ovirt/ovirt_vm.py |
Files identified in the description: If these files are inaccurate, please update the |
Right, that's because of |
Using the graphical user interface (I'm using RHV 4.2), one can configure the cloud-init parameters via the "Edit" -> "Initial Run" menu and run the virtual machine ("run", not "run once"). In this case, the cloud-init parameters are used and the VM will be configured correctly after booting. This looks similar to configuring the cloud_init parameter and setting cloud_init_persist to True in your Ansible playbook. However, with Ansible the behaviour is different than manual. The cloud-init parameters are not used and the VM will not be configured after boot. I think the Ansible way should reflect the manual way and in both cases the cloud_init settings should be used (why would you want to configure cloud-init, but not use it?). Nevertheless, if this is the design intention, the ovirt_vm Ansible doc should state that the cloud_init parameters will never be used when setting cloud_init_persist=true. Also, the default values should be added to the docs. |
It should works exactly as you described, same as in UI. Let me investigate why this happens, I will send fix as soon as possible. |
Fixes: ansible#45900 This PR fixes the case when the cloud_init_persist was used, but we still sent use_cloud_init=False, which is in oVirt API evaluated as not to use cloud_init in first VM execution. This patch is changing it to send just None, instead of False. Signed-off-by: Ondra Machacek <omachace@redhat.com>
So this was issue in oVirt reported here, fix will be part of 4.2.7 release: https://bugzilla.redhat.com/show_bug.cgi?id=1593239 But also in Ansible fixed here, fix will be part of 2.7.1: |
Fixes: #45900 This PR fixes the case when the cloud_init_persist was used, but we still sent use_cloud_init=False, which is in oVirt API evaluated as not to use cloud_init in first VM execution. This patch is changing it to send just None, instead of False. Signed-off-by: Ondra Machacek <omachace@redhat.com>
Fixes: ansible#45900 This PR fixes the case when the cloud_init_persist was used, but we still sent use_cloud_init=False, which is in oVirt API evaluated as not to use cloud_init in first VM execution. This patch is changing it to send just None, instead of False. Signed-off-by: Ondra Machacek <omachace@redhat.com>
Fixes: #45900 This PR fixes the case when the cloud_init_persist was used, but we still sent use_cloud_init=False, which is in oVirt API evaluated as not to use cloud_init in first VM execution. This patch is changing it to send just None, instead of False. Signed-off-by: Ondra Machacek <omachace@redhat.com>
This issue seems not to be solved with #47348; use_cloud_init is still sent as False if cloud_init_persist is set to True. The negation seems to be the culprit here. use_cloud_init=True if not module.params.get('cloud_init_persist') and module.params.get('cloud_init') is not None else None, to use_cloud_init=True if module.params.get('cloud_init_persist') and module.params.get('cloud_init') is not None else None, |
Fixes: ansible#45900 This PR fixes the case when the cloud_init_persist was used, but we still sent use_cloud_init=False, which is in oVirt API evaluated as not to use cloud_init in first VM execution. This patch is changing it to send just None, instead of False. Signed-off-by: Ondra Machacek <omachace@redhat.com>
SUMMARY
When I create a VM with cloud-init parameters, the cloud init is executed only if I start the VM manually:
In this example, if I set "state: running", the cloud-init part is not executed. I must set "state: present" and start the VM manually in the RHEV console.
ISSUE TYPE
COMPONENT NAME
ovirt_vms
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
In this case, "state" must be "present" ans the VM must be started manually unless cloud-config will not be applied and the VM will not be accessible...
EXPECTED RESULTS
The cloud-config settings should be applied when state is "running"
ACTUAL RESULTS
The vm is started with no cloud-init settings. Even the hostname is not set.
The text was updated successfully, but these errors were encountered: