Skip to content

vmware_drs_group_manager does not add or remove vm from vm group #2519

@Pedmu

Description

@Pedmu
SUMMARY

The module does not add an existing VM in an existing vm group
vmware_drs_group_info reports the VM as missing in the group

I have the same issue if I want to remove a vm from a group.
Meaning, it does nothing although the vm exists in the group

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_drs_group_manager

ANSIBLE VERSION
ansible [core 2.19.4]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.11 (main, Feb 10 2025, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-5)] (/usr/bin/python3.11)
  jinja version = 3.1.6
  pyyaml version = 6.0.2 (with libyaml v0.2.5)
COLLECTION VERSION
# /usr/local/lib/python3.11/site-packages/ansible_collections
Collection       Version
---------------- -------
community.vmware 5.10.0 

# /usr/share/ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.vmware 5.5.0  
CONFIGURATION
CONFIG_FILE() = None
OS / ENVIRONMENT

I'm running AWX 24.6.1 in minikube on Red Hat 9
The container is running on CentOS Stream 9

STEPS TO REPRODUCE

I have modified the latest AWX EE container. During container creation it does:
RUN yum update -y
RUN pip install ansible --upgrade

---
- name: ADD VMs to DRS group
  hosts: localhost
  gather_facts: false
  vars:
    vcenter_hostname: name
  tasks:
    - name: Add VM to group
      community.vmware.vmware_drs_group_manager:
        hostname: "{{ vcenter_hostname }}"
        password: "{{ vmware_password }}"
        username: "{{ vmware_username }}"
        validate_certs: false
        cluster: cluster_name
        datacenter: dc_name
        group_name: group_name
        vms:
          - vm_name
        state: present
EXPECTED RESULTS

It should add the vm in the vm_group

ACTUAL RESULTS

It does nothing and ends with the message:
"msg": "No update to vm group group_name"

TASK [Add VM to group] *********************************************************
task path: /runner/project/playbooks/drs_rules.yaml:8
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1762862798.0895607-21-209395147315608 `" && echo ansible-tmp-1762862798.0895607-21-209395147315608="` echo /root/.ansible/tmp/ansible-tmp-1762862798.0895607-21-209395147315608 `" ) && sleep 0'
Using module file /runner/requirements_collections/ansible_collections/community/vmware/plugins/modules/vmware_drs_group_manager.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-17oqxcek_l/tmpaqqokyel TO /root/.ansible/tmp/ansible-tmp-1762862798.0895607-21-209395147315608/AnsiballZ_vmware_drs_group_manager.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+rwx /root/.ansible/tmp/ansible-tmp-1762862798.0895607-21-209395147315608/ /root/.ansible/tmp/ansible-tmp-1762862798.0895607-21-209395147315608/AnsiballZ_vmware_drs_group_manager.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.11 /root/.ansible/tmp/ansible-tmp-1762862798.0895607-21-209395147315608/AnsiballZ_vmware_drs_group_manager.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1762862798.0895607-21-209395147315608/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => {
    "changed": false,
    "drs_group_member_info": {
        "***": [
            {
                "group_name": "***",
                "type": "vm",
                "vms": [
                    "***"
                ]
            }
        ]
    },
    "invocation": {
        "module_args": {
            "cluster": "***",
            "datacenter": "***",
            "group_name": "***",
            "hostname": "***",
            "hosts": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 443,
            "proxy_host": null,
            "proxy_port": null,
            "state": "present",
            "username": "***",
            "validate_certs": false,
            "vms": [
                "***"
            ]
        }
    },
    "msg": "No update to vm group ***"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions