VMware Cloud Community
mqzd23
Enthusiast
Enthusiast

Unable to remove port group

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?

pastedImage_2.png

pastedImage_3.png

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.

9 Replies
HassanAlKak88
Expert
Expert

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|

@KakHassan

linkedin.com/in/hassanalkak


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
0 Kudos
mqzd23
Enthusiast
Enthusiast

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"

0 Kudos
HassanAlKak88
Expert
Expert

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|

@KakHassan

linkedin.com/in/hassanalkak


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
0 Kudos
diegodco31
Leadership
Leadership

Did you check it?

pastedImage_0.png

If yes, do this VMware Knowledge Base

Diego Oliveira
LinkedIn: http://www.linkedin.com/in/dcodiego
0 Kudos
mqzd23
Enthusiast
Enthusiast

Yeah I checked but it isn't used by any VM:

pastedImage_0.png

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

0 Kudos
daphnissov
Immortal
Immortal

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.

HassanAlKak88
Expert
Expert

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|

@KakHassan

linkedin.com/in/hassanalkak


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
0 Kudos
mqzd23
Enthusiast
Enthusiast

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).

pastedImage_0.png

pastedImage_0.png

0 Kudos
a_p_
Leadership
Leadership

Do you have virtual machines with active snapshots, where the VMs were connected to that port group in any of these snapshots?


André