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

No need to search port for VM VNIC connection to DVS #750

Open
ckjhljcy opened this issue May 17, 2024 · 0 comments
Open

No need to search port for VM VNIC connection to DVS #750

ckjhljcy opened this issue May 17, 2024 · 0 comments
Labels

Comments

@ckjhljcy
Copy link

Describe the bug

In this example:
https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/add_vm_nic_to_dvs.py

When connect VM VNIC to a DVPG of DVS, we first try to get a free port. That is not necessary. Auto expand of the port in DVPG has been here for years and it is enabled by default on DVPG. That's, if there is no enough port, vCenter will automatically create a port for the VM.

Thanks to the auto expand, the client doesn't need to specify the portKey in the VNIC backing:
nic_spec.device.backing.port.portKey = port.key

Reproduction steps

Create DVS and use add_vm_nic_to_dvs.py to connect VM VNIC to DVS.
There will be 16 ports by default created. So you will find after run the script for 16 times, you can't add any vnic to that DVPG.

Expected behavior

The script should not search free port for the VM VNIC. Just let the vCenter auto expand the port if there is no free ones.

Additional context

No response

@ckjhljcy ckjhljcy added the bug label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant