Disabling vmkernel IPv6 while preserving static IPv4 address

Using Set-VMHostNetworkAdapter to disable IPv6 settings on a vmkernel adapter, also seems to clear the IPv4 static IP addresses.

Example code (don’t use this):

Get-VMHost myhost1 | Get-VMHostNetworkAdapter -VMKernel -Name vmk1 | Set-VMHostNetworkAdapter -IPv6Enabled $False

This should disable IPv6 settings on the vmkernel vmk1 on myhost1, and it does.  It also clears the static IPv4 address.

From reading the docs,

IPv6Enabled — Indicates that IPv6 configuration is enabled. Setting this parameter to $false disables all IPv6-related parameters. If the value is $true”, you need to provide values for at least one of the IPv6ThroughDhcp, AutomaticIPv6, and IPv6 parameters.

No mention there.  However the -IPv6 switch parameter has an interesting comment:

IPv6 — Specifies static addresses using the following format: <IPv6>/<subnet_prefix_length> or <IPv6>. If you skip <subnet_prefix_length>, the default value of 64 is used. Specifying a value for IPv6 parameter overrides the current configuration. To clear all configured static IP addresses, pass an empty array to the IPv6 parameter.

Perhaps that’s the issue.  In any case, this code works to preserve the existing static IP settings.  You can use this:

Get-VMHost myhost1 | Get-VMHostNetworkAdapter -VMKernel -Name vmk1 | % { $_ | Set-VMHostNetworkAdapter -IPv6Enabled $False -IP $_.ip -SubnetMask $_.SubnetMask }

No free uplink port is available for host

While adding several hosts to an existing Distributed Virtual Switch using the Manage Hosts wizard, I encountered this error on two of the hosts:

  • Error: The resource vim.dvs.DistributedVirtualPort is not available in vim.DistributedVirtualSwitch MySwitchName
  • Error Stack: No free uplink port is available for host myesx01.example.org

I verified the uplink group had sufficient ports available by browsing to Home -> Inventory -> Networking -> select the uplink group and check the Summary tab:

So, to resolve the issue I removed all but one vmnic for each host, and then manually added them back by going to the host networking configuration and using “Manage Physical Adapters.”

Hope this helps.