ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
349 stars 338 forks source link

Can not unmount CDROMs from vm community.vmware.vmware_guest #1012

Open offlinejke opened 3 years ago

offlinejke commented 3 years ago
SUMMARY

I try to eject CDROMs from vm. Observing the rules, I turn off the vm, disconnect the CDROMs and turn on the vm. I even pause between tasks to be sure. The CDROMs are not detached.

ISSUE TYPE
COMPONENT NAME

community.vmware.vmware_guest

ANSIBLE VERSION
ansible [core 2.11.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.5/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.5.3 (default, Apr  5 2021, 09:00:41) [GCC 6.3.0 20170516]
  jinja version = 2.11.3
  libyaml = False
COLLECTION VERSION
CONFIGURATION
# /root/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.vmware 1.13.0

# /usr/local/lib/python3.5/dist-packages/ansible_collections
Collection       Version
---------------- -------
community.vmware 1.12.0
OS / ENVIRONMENT

Distributor ID: Debian Description: Debian GNU/Linux 9.13 (stretch) Release: 9.13 Codename: stretch

STEPS TO REPRODUCE
- name: Unattach the ISO mount from the VM
  community.vmware.vmware_guest:
    hostname: "{{ vcenter_hostname }}"
    username: "{{ vcenter_username }}"
    password: "{{ vcenter_password }}"
    validate_certs: no
    datacenter: "{{ Datacenter }}"
    folder: ESXI9
    name: '{{ vm_name }}'
    state: powered-off
    guest_id: windows9Server64Guest
    esxi_hostname: "{{ esxi_hostname }}"
    force: yes
    cdrom:
      - controller_number: 0
        unit_number: 0
        state: absent
        type: none
      - controller_number: 0
        unit_number: 1
        state: absent
        type: none
  delegate_to: localhost
EXPECTED RESULTS
Expected to see unmounted DCROMs
ACTUAL RESULTS
ok: [localhost -> localhost] => {
    "changed": false,
    "instance": {
        "advanced_settings": {
            "disk.EnableUUID": "TRUE",
            "ethernet0.pciSlotNumber": "32",
            "guestOS.detailed.data": "architecture='X86' bitness='64' buildNumber='17763' distroName='Windows' distroVersion='10.0' familyName='Windows' kernelVersion='17763.1' prettyName='Windows Server 2019, 64-bit (Build 17763.1)'",
            "hpet0.present": "TRUE",
            "migrate.hostLog": "test_vm_009-633b51ff.hlog",
            "migrate.hostLogState": "none",
            "migrate.migrationId": "0",
            "monitor.phys_bits_used": "43",
            "numa.autosize.cookie": "40001",
            "numa.autosize.vcpu.maxPerVirtualNode": "4",
            "nvram": "test_vm_009.nvram",
            "pciBridge0.pciSlotNumber": "17",
            "pciBridge0.present": "TRUE",
            "pciBridge4.functions": "8",
            "pciBridge4.pciSlotNumber": "21",
            "pciBridge4.present": "TRUE",
            "pciBridge4.virtualDev": "pcieRootPort",
            "pciBridge5.functions": "8",
            "pciBridge5.pciSlotNumber": "22",
            "pciBridge5.present": "TRUE",
            "pciBridge5.virtualDev": "pcieRootPort",
            "pciBridge6.functions": "8",
            "pciBridge6.pciSlotNumber": "23",
            "pciBridge6.present": "TRUE",
            "pciBridge6.virtualDev": "pcieRootPort",
            "pciBridge7.functions": "8",
            "pciBridge7.pciSlotNumber": "24",
            "pciBridge7.present": "TRUE",
            "pciBridge7.virtualDev": "pcieRootPort",
            "sata0.pciSlotNumber": "34",
            "sata0:0.redo": "",
            "sched.swap.derivedName": "/vmfs/volumes/61166fd7-f620b9d4-4dd0-00d861bc0d7c/test_vm_009/test_vm_009-4eb13361.vswp",
            "softPowerOff": "FALSE",
            "svga.guestBackedPrimaryAware": "TRUE",
            "svga.present": "TRUE",
            "tools.remindInstall": "TRUE",
            "vm.genid": "-4159262498542149455",
            "vm.genidX": "7321942384159952681",
            "vmci0.pciSlotNumber": "33",
            "vmotion.checkpointFBSize": "4194304",
            "vmotion.checkpointSVGAPrimarySize": "134217728",
            "vmware.tools.internalversion": "11360",
            "vmware.tools.requiredversion": "11297"
        },
        "annotation": "",
        "current_snapshot": null,
        "customvalues": {},
        "guest_consolidation_needed": false,
        "guest_question": null,
        "guest_tools_status": "guestToolsNotRunning",
        "guest_tools_version": "11360",
        "hw_cluster": null,
        "hw_cores_per_socket": 1,
        "hw_datastores": [
            "DS9-1-NVME"
        ],
        "hw_esxi_host": "esxi9.vsphere.local",
        "hw_eth0": {
            "addresstype": "assigned",
            "ipaddresses": null,
            "label": "Network adapter 1",
            "macaddress": "00:50:56:ba:d9:71",
            "macaddress_dash": "00-50-56-ba-d9-71",
            "portgroup_key": null,
            "portgroup_portkey": null,
            "summary": "VM Network"
        },
        "hw_files": [
            "[DS9-1-NVME] test_vm_009/test_vm_009.vmx",
            "[DS9-1-NVME] test_vm_009/test_vm_009.vmxf",
            "[DS9-1-NVME] test_vm_009/test_vm_009.nvram",
            "[DS9-1-NVME] test_vm_009/test_vm_009.vmsd",
            "[DS9-1-NVME] test_vm_009/vmware-23.log",
            "[DS9-1-NVME] test_vm_009/vmware-22.log",
            "[DS9-1-NVME] test_vm_009/vmware-21.log",
            "[DS9-1-NVME] test_vm_009/vmware-20.log",
            "[DS9-1-NVME] test_vm_009/vmware.log",
            "[DS9-1-NVME] test_vm_009/vmware-19.log",
            "[DS9-1-NVME] test_vm_009/vmware-18.log",
            "[DS9-1-NVME] test_vm_009/test_vm_009.vmdk"
        ],
        "hw_folder": "/datacenter/vm/ESXI9",
        "hw_guest_full_name": null,
        "hw_guest_ha_state": null,
        "hw_guest_id": null,
        "hw_interfaces": [
            "eth0"
        ],
        "hw_is_template": false,
        "hw_memtotal_mb": 4096,
        "hw_name": "test_vm_009",
        "hw_power_status": "poweredOff",
        "hw_processor_count": 4,
        "hw_product_uuid": "423a6f16-c258-f700-30c7-3d58e04345cf",
        "hw_version": "vmx-14",
        "instance_uuid": "503a5de4-ffb3-284b-7581-9021d6e53eef",
        "ipv4": null,
        "ipv6": null,
        "module_hw": true,
        "moid": "vm-7512",
        "snapshots": [],
        "vimref": "vim.VirtualMachine:vm-7512",
        "vnc": {}
    },
    "invocation": {
        "module_args": {
            "advanced_settings": [],
            "annotation": null,
            "cdrom": [
                {
                    "controller_number": 0,
                    "state": "absent",
                    "type": "none",
                    "unit_number": 0
                },
                {
                    "controller_number": 0,
                    "state": "absent",
                    "type": "none",
                    "unit_number": 1
                }
            ],
            "cluster": null,
            "convert": null,
            "customization": {
                "autologon": null,
                "autologoncount": null,
                "dns_servers": null,
                "dns_suffix": null,
                "domain": null,
                "domainadmin": null,
                "domainadminpassword": null,
                "existing_vm": null,
                "fullname": null,
                "hostname": null,
                "hwclockUTC": null,
                "joindomain": null,
                "joinworkgroup": null,
                "orgname": null,
                "password": null,
                "productid": null,
                "runonce": null,
                "timezone": null
            },
            "customization_spec": null,
            "customvalues": [],
            "datacenter": "datacenter",
            "datastore": null,
            "delete_from_inventory": false,
            "disk": [],
            "esxi_hostname": null,
            "folder": "ESXI9",
            "force": true,
            "guest_id": "windows9Server64Guest",
            "hardware": {
                "boot_firmware": null,
                "cpu_limit": null,
                "cpu_reservation": null,
                "hotadd_cpu": null,
                "hotadd_memory": null,
                "hotremove_cpu": null,
                "iommu": null,
                "max_connections": null,
                "mem_limit": null,
                "mem_reservation": null,
                "memory_mb": null,
                "memory_reservation_lock": null,
                "nested_virt": null,
                "num_cpu_cores_per_socket": null,
                "num_cpus": null,
                "scsi": null,
                "secure_boot": null,
                "version": null,
                "virt_based_security": null
            },
            "hostname": "admin@vsphere.local",
            "is_template": false,
            "linked_clone": false,
            "name": "test_vm_009",
            "name_match": "first",
            "networks": [],
            "nvdimm": {
                "label": null,
                "size_mb": 1024,
                "state": null
            },
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 443,
            "proxy_host": null,
            "proxy_port": null,
            "resource_pool": null,
            "snapshot_src": null,
            "state": "powered-off",
            "state_change_timeout": 0,
            "template": null,
            "use_instance_uuid": false,
            "username": "admin@vsphere.local",
            "uuid": null,
            "validate_certs": false,
            "vapp_properties": [],
            "wait_for_customization": false,
            "wait_for_customization_timeout": 3600,
            "wait_for_ip_address": false,
            "wait_for_ip_address_timeout": 300
        }
    }
}
ansibullbot commented 3 years ago

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

offlinejke commented 3 years ago

What should i do?