Forum Discussion
How can we configure fastL4 VS using icontrol rest
How can we configure fastL4 VS using icontrol rest? I dont see any option for specifying the type of VS on the endpoint.
- Satoshi_Toyosa1Ret. Employee
I assume you have a virtual already and would like to add the
profile to it (see iControl REST Cookbook - Virtual Server for how to create a virtual).fastL4
Generally speaking, you can add a profile to a virutal using
method to the virtual'sPOST
endpoint. For example, to add theprofiles
profile to the virtualhttp
:vs
curl -sku admin:pass https://mgmtIP/mgmt/tm/ltm/virtual/vs/profiles \ -H "Content-type: application/json" -X POST -d '{"name":"http"}'
where admin:pass is the userID/password pair, and mgmtIP is the management IP address of the BIG-IP.
However, adding the
profile isn't that straight forward as the profile may conflict with the existing profile. For example, if you attempt to add it to a virtual with thefastL4
profile using tmsh, you will get the following error.tcp
modify ltm virtual vs profiles add { fastL4 } 01070095:3: Virtual server /Common/vs lists incompatible profiles.
You need to replace all the profiles just like the
tmsh command (verb?). Here's the step.replace-all-with
1) Get the configuration of the virtual. You need the
.?expandSubcollections=true
curl -sku admin:pass https://mgmtIP/mgmt/tm/ltm/virtual/vs?expandSubcollections=true \ | python -m json.tool > sat
2) Edit the
section of the file. If the virtual had onlyprofilesReference
profile, it looks like this:tcp
"profilesReference": { "isSubcollection": true, "items": [ { "context": "all", "fullPath": "/Common/tcp", "generation": 493, "kind": "tm:ltm:virtual:profiles:profilesstate", "name": "tcp", "nameReference": { "link": "https://localhost/mgmt/tm/ltm/profile/tcp/~Common~tcp?ver=13.1.0" }, "partition": "Common", "selfLink": "https://localhost/mgmt/tm/ltm/virtual/~Common~vs/profiles/~Common~tcp?ver=13.1.0" } ], "link": "https://localhost/mgmt/tm/ltm/virtual/~Common~vs/profiles?ver=13.1.0" },
Replace everything related to the
profile. You can remove unnecessary fields: The system will populate the default values. e.g.,tcp
"profilesReference": { "isSubcollection": true, "items": [ { "context": "all", "name": "fastL4", "partition": "Common" } ], "link": "https://localhost/mgmt/tm/ltm/virtual/~Common~vs/profiles?ver=13.1.0" },
3) Put the file there.
curl -sku admin:pass https://mgmtIP/mgmt/tm/ltm/virtual/vs \ -H "Content-type: application/json" -X PUT -d@sat
There could be a better way to achieve this, but this is the best I could do so far.
I hope this helps.
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