ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
352 stars 336 forks source link

vmware_deploy_ovf - enableMPTSupport #158

Open Akasurde opened 4 years ago

Akasurde commented 4 years ago

From @ba31 on May 01, 2020 18:12

vmware_deploy_ovf fails with "msg": "Failure validating OVF import spec: Line 83: Unable to parse 'enableMPTSupport' for attribute 'key' on element 'Config'.. Line 115: Invalid value 'mgmt0' for element 'Connection'."
}

When I disable the "fail_on_spec_warnings" it does not fail although do not deploy any VM

ISSUE TYPE Bug Report

COMPONENT NAME vmware_deploy_ovf

ANSIBLE VERSION

ansible --version
ansible 2.9.7
  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.6/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]

OS / ENVIRONMENT vSphere 6.7.0.30000

pip3 show pyvmomi
Name: pyvmomi
Version: 7.0
Summary: VMware vSphere Python SDK
Home-page: https://github.com/vmware/pyvmomi
Author: VMware, Inc.
Author-email: jhu@vmware.com
License: License :: OSI Approved :: Apache Software License
Location: /usr/local/lib/python3.6/dist-packages
Requires: six, requests

 lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

STEPS TO REPRODUCE

---
- hosts: localhost
  become: no
  gather_facts: False
  vars:
  tasks:
  - name: Deploy VM
    vmware_deploy_ovf:
      hostname: x.x.x.x
      username: admin
      password: x.x.x.x.x
      validate_certs: no
      name: VMware-vIDM
      datacenter: iDM
      cluster: ESXi-Cluster
      datastore: IDMStore
      disk_provisioning: thin
      networks: 
        "Network 1": "VM Network"
      ova: aci-se-dk9.1.1.2i.ova
      allow_duplicates: no
      power_on: yes
      fail_on_spec_warnings: no
      wait: yes
      wait_for_ip_address: yes
      inject_ovf_env: yes
      properties:
        com.cisco.acisn.adminPassword: "x.x.x.x.x"
        com.cisco.acisn.app_nw_ip: "1.1.0.0/16"
        com.cisco.acisn.clusterNumMasters: "3"
        com.cisco.acisn.domainname: "education.com"
        com.cisco.acisn.firstMaster: "True"
        com.cisco.acisn.gw_ip: "15.15.15.1"
        com.cisco.acisn.ip_sn_list: "15.15.15.4 CiscoSN02 15.15.15.6 CiscoSN03"
        com.cisco.acisn.mgmt_ip: "15.15.15.14/24"
        com.cisco.acisn.nodeID: "1"
        com.cisco.acisn.nodeSerialNum: "CiscoSN01"
        com.cisco.acisn.nodename: "CiscoSN01"
        com.cisco.acisn.nsiplist: "15.15.15.7"
        com.cisco.acisn.ntpiplist: "15.15.15.8"
        com.cisco.acisn.passphrase: "x.x.x.x.x"
        com.cisco.acisn.searchlist: "education.com"
        com.cisco.acisn.svc_nw_ip: "2.2.0.0/16"
    delegate_to: localhost

ACTUAL RESULTS

ansible-playbook msc.yml -vvvvvvv
ansible-playbook 2.9.7
  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.6/dist-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.6/dist-packages/ansible/plugins/callback/default.py

PLAYBOOK: msc.yml *************************************************************************************************************************************************
Positional arguments: msc.yml
verbosity: 7
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in msc.yml

PLAY [localhost] **************************************************************************************************************************************************
META: ran handlers

TASK [Deploy VM] **************************************************************************************************************************************************
task path: /root/vCenter/msc.yml:7
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir /root/.ansible/tmp/ansible-tmp-1588354768.8335423-18424-203164248673922 && echo ansible-tmp-1588354768.8335423-18424-203164248673922="` echo /root/.ansible/tmp/ansible-tmp-1588354768.8335423-18424-203164248673922 `" ) && sleep 0'
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/vmware.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/_text.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/six/__init__.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/basic.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/urls.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/_collections_compat.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/__init__.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/_utils.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/file.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/text/formatters.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/sys_info.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/validation.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/parameters.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/parsing/convert_bool.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/text/converters.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/_json_compat.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/parsing/__init__.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/pycompat24.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/text/__init__.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/process.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/distro/__init__.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/distro/_distro.py
Using module_utils file /usr/local/lib/python3.6/dist-packages/ansible/module_utils/common/collections.py
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/cloud/vmware/vmware_deploy_ovf.py
<localhost> PUT /root/.ansible/tmp/ansible-local-1841160gpmvyg/tmpu2k2jql4 TO /root/.ansible/tmp/ansible-tmp-1588354768.8335423-18424-203164248673922/AnsiballZ_vmware_deploy_ovf.py
<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1588354768.8335423-18424-203164248673922/ /root/.ansible/tmp/ansible-tmp-1588354768.8335423-18424-203164248673922/AnsiballZ_vmware_deploy_ovf.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1588354768.8335423-18424-203164248673922/AnsiballZ_vmware_deploy_ovf.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1588354768.8335423-18424-203164248673922/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost -> localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_duplicates": false,
            "cluster": "ESXi-Cluster",
            "datacenter": "iDM",
            "datastore": "IDMStore",
            "deployment_option": null,
            "disk_provisioning": "thin",
            "fail_on_spec_warnings": true,
            "folder": null,
            "hostname": "15.15.15.21",
            "inject_ovf_env": true,
            "name": "VMware-vIDM",
            "networks": {
                "Network 1": "VM Network"
            },
            "ova": "aci-se-dk9.1.1.2i.ova",
            "ovf": "aci-se-dk9.1.1.2i.ova",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 443,
            "power_on": true,
            "properties": {
                "com.cisco.acisn.adminPassword": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "com.cisco.acisn.app_nw_ip": "1.1.0.0/16",
                "com.cisco.acisn.clusterNumMasters": "3",
                "com.cisco.acisn.domainname": "education.com",
                "com.cisco.acisn.firstMaster": "True",
                "com.cisco.acisn.gw_ip": "15.15.15.1",
                "com.cisco.acisn.ip_sn_list": "15.15.15.4 CiscoSN02 15.15.15.6 CiscoSN03",
                "com.cisco.acisn.mgmt_ip": "15.15.15.14/24",
                "com.cisco.acisn.nodeID": "1",
                "com.cisco.acisn.nodeSerialNum": "CiscoSN01",
                "com.cisco.acisn.nodename": "CiscoSN01",
                "com.cisco.acisn.nsiplist": "15.15.15.7",
                "com.cisco.acisn.ntpiplist": "15.15.15.8",
                "com.cisco.acisn.passphrase": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                "com.cisco.acisn.searchlist": "education.com",
                "com.cisco.acisn.svc_nw_ip": "2.2.0.0/16"
            },
            "proxy_host": null,
            "proxy_port": null,
            "resource_pool": "Resources",
            "username": "admin",
            "validate_certs": false,
            "wait": true,
            "wait_for_ip_address": true
        }
    },
    "msg": "Failure validating OVF import spec: Line 83: Unable to parse 'enableMPTSupport' for attribute 'key' on element 'Config'.. Line 115: Invalid value 'mgmt0' for element 'Connection'."
}

PLAY RECAP ********************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Copied from original issue: ansible/ansible#69281

ansibullbot commented 4 years ago

Files identified in the description:

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

ansibullbot commented 4 years ago

cc @Tomorrow9 @goneri @lparkes @pgbidkar @warthog9 click here for bot help

Akasurde commented 3 years ago

@ba31 Are you still facing this issue? Thanks.

needs_info

shivak-sudo commented 3 years ago

Hi Team, Do we have any fix/work around for the above issue. i m able to recreate it now.

"msg": "Failure validating OVF import spec: Line 76: Unable to parse 'enableMPTSupport' for attribute 'key' on element 'Config'."

FYR, Below is my ansible version.

ansible [core 2.11.1] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/blr/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible ansible collection location = /home/blr/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.8.6 (default, Oct 6 2020, 04:02:53) [GCC 5.4.0 20160609] jinja version = 2.11.2 libyaml = False

Any inputs are highly appreciated.

Thanks Shiva

ansibullbot commented 3 years ago

@Akasurde This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

domq commented 1 year ago

So, the enableMPTSupport thing could be a red herring as far as the red result is concerned.

Indeed, I am getting the same warning out of a working (yellow status) community.vmware.vmware_deploy_ovf upon register:ing it, then dumping its status with a subsequent debug task.

Ansible core 2.13.11, Mac OS X 13.4.1 (c) (22F770820d), Intel i7, community.vmware 2.8.0

kash1983 commented 3 months ago

enableMPTSupport quite exists.. any workarounds to get around?

ihumster commented 3 months ago

enableMPTSupport option is part of OVA/OVF spec and part of spec VM from VirtualVideoCard section, and warning can be ignored. VM must me deployed with last version of module.