9

How do I change the name of a vSwitch with vSphere 7.0 U2 and higher?

 3 years ago
source link: https://www.yellow-bricks.com/2021/06/14/how-do-i-change-the-name-of-a-vswitch-with-vsphere-7-0-u2-and-higher/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How do I change the name of a vSwitch with vSphere 7.0 U2 and higher?

Duncan Epping · Jun 14, 2021 · 1 Comment

Some of you may have noticed it already, and some may not, but a lot of the configuration details that were traditionally stored in “esx.conf” have now moved elsewhere. The question is where did it go? Well it went into “configstore” and with “configstore” now also comes a commandline interface called “configstorecli”. I briefly mentioned this in a previous post a few weeks ago. Today I noticed a question on VMTN around renaming a vswitch on a host and how you can do this now that the vswitch details have disappeared from esx.conf.

I figured I should be able to test this in my lab and write a short howto. So here we go.

You can look at the current network configuration for your vSwitch using the following command:

configstorecli config current get -c esx -g network_vss -k switches

Then what you can do is dump the info in a json file, which you will then be able to edit:

configstorecli config current get -c esx -g network_vss -k switches > vswitch.json

The file will look something like this:

51245745452_9731bf647a_b.jpg

After you made the required changes, you then load the configuration using the json file:

configstorecli config current set -c esx -g network_vss -k switches -i vswitch.json --overwrite

I changed the name of my vSwitch0 to “vSwitchDuncan” and as you can see below, the change worked! Although do note, you will need to reboot the host before you see the change!

51247224659_27204207e8_b.jpg

For those who prefer video content, I also created a quick demo which shows the above process:

Share it:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK