community.vmware icon indicating copy to clipboard operation
community.vmware copied to clipboard

Failed to create a virtual machine : A specified parameter was not correct: nicsettings:adapter:ip

Open theirpuppet opened this issue 4 years ago • 9 comments

SUMMARY

With VMware Customization Spec Network/NIC1 set to 'Prompt User', this error message appears and the build process fails.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_guest

ANSIBLE VERSION
$ ansible --version
ansible 2.9.16
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/[email protected]/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /bin/ansible
  python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
CONFIGURATION
$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/hosts']
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/etc/ansible/roles']
OS / ENVIRONMENT
$ cat /etc/redhat-release 
CentOS Linux release 8.3.2011
$ rpm -qf /usr/lib/python3.6/site-packages/ansible/modules/cloud/vmware/vmware_local_role_info.py
ansible-2.9.16-1.el8.noarch

VMware ESXi, 6.7.0 vCenter Server 6.7.0

STEPS TO REPRODUCE

Customization Spec - Network set to Custom / NIC1 set to IPv4 = Prompt User, IPv6 = Not used

fatal: [drtest]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "annotation": null,
            "cdrom": [],
            "cluster": "XXX-REMOVED",
            "convert": null,
            "customization": {
                "dns_servers": [
                    "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
                    "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
                ],
                "hostname": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"
            },
            "customization_spec": "CentOS_7",
            "customvalues": [],
            "datacenter": "XXX-REMOVED",
            "datastore": "XXX-REMOVED",
            "disk": [],
            "esxi_hostname": null,
            "folder": "EMS-LD8/vm/",
            "force": false,
            "guest_id": null,
            "hardware": {
                "boot_firmware": "BIOS",
                "hotadd_cpu": "HotAddCPU",
                "hotadd_memory": "HotAddRAM",
                "hotremove_cpu": "HotRemoveCPU",
                "memory_mb": 1024,
                "num_cpu_cores_per_socket": 1,
                "num_cpus": 1
            },
            "hostname": "XXX-REMOVED",
            "is_template": false,
            "linked_clone": false,
            "name": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "name_match": "first",
            "networks": [
                {
                    "connected": true,
                    "device_type": "vmxnet3",
                    "gateway": "10.1.1.1",
                    "ip": "10.1.1.203",
                    "name": "XXX-REMOVED",
                    "netmask": "255.255.255.0",
                    "start_connected": true,
                    "type": "static"
                }
            ],
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 443,
            "proxy_host": null,
            "proxy_port": null,
            "resource_pool": null,
            "snapshot_src": null,
            "state": "poweredon",
            "state_change_timeout": 0,
            "template": "CENTOS7-TMPL-LD8",
            "use_instance_uuid": false,
            "username": "XXX-REMOVED",
            "uuid": null,
            "validate_certs": false,
            "vapp_properties": [],
            "wait_for_customization": true,
            "wait_for_ip_address": true
        }
    },
    "msg": "Failed to create a virtual machine : A specified parameter was not correct: nicsettings:adapter:ip"
}

EXPECTED RESULTS

VM to be deployed, VMware Guest OS Customisation to proceed and configure the networking as set in the ansible playbook.

ACTUAL RESULTS

See above.

See above.

theirpuppet avatar Jan 07 '21 12:01 theirpuppet

https://gist.github.com/theirpuppet/3395d4987c8f125a33522050c7765cdc

theirpuppet avatar Jan 07 '21 13:01 theirpuppet

I get the same result in two different vSphere environments. Both, however, have the same version / configuration of ansible.

Environment A: vCenter Server: 7.0.1, 17327586 ESXi: 7.0.1, 17168206

Environment B: vCenter Server: 6.7.0, 16046713 ESXi, 6.7.0, 14320388

theirpuppet avatar Jan 08 '21 14:01 theirpuppet

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

ansibullbot avatar Jan 15 '21 16:01 ansibullbot

try this fix: https://github.com/ansible/ansible/pull/61329

jsonp80 avatar May 07 '21 22:05 jsonp80

try this fix: ansible/ansible#61329

Was unfortunately never completed nor merged, I created a new PR https://github.com/ansible-collections/community.vmware/pull/1252 based on the approach described in https://github.com/ansible/ansible/pull/61329 with some adjustments. First deployments in my Environment were successful but further testing necessary.

wombelix avatar Mar 12 '22 00:03 wombelix

@theirpuppet @wombelix ansible 2.9 is quite old and the VMware modules are pretty outdated. Do you use them, or did you install this collection via galaxy? If so, what version of community.vmware do you run?

If you use the VMware modules that come with 2.9, could you please test if you run into the same issue with Ansible 5 or 2.9 plus a current version of this collection?

mariolenz avatar Mar 12 '22 15:03 mariolenz

ansible 2.9 is quite old and the VMware modules are pretty outdated. Do you use them, or did you install this collection via galaxy? If so, what version of community.vmware do you run?

Agree but unfortunately I have to use 2.9 a little longer until we finished the migration from AWX 15 to latest.

If you use the VMware modules that come with 2.9, could you please test if you run into the same issue with Ansible 5 or 2.9 plus a current version of this collection?

I tried the ansible 2.9 vmware module first but using the community module now, both behave identical in regards to customization_specs. I provided more details as response in the PR: https://github.com/ansible-collections/community.vmware/pull/1252#discussion_r825348451

ansible: 2.9.27 community.vmware: 2.1.0

wombelix avatar Mar 12 '22 20:03 wombelix

I tried the ansible 2.9 vmware module first but using the community module now, both behave identical in regards to customization_specs. I provided more details as response in the PR: #1252 (comment)

ansible: 2.9.27 community.vmware: 2.1.0

Thanks for the clarification!

mariolenz avatar Mar 13 '22 16:03 mariolenz