I'm trying trying to remove a portgroup named test from vCenter 6.5 but I'm unable to because vCenter says the port group is in use: "The resource "test" is in use."
There aren't VM's connected to this port group. How do I remove the port group?
If I try it directly by logging into the ESXi host it also fails.
It's a production server so I can't put it in maintenance mode nor can I reboot.
Hello,
Try from CLI:
List port groups currently associated with a virtual switch:
esxcli <conn_options> network vswitch standard portgroup list
The command lists the port group name, associated virtual switch, active clients, and VLAN ID.
Add a port group:
esxcli <conn_options> network vswitch standard portgroup add --portgroup-name=<name> --vswitch-name=vSwitch1
Delete one of the existing port groups:
esxcli <conn_options> network vswitch standard portgroup remove --portgroup-name=<name> --vswitch-name=vSwitch1
Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.
Cheers,
VCIX6-NV|VCP-NV|VCP-DC|
Hi Hassan,
Thanks for your reply. I tried the command but it doesn't work either:
"Unable to delete portgroup "test", for the following reasons: 1 active ports"
Hello,
Check the below: VMware Knowledge Base
Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.
Cheers,
VCIX6-NV|VCP-NV|VCP-DC|
Did you check it?
If yes, do this VMware Knowledge Base
Yeah I checked but it isn't used by any VM:
Tried by console but same issue:
[root@xxxxx:~] esxcfg-vswitch --del-pg="test" vSwitch1
Failed to remove portgroup: test, Error: Unable to delete portgroup "test", for the following reasons: 1 active ports
Check and see if you have any vSphere Templates that were using that. They won't show up as a virtual machine but will hold onto the configuration element.
Hi,
Kindly use vicfg-vswitch --list to list all port groups.
Try the following to delete: vicfg-vswitch <conn_options> --del-pg <port_group_name> vSwitch1
Regarding the "conn_options" You can run host management commands such as ESXCLI commands.
And please advise about your ESXi version.
And please check the following: VMware vSphere 5.1
Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.
Cheers,
VCIX6-NV|VCP-NV|VCP-DC|
I run vCenter/ESXi 6.5 and the PG is not used by a template.
These commands are not recognized but aren't they basically the same as the ones I already tried? (the ones I tried earlier were recognized though).
Do you have virtual machines with active snapshots, where the VMs were connected to that port group in any of these snapshots?
André