Can a vlan be renamed from the command line? I am running Junos 11.4R2.14 on a stack of two EX4500s
# edit vlans
[edit vlans]# rename OLD_VLAN to NEW_VLAN
[edit vlans]# show | compare
[edit vlans]# commit
/edit: my bad, i forgot that it will rename the vlan, but NOT the references.
To achieve this, you would need to use:
# replace OLD_VLAN with NEW_VLAN
however, you should do this only if the vlan has a name that is very unambigious. that is - the "replace" command will replace really ALL occurences of the left-hand string with the right-hand string. If, for any reason, you have this string somewhere else in the config for something else, then it will break your config. as usual a "top show | compare" is helpful. Also note, if you use "replace", you won't need "rename" at this point.
Thanks for the quick reply, I will give this a try
As already said, the replace command is your friend.
replace pattern "old" with "new"
It operates from the current level of the configuration hierarchy and below. In other words, if you are inside vlans it will only operate inside vlans. If you are at the top level it will affect the entire configuration.
One thing you can do before doing a global replace like this is to look for the old pattern in the config first to see what appears. Sometimes the original pattern appears in unexpected places. From the top of the configuration:
show | display set | match "old"
If you are using any annotations, replace pattern will affect them as well. Unfortunately, annotations don't appear in display set format. To check for annotations with that pattern:
show | match "^ */?\*" | match "old"
show | find "annotation text"
I did find one gotcha in all of this. When I changed the name of my storage vlan, it suddenly stopped passing traffic, here is the setup:
Netapp Filer<--->EX4500<--->Cisco switch in IBM Bladecenter<--->ESXi host
All of my servers are virtualized so when all 4 of my ESXi hosts suddenly could not see the storage volumes on my Netapp Filer, my entire environment went down. I made the vlan name changes at about 5:00pm and after wrestling with it for nearly 4 hours I opened a case with Jtac. The Juniper engineer solved it in about 15 minutes. He deactivated the vlan and all ports associated with the vlan and then reactivated them. My ESXi hosts immediately saw the storage and me entire vSphere environment came back online. This was the only vlan change where we had to do a deactivate/active to make it work.
Any idea why?
Renaming a VLAN should not break connectivity. Did JTAC mention any internal/external bug for this issue? If this can be easily recreated on your platform/software, then you should suggest JTAC to file a bug for this issue.
Out of curiosity did you ever receive a PR from Juniper stating this issue? Also, was the VLAN facing your ESXi hosts swapped or just typical trunk/access ports?
At the junos configration alternatively, You can use replace command for everything.