Skip to content

r/distributed_virtual_switch: add support to migrate a vmk from standard switch #1907

Description

@erSitzt

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

v1.4.6

Terraform Provider

v2.2.0

VMware vSphere

v7.0.3

Description

Not quite a bug i know...
As i didnt find any issues here or infos/solutions in discuss or the documentation regarding this topic, i decided to open a bug.

I have the following scenario:

  • create cluster
  • add host to cluster (fresh install with standard vSwitch and vmk0 with the management ip using 2 vmnics as uplinks)
  • create dvSwitch
  • create dvPortGroups and vNics (vmk1 - vmk2) for iscsi or somethink similar

...and i end up with the management vmk0 and two uplinks stills on the standard vSwitch.

What is the correct way of migrating from the vSwitch to the dvSwitch with all vmk and uplinks ?
I have seen an ansible module for this and i looks like this is possible using PowerCLI and govc

This is what i found on discuss for reference
https://discuss.hashicorp.com/t/vsphere-resource-to-assign-migrate-vmk0-vmkernel-adapter-to-distributed-switch-port-group/37815
https://discuss.hashicorp.com/t/how-to-migrate-the-vmk0-from-vswitch0-to-dvs/29650

Affected Resources or Data Sources

resource/vsphere_distributed_virtual_switch
resource/vsphere_vnic

Terraform Configuration

The described problem should already occur using the example code from the documentation

https://registry.terraform.io/providers/hashicorp/vsphere/latest/docs/resources/distributed_virtual_switch#example-usage

Which would not work if any of the vmnics is currently in use with the standard vSwitch

Debug Output

None

Panic Output

No response

Expected Behavior

Some logic to migrate the vSwitch, vmk and uplinks to a dvSwitch, or some hints in the documentation where the limitations are.

Actual Behavior

None

Steps to Reproduce

None

Environment Details

No response

Screenshots

No response

References

No response

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions