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

vmware_guest_video: gather_video_facts with powered on guest #408

Closed
johansenha opened this issue Sep 28, 2020 · 3 comments · Fixed by #411
Closed

vmware_guest_video: gather_video_facts with powered on guest #408

johansenha opened this issue Sep 28, 2020 · 3 comments · Fixed by #411
Assignees
Labels
bug This issue/PR relates to a bug has_pr verified This issue has been verified/reproduced by maintainer

Comments

@johansenha
Copy link

johansenha commented Sep 28, 2020

SUMMARY

gather_video_facts is only possible with powered off guest vm but should be possible with powered on machine as well and only changes to video settings should required powered off VM

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_guest_video

ANSIBLE VERSION

2.9.13

OS / ENVIRONMENT

vSphere 7.0

STEPS TO REPRODUCE

ansible playbook

- hosts: localhost
  vars:
    selected_group: "test"
    vm_video_memory: "128"
  tasks:
    - name: Increase graphic memory
      include_role:
        name: vm
        tasks_from: increase_video_memory
      vars:
        machine: "{{ item }}"
      loop: "{{ groups[selected_group] }}"

task:

- name: "Check video settings of {{ item }}"
  vmware_guest_video:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    datacenter: "{{ vcenter_datacenter }}"
    name: "{{ item }}"
    gather_video_facts: true
  delegate_to: localhost
  register: video_facts
ACTUAL RESULTS
fatal: [localhost]: FAILED! => {"changed": false, "msg": "VM state should be poweredoff to reconfigure video card settings."}
EXPECTED RESULTS

Usually I would expect that I can gather video facts as long as guest is running, or is there any other way to check video settings without using vmware_guest_video module?

@johansenha
Copy link
Author

Possible solution might be changing vmware_guest_video.py

line 356 from:

if vm_power_state != 'poweredoff':

to:

if vm_facts == "" and vm_power_state != 'poweredoff':

Akasurde added a commit to Akasurde/community.vmware that referenced this issue Sep 29, 2020
Facts about video devices can be gathered for poweredoff VM.

Fixes: ansible-collections#408

Signed-off-by: Abhijeet Kasurde <[email protected]>
@Akasurde
Copy link
Member

@johansenha Thanks for reporting this issue. Could you please check if PR #411 resolves your issue?

Thanks.

needs_info

@Akasurde Akasurde self-assigned this Sep 29, 2020
@Akasurde Akasurde added bug This issue/PR relates to a bug has_pr verified This issue has been verified/reproduced by maintainer labels Sep 29, 2020
@johansenha
Copy link
Author

@Akasurde Thanks for the quick fix. Patched my local file and response looks fine. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr verified This issue has been verified/reproduced by maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants