Skip to content
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

[Bug] Ansible reports success when power-off fails in module nutanix.ncp.ntnx_vms #439

Open
thewelshvader opened this issue Nov 20, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@thewelshvader
Copy link

Using the nutanix.ncp.ntnx_vms module to power-off a VM, the ansible output reports a success, even when an error occurs.
VMs are not always powered down correctly, but ansible always produces the same successful output.

Screenshot 2023-11-20 at 11 05 58

The underlying error can be seen in the Prism Central UI and the verbose ansible log as per below.

{
"changed": true,
"error": null,
"response": {
"status": {
"name": "m8",
"state": "ERROR",
"execution_context": {
"task_uuid": [
"37d3e6d
-
****-0489"
]
},

To Reproduce
Steps to reproduce the behavior:
Sample from ansible role:

---
# tasks file for prism-vm-soft-shutdown
- name: "Shutdown Guest OS"
  nutanix.ncp.ntnx_vms:
    nutanix_host: "{{ nutanix_url }}"
    nutanix_username: '{{ nutanix_username }}'
    nutanix_password: '{{ nutanix_password }}'
    vm_uuid: "{{ vm_uuid }}"
    state: soft_shutdown
  register: shutdown_result
  delegate_to: localhost

Expected behavior
When an error is returned by the Prism Central UI, ansible should fail the task instead of reporting successful.

Additional context
Nutanix support confirmed that an AOS update may be needed to resolve the power-off issue.
The issue here is that our ansible playbooks are always marking the task as Successful, even when we can clearly see an error in the API response and in the Prism Central UI.

@thewelshvader thewelshvader added the bug Something isn't working label Nov 20, 2023
@bhati-pradeep bhati-pradeep added this to ToDo in 2.0 Dec 10, 2023
@bhati-pradeep bhati-pradeep moved this from ToDo to In Review in 2.0 Dec 10, 2023
@bhati-pradeep bhati-pradeep moved this from In Review to Release ready in 2.0 Dec 10, 2023
@bhati-pradeep bhati-pradeep removed this from Release ready in 2.0 Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants