mag2sub
Contributor
Contributor

renaming vswitch0 using esxcli

Inherited a  pacthwork esx install done using " interactive" process with esx shell enabled ....how do go in and cleanup/modify the default configs in place in terms of  naming convention etc ?

For instance the interactive process followed by DCUI had created the vSwitch0 (managment network) .. and now would like to go in the esx shell and rename /clean

i am aware of esxcli commands to add vswitch, adding port groups adding uplinks, add vmk0,ip  etc ...but how do i just rename a existing vswitch0 to a more meaningful name using the shell ?

Thanks and appreciate as newbie

0 Kudos
4 Replies
MKguy
Virtuoso
Virtuoso

As far as I'm aware there is no option to rename an existing Standard vSwitch on the fly, neither through esxcli nor through esxcfg-vswitch (or vim-cmd). You will probably have to re-create the vSwitch on the shell to rename it. The GUI doesn't even allow you to configure a customg Standard vSwitch name upon creation, so I don't really see what your colleague supposedly did wrong here.

You could maybe poke around in the /etc/vmware/esx.conf file but I don't really see the point of bothering at all instead of using the default naming scheme of vSwitch[number]. You still have the port group names and hopefully a thorough documentation.

-- http://alpacapowered.wordpress.com
0 Kudos
aaronwsmith
Enthusiast
Enthusiast

vSwitch0 is a standand naming convention for standard virtual switches.  Only way to rename it is to modify the esx.conf file, then reboot the host to make the change effective.  But this is not supported, and if host is managed via Auto Deploy (assuming this is a possibility since you're posting to ESXi 5 discussions), the changes will be gone after rebooting the host anyhow (unless if host profile is updated as well to support changes made...)

0 Kudos
sunhero
Contributor
Contributor

if you have one of the host with the target switch name, let try to create a host profile and apply it to the ESX with old name.

it's work

0 Kudos
vfk
Expert
Expert

I agree with MKguy - your best approach it recreate the the vswitch through cli, there is a very little gain in changing the default name. 

--- If you found this or any other answer helpful, please consider the use of the Helpful or Correct buttons to award points. vfk Systems Manager / Technical Architect VCP5-DCV, VCAP5-DCA, vExpert, ITILv3, CCNA, MCP
0 Kudos