Forum Discussion
Cannot create iApps that run over http and https on same VIP
I have an app that runs over http and partly over https. Up until now I would create 2 VS on the same IP.
One for http on 80 and one for https on 443 which works cause the port is different.
It's unclear to me how this translates into the iApp concept. Logically there is only one app spread over 2 VS. The first problem is naming :
* I can only create one iApp over either http or https, after that I have to pick another iApp name or else it complains that objects with this prefix already exists.
*When I pick a different name, however, it still complains that :
"01070333:3: Virtual Server /Common/vs1 illegally shares both address and vlan with Virtual Server /Common/vs2"
This means I cannot use the iApp template at all. Both http and https have to listen on the same IP and allow the same VLAN. This works when you do it manually.
This opens up an interesting question. What exactly distinguishes an "iApp" ? Is it per IP or per virtual server ?
It looks like there is no concept of having the same app use 2 different VS. How can I tell the f5 how to distinguish my apps ?
F.e. I have one setup where there is only one single VIP and all apps are separated only by URI. I have iRules that take care of that like :
if { [HTTP::host] equals "/app1" } {
pool app1
}
elseif { [HTTP::host] equals "/app2" } {
pool app2
and so forth.
I assume there is no way to tell the LTM to make these into separate iApps right ?
I was ok with switching back to having dedicated IPs per app but now I cannot even seem to do that.
Am I out of luck ?
- Fred_Slater_856Historic F5 Account
Well, I prefer to think of it as a "customization" rather than a "hack," but that is a matter for debate, I suppose. In any event, very few customers pay attention to the "Description" fields, so I doubt we will include a field to manipulate them in an official iApp release. Your python scripts sound very clever. Let me know how things go.
cheers, Fred
- stucky101_88485Nimbostratus
Got it. Not sure if they are clever but I KNOW I cannot expect anyone to remember that "myapp1.mydomain.com" translates to "/{partition_name}/myapp1.app/myapp1" so I figured why not utilize the description for a mapping of the 2 ? You are right otherwise - I had never used it before either. Will try this out when I have a minute.
Thanks again - DC rulez !!
- stucky101_88485Nimbostratus
Wait ! I just realized I cannot hard-code the description into the template. I need to pass it to the script. Let me clarify. I can easily change the description after the iapp has been created. In fact I have a script for that too :) The issue is just that now this description is not part of the iapp so if I ever "reconfigure" it the description disappears again. Are you saying there is a way to add a description into a template afterwards and still make it part of the template ? What exactly do you mean by "and if the tmsh statements are inside the iapp" ?
I'm afraid you mean placing tmsh commands into the template but like I said I have to catch arguments from the outside and that means adding something to the presentation layer right ? This may not be as simple after all.
- stucky101_88485Nimbostratus
Fred One more thought. I assume the description would be part of "scalar_vars", "list_vars" or "table_vars". I have these defined in the script so if I knew the exact name of the description I might be able to add it from the script ? By name I mean those arbitrary fields with the double underscores in them like:
{'name': 'pool__addr', 'value': ipaddr}, {'name': 'pool__http', 'value': '/create_new'}, {'name': 'pool__lb_method', 'value': 'least-connections-member'}
See f.e. how I pass the ip address as a var here. I would imagine something like :
{'name': 'vs_redirect__description', 'value': 'http://myapp1.mydomain.com'}
{'name': 'vs__description', 'value': 'https://myapp1.mydomain.com'}
but I think that requires mod'ing the template right ?
- Fred_Slater_856Historic F5 Account
Unfortunately, the description is not one of the variable or table values within the iapp, or more properly, the "application service object." The description is a direct property of the ASO. However, there is nothing to prevent you from creating a new variable in the ASO, and using it however you please, e.g. {'name':'stuckys_descrip','value':'http://myapp1.mydomain.com'}.
- stucky101_88485Nimbostratus
Fred Just to make sure we're on the same page. I use iControl to stand up the appservice so the only way to tell the api what I want is via the 3 var types mentioned. I don't have a way to modify the template itself on the fly each time I run the script so I'm not sure how you you think this can be done. And as far as your example goes {'name':'stuckys_descrip','value':'http://myapp1.mydomain.com'}.
If I add that to the template that still leaves me with 2 problems
- How would I feed the description to the template via the api since you mentioned there is no such object.method call available.
- Your example doesn't specify which virtual server the description would be for. Remember the standard http template creates 2 vs. (http_redir and https).
I think I'm missing something here. Can you clarify please ?
thx
- Fred_Slater_856Historic F5 Account
OK, let's back up. You want to set the value of the "description" property of a virtual server associated with an iapp. You can do this with iControl (LocalLB.VirtualServer.set_description) or with TMSH (modify ltm virtual descripton). The problem is that the iapp "owns" these objects, and will not allow a cli script to modify them. The solution is to put the script code inside the iapp implementation, so it runs whenever the iapp runs. Then the iapp controls the objects it is responsible for, and everyone is happy. If you wish to insert a value into the description that the iapp does not have access to, then you will need to set up some method of passing that information in, e.g. have the iapp read the value from a file on disk.
- stucky101_88485Nimbostratus
Fred
Just to clarify. The problem is not modifying the iapp after creation. My script unchecks the "strict updates" button, then sets the description, then re-checks it. I even trap ctrl-c to make sure it gets checked again. The problem is that now the description is not owned by the iapp and would be owerwritten again if I ran a reconfigure. Your fs idea might work. The ipp creation script could dump the files in a location known to the template and then the creation method would be able to read it out. I still think any setting in a given object should be configurable via the API but I'll try the fs idea.
Thx
- Fred_Slater_856Historic F5 Account
Stucky- I wonder why the description is being overwritten. I tried the following:
(1) run the http iapp, named "h1". This creates "h1_vs". (2) disable strictness (3) add a description (tmos) modify ltm virtual h1.app/h1_vs description "My description text" (4) enable strictness (5) re-run the iapp (6) check the description. (tmos) list ltm virtual h1.app/h1_vs description ltm virtual h1.app/h1_vs { description "My description text" }
In my example, the iapp does not overwrite the description.
- stucky101_88485Nimbostratus
Well that is interesting. I never actually tried it. I simply assumed that everything that was not initially defined in the template will get overwritten as that is the normal behaviour. I just tested it myself and you are right - it doesn't touch the description even after a reconfigure. So I guess the description is not really considered part of the template to begin with ? Seems a bit inconsistent though, doesn't it ? Well that solves the issue albeit in an unexpected way.
Thx
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