<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Template to create multiple vservers and server farms based on list of port</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=6387620" />
  <subtitle>Template to create multiple vservers and server farms based on list of port</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=6387620</id>
  <updated>2013-05-23T18:11:29Z</updated>
  <dc:date>2013-05-23T18:11:29Z</dc:date>
  <entry>
    <title>RE: Template to create multiple vservers and server farms based on list of</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6413869" />
    <author>
      <name>Chris Thuys</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6413869</id>
    <updated>2012-09-04T08:48:43Z</updated>
    <published>2012-09-04T08:48:43Z</published>
    <summary type="html">Thanks for the response. I will give it a try.

My client wants the who rserver to be taken out if a port fails so that is no big deal. With your template it looks like it will listen and load balance all ports but only probe the specified ports is that correct.?
I ended up reworking it so that I reuse the same template for each port. which is a bit of pain when using multiple ports but no real big issue.</summary>
    <dc:creator>Chris Thuys</dc:creator>
    <dc:date>2012-09-04T08:48:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Template to create multiple vservers and server farms based on list of</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6402287" />
    <author>
      <name>Jason Notari</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6402287</id>
    <updated>2012-08-31T06:59:29Z</updated>
    <published>2012-08-31T06:59:29Z</published>
    <summary type="html">Chris--

Interesting usecase. Unfortunately it looks like the nested loop is being stripped out during processing (thus the message about the missing tags). In general I would say that what you had written mostly looks right, except for a missing port on the vip, and the fact that it doesn't seem to be working.

That said I think based on the configuration that you presented you could get a usable configuration with the attached xml. This is using your same port query, but creating a single vserver/serverfarm combo with multiple probes checking the different ports. The end behavior should be pretty much what you are looking for. A nice difference with this is that the sticky will by applied consistently between ports, the not so nice thing is that a failure on one port will take an rserver down on all ports.

Hopefully this works for you.

--Jason

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;template xmlns:xalan="http://xml.apache.org/xslt" applicationType="Webmethods" version="1.0" xsi:noNamespaceSchemaLocation="file:application_template_v2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" description="Webmethods Template Multiple ports" showsInGuidedSetup="true"&gt;
  &lt;input&gt;
    &lt;group name="service" type="group" displayString="Application Configuration"&gt;
      &lt;variable name="name" type="name" displayString="Application Config Name:" perm="ace_vip"/&gt;
      &lt;variable name="vip" type="ipaddresswithprefix" displayString="VIP Address:" perm="ace_vip"/&gt;
      &lt;array name="reals" displayString="IP Addresses of Real Servers" perm="ace_vip"&gt;
        &lt;variable name="ipAddr" displayString="" type="ipaddress" perm="ace_vip"/&gt;
      &lt;/array&gt;
      &lt;variable name="sticky" type="boolean" displayString="Session Persistence:" perm="ace_vip"/&gt;
      &lt;array name="portList" displayString="List of ports to load balance" perm="ace_vip"&gt;
        &lt;variable name="lPort" type="port" displayString="Listener Port:" perm="ace_vip"/&gt;
      &lt;/array&gt;
    &lt;/group&gt;
    &lt;group name="network" type="group" displayString="Network Configuration"&gt;
      &lt;variable name="device" type="device" displayString="Load Balancer (Device:VirtualContext):" perm="ace_vip"/&gt;
      &lt;variable name="vlans" type="vlans" displayString="Client VLANs:" perm="ace_vip"/&gt;
      &lt;variable name="autoNat" type="boolean" displayString="Enable Source NAT:" perm="ace_vip"/&gt;
    &lt;/group&gt;
  &lt;/input&gt;
  &lt;config device="{$device}"&gt;
    &lt;slb&gt;
      &lt;serverfarm name="{$name}" predictor="leastconns"&gt;
        &lt;foreach iterate="{$portList/$lPort}"&gt;
          &lt;probe name="{$name}-TCP_Probe-{$portList/$lPort}" type="tcp" port="{$portList/$lPort}"/&gt;
        &lt;/foreach&gt;
        &lt;foreach iterate="{$reals/$ipAddr}"&gt;
          &lt;rserver name="{$reals/$ipAddr}" ipAddr="{$reals/$ipAddr}"/&gt;
        &lt;/foreach&gt;
      &lt;/serverfarm&gt;
      &lt;vserver-http name="{$name}" vlans="{$vlans}" inService="true" autoNat="{$autoNat}" icmpReply="active"&gt;
        &lt;vip address="{$vip}" protocol="any"/&gt;
        &lt;if test="{$sticky}=true"&gt;
          &lt;sticky-loadbalance&gt;
            &lt;ip-sticky activeConns="true" replication="true" name="{$name}-sticky" addressType="source" netmask="255.255.255.255" serverfarm="{$name}"/&gt;
          &lt;/sticky-loadbalance&gt;
        &lt;/if&gt;
        &lt;else&gt;
          &lt;loadbalance serverfarm="{$name}"/&gt;
        &lt;/else&gt;
      &lt;/vserver-http&gt;
    &lt;/slb&gt;
  &lt;/config&gt;
