mimo974
Contributor
Contributor

Script to desactive vSwitch

Hello everyone,

I want to know if its possible to desactive vSwitch by start a script (for example with python) ?

For example, i have 3 vSwitch and my goal is just with a script i can desactived (not delete) my vSwitch or maybe vmnic.

Thank you for your help.

Mimo.

0 Kudos
3 Replies
MartinGustafsso
VMware Employee
VMware Employee

You can't disable the vSwitch, but you can 'down' the uplinks of the vSwitch.

esxcli network nic down -n vmnicX

esxcli network nic up -n vmnicX

0 Kudos
IRIX201110141
Virtuoso
Virtuoso

Keep in mind that the VMs, which are connected to the vSwitch trough their Portgroups can reach each other.   Its not clear what you would like to achieve.

- Yes you can shutdown the vnmics

- You can modify the LB/Failover NIC Settings of a portgroup and set the uplinks/nics to "unused"

- You can set a wrong VLAN on the portgroup which isnt accepted by the pSwitch

- You can modify the vNIC setting of the VMs to status "unconnected"

- If you use vDS instead vSS you can block certain Ports

Most of them can configured trough the ESXi command line and all of them can be scriptet trough remote APIs like Powershell or similar.

Regards,
Joerg

0 Kudos
scott28tt
VMware Employee
VMware Employee

You cannot “deactivate“ a vSwitch.

What are you actually trying to achieve, and why?

0 Kudos