saltstack / saltstack/salt

[BUG] vsphere.add_host_to_dvs fails to migrate vmnics/vmks with 'Failed to migrate adapters (A specified parameter was not correct: )'

Open
#62,040 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
When executing the vsphere.add_host_to_dvs module, the host is added to the DVS but the vmnic/vmk migration fails with Failed to migrate adapters (A specified parameter was not correct: ) on vSphere 7.0U3:

someminion:
    ----------
    hv01:
        ----------
        dvs:
            DVS-STORAGE
        message:
            Failed to migrate adapters (A specified parameter was not correct: )
        portgroup:
           DPG-STORAGE
        status:
            False
        uplink:
            DVS-STORAGE-DVUplinks-01
        vmknic:
            vmk1
        vmnic:
            vmnic1
    message:
    success:
        True

Setup
New vSphere install with hosts with the following setup:

Host Networking:
vSwitch vSwitch0
Port Group: HV-MGMT
Physical NICs: vmnic0
VMKernel NICs: vmk0
vSwitch vSwitch1
Port Group: STORAGE
Physical NICs: vmnic1
VMKernel NICs: vmk1

vCenter:
DVS: DVS-Storage
Distributed Port Group: DPG-STORAGE
Uplink Port Group: DVS-STORAGE-DVUplinks-01

Steps to Reproduce the behavior
salt someminion vsphere.add_host_to_dvs host='vcenter01.example.com' username='Administrator@vsphere.local' password='CorrectHorseBatteryStaple' vmknic_name='vmk1' vmnic_name='vmnic1' dvs_name='DVS-STORAGE' target_portgroup_name='DPG-STORAGE' uplink_portgroup_name='DVS-STORAGE-DVUplinks-01' protocol='https' port='443' verify_ssl=False host_names="['hv01']"

Expected behavior
Host is added to DVS (DVS-STORAGE), and physical adapter (vmnic1) and VMKernel adapter (vmk1) are migrated to the DVS

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
salt --versions-report 
Salt Version:
          Salt: 3004.1

Dependency Versions:
          cffi: 1.11.5
      cherrypy: unknown
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10.1
       libgit2: 0.26.8
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.14
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: 0.26.4
        Python: 3.6.8 (default, Nov 17 2021, 16:10:06)
  python-gnupg: Not Installed
        PyYAML: 3.12
         PyZMQ: 19.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: almalinux 8.5 Arctic Sphynx
        locale: UTF-8
       machine: x86_64
       release: 4.18.0-348.20.1.el8_5.x86_64
        system: Linux
       version: AlmaLinux 8.5 Arctic Sphynx

Additional context
Tried with pyVmomi versions 7.0.2 and 7.0.3. Tried both through proxy minion and regular minion. Tried with host both in and out of maintenance mode.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the vsphere.add_host_to_dvs entry point and reproduce the migration with the vSphere 7.0U3 setup and parameters documented here. Trace the vmnic/vmk migration failure and verify the behavior with the reported pyVmomi versions; done means the host, vmnic1, and vmk1 are migrated successfully to the specified DVS and port groups.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.