&lt;/template&gt;</summary>
    <dc:creator>Jason Notari</dc:creator>
    <dc:date>2012-08-31T06:59:29Z</dc:date>
  </entry>
  <entry>
    <title>Template to create multiple vservers and server farms based on list of port</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6387619" />
    <author>
      <name>Chris Thuys</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6387619</id>
    <updated>2012-08-30T10:10:09Z</updated>
    <published>2012-08-30T10:10:09Z</published>
    <summary type="html">I am trying to create a templae which will create multiple virtual servers and server farms based on a list of ports.
I created the template and it validates ok but errors when I try to generate an application. 
The errors are 
[Error] Line 6, Col 22:  The content of element 'serverfarm' is not complete. One of '{probe, rserver}' is expected.

[Error] Line 9, Col 22:  The content of element 'serverfarm' is not complete. One of '{probe, rserver}' is expected.
 
the full template is listed below. Any got any ideas or can point me to the full syntax for templates.
 
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;template xmlns:xalan="http://xml.apache.org/xslt" applicationType="Webmethods" version="1.0" xsi:noNamespaceSchemaLocation="file:application_template_v2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" description="Webmethods Template Multiple ports" showsInGuidedSetup="true"&gt;
  &lt;input&gt;
    &lt;group name="service" type="group" displayString="Application Configuration"&gt;
      &lt;variable name="name" type="name" displayString="Application Config Name:" perm="ace_vip"/&gt;
      &lt;variable name="vip" type="ipaddresswithprefix" displayString="VIP Address:" perm="ace_vip"/&gt;
      &lt;array name="reals" displayString="IP Addresses of Real Servers" perm="ace_vip"&gt;
        &lt;variable name="ipAddr" displayString="" type="ipaddress" perm="ace_vip"/&gt;
      &lt;/array&gt;
      &lt;variable name="sticky" type="boolean" displayString="Session Persistence:" perm="ace_vip"/&gt;
      &lt;array name="portList" displayString="List of ports to load balance" perm="ace_vip"&gt;
        &lt;variable name="lPort" type="port" displayString="Listener Port:" perm="ace_vip"/&gt;
      &lt;/array&gt;
    &lt;/group&gt;
    &lt;group name="network" type="group" displayString="Network Configuration"&gt;
      &lt;variable name="device" type="device" displayString="Load Balancer (Device:VirtualContext):" perm="ace_vip"/&gt;
      &lt;variable name="vlans" type="vlans" displayString="Client VLANs:" perm="ace_vip"/&gt;
      &lt;variable name="autoNat" type="boolean" displayString="Enable Source NAT:" perm="ace_vip"/&gt;
    &lt;/group&gt;
  &lt;/input&gt;
  &lt;config device="{$device}"&gt;
    &lt;slb&gt;
      &lt;foreach iterate="{$portList/$lPort}"&gt;
        &lt;serverfarm name="{$name}-{$portList/$lPort}" predictor="leastconns"&gt;
          &lt;probe name="TCP_Probe" type="tcp"/&gt;
          &lt;foreach iterate="{$reals/$ipAddr}"&gt;
            &lt;rserver name="{$reals/$ipAddr}" ipAddr="{$reals/$ipAddr}" port="{$portList/$lPort}"/&gt;
          &lt;/foreach&gt;
        &lt;/serverfarm&gt;
        &lt;vserver-http name="{$name}-{$portList/$lPort}" vlans="{$vlans}" inService="true" autoNat="{$autoNat}" icmpReply="active"&gt;
          &lt;vip address="{$vip}" protocol="any"/&gt;
          &lt;if test="{$sticky}=true"&gt;
            &lt;sticky-loadbalance&gt;
              &lt;ip-sticky activeConns="true" replication="true" name="{$name}-{$portList/$lPort}-sticky" addressType="source" netmask="255.255.255.255" serverfarm="{$name}-{$portList/$lPort}"/&gt;
            &lt;/sticky-loadbalance&gt;
          &lt;/if&gt;
          &lt;else&gt;
            &lt;loadbalance serverfarm="{$name}-{$portList/$lPort}"/&gt;
          &lt;/else&gt;
        &lt;/vserver-http&gt;
      &lt;/foreach&gt;
    &lt;/slb&gt;
  &lt;/config&gt;
&lt;/template&gt;</summary>
    <dc:creator>Chris Thuys</dc:creator>
    <dc:date>2012-08-30T10:10:09Z</dc:date>
  </entry>
</feed>

