Forum Discussion
bsg273_163868
Oct 27, 2015Nimbostratus
Changing Virtual Server's Access Profile with TMSH w/o Knowing Its Current Value
I am trying to use tmsh to change the Access Profile that is assigned to a given virtual server without knowing its current value. In the f5 Console GUI this is straightforward. When you navigate t...
Brad_Parker_139
Oct 27, 2015Nacreous
You should be able to just use
modify ltm virtual MY_VIRTUAL_SERVER profiles replace-all-with {ACCESS_PROFILE_NEW}
- Brad_Parker_139Oct 27, 2015NacreousProbably best to list ltm virtual one-line first so you know all the other profile you have attached as well if you replace-all-with.
- bsg273_163868Oct 27, 2015NimbostratusOk so how would I preserve all those other profiles and just replace the Access Profile specifically?
- Brad_Parker_139Oct 27, 2015NacreousWell, you would have to put them all into the curlies with the new profile. Its actually probably much easier to "list ltm virtual VS_name profiles" to gather the list of profiles and just use your original add/delete tmsh since you are querying what the original profile was anyway.
- Walter_KacynskiOct 27, 2015CirrostratusThis isn't that easy because some of the profiles have dependencies on iRules and other configuration objects. I would suggest that you explicit remove the old one with a known name.
- bsg273_163868Oct 27, 2015NimbostratusI'm still not understanding how you propose to discover which profile is the Access Profile exactly. If I list out the profiles it gives me all profiles, not just Access Profiles. So if I were to get a list of all profiles, then replace them all with the new Access Profile, then add back all the original profiles, would I not still be adding back the original Access Profile in addition to the new one?
- bsg273_163868Oct 27, 2015Nimbostratus@Walter Kacynski So if the question instead were, "How do I get the value a Virtual Server's Access Profile property is set to?" would this just not be doable?
- Walter_KacynskiOct 27, 2015CirrostratusTry using a well structured naming convention. In my environment I name all of my Access profiles with "Access". Since you can only have one applied then when doing a list you know what is what.
- Brad_Parker_139Oct 27, 2015Nacreousgood reason for naming convention that help with this like _access or _ap when you create profiles and other objects.
- bsg273_163868Oct 27, 2015NimbostratusUnfortunately, I don't have control over the Access Profile naming conventions my tmsh scripts my encounter. If there's no easier way, I may just list out all the Access Profiles and compare them against profiles listed for the VS and delete any that match before doing my add.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects