ansible-collections / community.vmware

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

Cannot deploy OVA that has VM connected to a portgroup that is on a VDS #175

Open tezzigator opened 4 years ago

tezzigator commented 4 years ago
SUMMARY

For a playbook, instead of connecting the VMs nic to my VMWare VDS-based DPG that is named CUST-302, my VM's nic gets connected to a different (non-VDS) VMWare network that is called SHARED

ISSUE TYPE
COMPONENT NAME

vmware_deploy_ovf

ANSIBLE VERSION
  config file = None
  configured module search path = ['/home/REDACTED/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/REDACTED/REDACTEDpy/.venv/lib64/python3.6/site-packages/ansible
  executable location = /home/REDACTED/REDACTED/.venv/bin/ansible
  python version = 3.6.8 (default, Sep 26 2019, 11:57:09) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
CONFIGURATION
$ansible-config dump --only-changed
$ 
OS / ENVIRONMENT

$ uname -a Linux wat-utl-jmp 3.10.0-1127.el7.x86_64 #1 SMP Tue Feb 18 16:39:12 EST 2020 x86_64 x86_64 x86_64 GNU/Linux $

STEPS TO REPRODUCE

generic deploy playbook

- hosts: localhost
  gather_facts: no

  tasks:
  - name: Deploy OVA
    vmware_deploy_ovf:
      allow_duplicates: false
      validate_certs: no
      folder: '/{{ datacenter_name}}/vm/{{ parent_folder }}/{{ prefixid }}'
      name: '{{ guesthostname }}'
      hostname: '{{ vcenter_hostname }}'
      port: 443
      username: '{{ vcenter_username }}'
      password: '{{ vcenter_password }}'
      datacenter: '{{ datacenter_name }}'
      datastore: '{{ datastore }}'
      cluster: DC6-C4
      networks:  "{u'Network Adapter 1':u'CUST-302'}"
      power_on: yes
      ova: '/home/REDACTED/REDACTED/{{ ova }}'
      disk_provisioning: thin
      properties:
        DeploymentOption.value: '{{ size }}'
    delegate_to: localhost
EXPECTED RESULTS

VM created with its NIC attached to the VMWare VDS-based DPG called CUST-302.

ACTUAL RESULTS

The VM gets created but it's NIC gets assigned to a completely different (non-VDS) VM network that is called SHARED.

{
"changed": true,
"instance": {
"annotation": "\nApplication Version: CUCM 11.5\nOriginal VM Version: 8\nOVA Version: 1.1\n      ",
"current_snapshot": null,
"customvalues": {},
"guest_consolidation_needed": false,
"guest_question": null,
"guest_tools_status": "guestToolsNotRunning",
"guest_tools_version": "0",
"hw_cluster": "DC6-C4",
"hw_cores_per_socket": 1,
"hw_datastores": [
"EAR"
],
"hw_esxi_host": "REDACTED",
"hw_eth0": {
"addresstype": "assigned",
"ipaddresses": null,
"label": "Network adapter 1",
"macaddress": "00:50:56:a8:f2:69",
"macaddress_dash": "00-50-56-a8-f2-69",
"portgroup_key": null,
"portgroup_portkey": null,
"summary": "SHARED"
},
"hw_files": [
"[EAR] TST1-302_pub/TST1-302_pub.vmx",
"[EAR] TST1-302_pub/TST1-302_pub.vmsd",
"[EAR] TST1-302_pub/TST1-302_pub.nvram",
"[EAR] TST1-302_pub/TST1-302_pub.vmdk"
],
"hw_folder": "/DC6/vm/CLIENTS/TST1-302",
"hw_guest_full_name": null,
"hw_guest_ha_state": false,
"hw_guest_id": null,
"hw_interfaces": [
"eth0"
],
"hw_is_template": false,
"hw_memtotal_mb": 8192,
"hw_name": "TST1-302_pub",
"hw_power_status": "poweredOn",
"hw_processor_count": 2,
"hw_product_uuid": "4228b541-ae72-6e1f-5425-b236af1cb1e9",
"hw_version": "vmx-08",
"instance_uuid": "5028d05c-7879-2288-ac70-9143e2733020",
"ipv4": null,
"ipv6": null,
"module_hw": true,
"moid": "vm-666",
"snapshots": [],
"vimref": "vim.VirtualMachine:vm-666",
"vnc": {}
},
"invocation": {
"module_args": {
"allow_duplicates": false,
"cluster": "DC6-C4",
"datacenter": "DC6",
"datastore": "EAR",
"deployment_option": null,
"disk_provisioning": "thin",
"fail_on_spec_warnings": false,
"folder": "/DC6/vm/CLIENTS/TST1-302",
"hostname": "REDACTED",
"inject_ovf_env": false,
"name": "TST1-302_pub",
"networks": {
"Network Adapter 1": "CUST-302"
},
"ova": "/home/REDACTED/REDACTED/cucm_11.5_vmv8_v1.1.ova",
"ovf": "/home/REDACTED/REDACTED/cucm_11.5_vmv8_v1.1.ova",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 443,
"power_on": true,
"properties": {
"DeploymentOption.value": "CUCM_2500"
},
"proxy_host": null,
"proxy_port": null,
"resource_pool": "Resources",
"username": "REDACTED",
"validate_certs": false,
"wait": true,
"wait_for_ip_address": false
}
}
}
OTHER INFO

I do not use "VMNetwork"m or "Network 1" or "Adapter 1" as my OVA has this embedded info:

  <NetworkSection>
    <Info>The list of logical networks</Info>
    <Network ovf:name="eth0">
      <Description>eth0 handles all management and call processing traffic</Description>
    </Network>
  </NetworkSection>
...
      <Item>
        <rasd:AddressOnParent>7</rasd:AddressOnParent>
        <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
        <rasd:Connection>eth0</rasd:Connection>
        <rasd:Description>vmxnet3 ethernet adapter on &quot;eth0&quot;</rasd:Description>
        <rasd:ElementName>Network adapter 1</rasd:ElementName>
        <rasd:InstanceID>9</rasd:InstanceID>
        <rasd:ResourceSubType>vmxnet3</rasd:ResourceSubType>
        <rasd:ResourceType>10</rasd:ResourceType>
      </Item>
sky-joker commented 4 years ago

Hi @tezzigator

Thank you for reporting this issue.
I think that this issue occurs cause is the wrong specified value to the networks param.
The networks param specify portgroup name that not a network device name.

networks: "{u'configured ovf portgroup name':u'dvp name to attache'}"

Is the eth0 in your ovf configuration it portgroup name?

        <rasd:Connection>eth0</rasd:Connection>

In that case, for example, the networks param is the following.

networks: "{u'eth0':u'CUST-302'}"
ansibullbot commented 4 years ago

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

ansibullbot commented 3 years ago

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

click here for bot help