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:
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!
For those who prefer video content, I also created a quick demo which shows the above process:
EmVee says
Thanks Duncan. Very useful and this will help me a lot.
By the way, would you mind to share the details about the software you have used for recording the video?
Sergey says
Hello everyone!
To rename a vSwitch with vSphere 7.0, just log into ESXi on the host and recreate the vSwitch with the desired name (copy all other settings).
Duncan Epping says
Deleting and creating of course is a workaround, but not the same 🙂
Jonathan says
Is this supported by VMware? We were under the impression that the only way to do this and stay supported is to delete the vSwitch and create a new one. This of course is hard to do when you need to rename a switch that you are connected to for management/SSH access!
Daniel says
This method not working on a ESXI 7 U2 18538813, When i reboot the host, they hangs on yellow screen. Even try to reset network configuration unsucessfull.
John Baker says
Bailed me out for certain!
I had a vSwitch with some odd characters in the name which blew up ESXi management tools. This allowed me to make the changes and get running again.
Mohamed Azhar says
hi,
I have followed all the steps… after i made changes in json file…how can i save those chages… you have entered :wq! to save it… i am using putty from windows …can you advise …how to save those changes in json…thanks in advance