ansible / ansible-modules-extras

Ansible extra modules - these modules ship with ansible
947 stars 1.47k forks source link

Ovirt_vms module to support custom VM UUID #3723

Closed mkrish004c closed 6 years ago

mkrish004c commented 6 years ago

RHEV 4.0 is allowed to create a VM with Custom UUID via administrator GUI. RHEV4.0_vm_guide

The Ansible ovirt_vms module does not support this feature, it uses 'id' field only to manage already created VMs.

sample task like,

    - name: Creating a new VM
      ovirt_vms:
        auth: "{{ ovirt_auth }}"
        id: "365b9f2f-d92b-4131-8e4f-6403d0b1e356"
        state: stopped
        cluster: "RHV-C1"
        name: "test-uuid-2"

Expected result - VM will be created with the ID mentioned in the task

Actual result -

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_WxFdz_/ansible_module_ovirt_vms.py", line 1037, in main
    wait_condition=vms_module.wait_for_down,
  File "/tmp/ansible_WxFdz_/ansible_modlib.zip/ansible/module_utils/ovirt.py", line 706, in action
    entity = pre_action(entity)
  File "/tmp/ansible_WxFdz_/ansible_module_ovirt_vms.py", line 603, in _pre_shutdown_action
    vm_service = self._service.vm_service(entity.id)
AttributeError: 'NoneType' object has no attribute 'id'
ansibot commented 6 years ago

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide.