Forum Discussion
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 to Local traffic -> Virtual Servers -> Virtual Server List and click on a given virtual server, you can then scroll down and change the Access Profile assigned to that virtual server in the dropdown next to "Access Profile", click update, and you're done ... no need to know what the access profile was set to beforehang, you can just change the dropdown next to the "Access Profile" label. However, when I'm performing the same action using a tmsh command, I seem to have to know the value that assigned Access Profile is currently set to in order to be able to delete the profile out of that virtual server's properties and add in my new one. Here is the tmsh command I'm using ...
modify ltm virtual MY_VIRTUAL_SERVER profiles add {ACCESS_PROFILE_NEW} profiles delete {ACCESS_PROFILE_ORIG}
My point is that I need to know that the access profile is set to
ACCESS_PROFILE_ORIG
before issuing this command to reassign the access profile value. Is there any way to just have tmsh somehow detect what the access profile is set to and then delete it?- Brad_Parker_139Nacreous
You should be able to just use
modify ltm virtual MY_VIRTUAL_SERVER profiles replace-all-with {ACCESS_PROFILE_NEW}
- Brad_Parker_139NacreousProbably 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_163868NimbostratusOk so how would I preserve all those other profiles and just replace the Access Profile specifically?
- Brad_Parker_139NacreousWell, 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.
- Brad_ParkerCirrus
You should be able to just use
modify ltm virtual MY_VIRTUAL_SERVER profiles replace-all-with {ACCESS_PROFILE_NEW}
- Brad_ParkerCirrusProbably 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_163868NimbostratusOk so how would I preserve all those other profiles and just replace the Access Profile specifically?
- Brad_ParkerCirrusWell, 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.
Recent Discussions
Related Content
* 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