Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new VM connected to a network name that exists on more than one dvswitch results in the VM being disconnected #2269

Open
xschlef opened this issue Dec 9, 2024 · 0 comments

Comments

@xschlef
Copy link

xschlef commented Dec 9, 2024

SUMMARY

Creating a new VM with a network name that exists on a dvswitch as well as somewhere else (we only tested directly at the root node), the VM will always start with a disconnected NIC that is attached to the network that exists in the root of the tree. Reconnecting the NIC usually fixes the issue. Reconnecting via ansible did not work, though this information is a few months old. This behavior is already reported in the discussions for #1991

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.vmware.vmware_guest

ANSIBLE VERSION

Running in a ansible_runner docker environment.
2.17.3

COLLECTION VERSION

5.2.0

CONFIGURATION
BECOME_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/become']
CACHE_PLUGIN(/etc/ansible/ansible.cfg) = ansible.builtin.memory
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/collections']
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_ACTION_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/action']
DEFAULT_BECOME(/etc/ansible/ansible.cfg) = True
DEFAULT_BECOME_ASK_PASS(/etc/ansible/ansible.cfg) = False
DEFAULT_BECOME_METHOD(/etc/ansible/ansible.cfg) = sudo
DEFAULT_BECOME_USER(/etc/ansible/ansible.cfg) = root
DEFAULT_CACHE_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/cache']
DEFAULT_CALLBACK_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/callback']
DEFAULT_CLICONF_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/cliconf']
DEFAULT_CONNECTION_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/connection']
DEFAULT_FILTER_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/filter']
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 30
DEFAULT_HTTPAPI_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/httpapi']
DEFAULT_INVENTORY_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/inventory']
DEFAULT_LOOKUP_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/lookup']
DEFAULT_MANAGED_STR(/etc/ansible/ansible.cfg) = test
DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/modules']
DEFAULT_NETCONF_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/netconf']
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/roles']
DEFAULT_STRATEGY_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/strategy']
DEFAULT_TERMINAL_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/terminal']
DEFAULT_TEST_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/test']
DEFAULT_VARS_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/vars']
DOC_FRAGMENT_PLUGIN_PATH(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/plugins/doc_fragments']
EDITOR(env: EDITOR) = vim
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent
PAGER(env: PAGER) = less -r
TRANSFORM_INVALID_GROUP_CHARS(/etc/ansible/ansible.cfg) = ignore
USE_PERSISTENT_CONNECTIONS(/etc/ansible/ansible.cfg) = True
OS / ENVIRONMENT

Debian Bookworm, up to date. Running in ansible-runner as a docker container based on the debian bookworm docker image.

STEPS TO REPRODUCE
# have virtual center with a network having the same name at a standalone host and also defined on a dvswitch.
- name: "Create VM"
  community.vmware.vmware_guest:
    hostname: "..."
    username: "..."
    password: "..."
    datacenter: "..."
    folder: "..."
    resource_pool: "..."
    name: "{{ hostname }}"
    state: poweredoff
    guest_id: "..."
    cluster: "..."
    disk: "{{ ... }}"
    hardware:
      hotadd_cpu: true
      hotadd_memory: true
      memory_mb: "..."
      num_cpus: "..."
      num_cpu_cores_per_socket: "..."
      scsi: paravirtual
      version: latest
      boot_firmware: efi
    networks:
      - name: "vmnet{{ int_vlan }}"
        dvswitch_name: "{{ str_vc_dvswitch_name }}"
        device_type: vmxnet3
        connected: true
        start_connected: true
EXPECTED RESULTS

The VM is connected to vmnet{{ int_vlan}} that exists on dvswitch str_vc_dvswitch_name.

ACTUAL RESULTS

The VM is not connected to any network. VM workstation says the nic "lives" on the root vmnet instead of the dvswitch vmnet.
Connecting the VM manually via VMWare Workstation or the WebGUI works. Using an ansible task to connect the NIC to the fails or at least failed 3 months ago. I sadly do not have any output for this and cannot test it right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant