Forum Discussion

Fuchan_Tan_3092's avatar
Fuchan_Tan_3092
Icon for Nimbostratus rankNimbostratus
Apr 09, 2012

How is the virtual server status set?

Using the following steps via Java ICONTROL (exception 2 steps noted), I have created two virtual servers ( on port 80 and port 443). One issue remains, the status stays as "UNKNOWN" for both virtual server. These virtual servers seem to be working.

 

 

How is the status set? Is possible to set it via Java iControl?

 

 

// create pools,

 

// create preset

 

// create local profile http http

 

// create local profile http lottery_profile

 

// create StatsProfile

 

// oneConnect profile

 

// create lottery irule

 

// create catalog irule

 

// create catalog 443 irule

 

// create jsession irule

 

// persistence profile

 

// createLocalLBProfileClientSS - via big pipe commands

 

// create virtual server virtual server 80 (with lottery and oneConnect profile)

 

// add persistence profiles to virtual server 80

 

// add rules to virtual server 80

 

// create virtual server 443 ((with lottery and oneConnect profile)

 

// add persistence profiles to virtual server 443

 

// add SslClientProfile virtual server 443 - via big pipe commands

 

// add rules to virtual server 443
  • You can get the Unknown status if you aren't using a health monitor or haven't applied the pool as a default pool.
  • Thank for the expert knowledge. Set the pool as default seems like a simpler solution. I will give it a try.

     

    Yesterday I learned that it is because no health monitoring. So I did something like the following and it works.

     

     

    LocalLBPoolMonitorAssociation localLBPoolMonitorAssociation[] = new LocalLBPoolMonitorAssociation[1];

     

     

    String[] monitor_templates = new String[1];

     

     

    monitor_templates[0] = "tcp";

     

     

    localLBPoolMonitorAssociation[0] = new LocalLBPoolMonitorAssociation();

     

     

    localLBPoolMonitorAssociation[0].setPool_name("your pool name");

     

     

    iControl.LocalLBMonitorRule localLBMonitorRule = new iControl.LocalLBMonitorRule();

     

     

    localLBMonitorRule.setQuorum(0L);

     

     

    localLBMonitorRule.setType(iControl.LocalLBMonitorRuleType.MONITOR_RULE_TYPE_SINGLE);

     

     

    localLBMonitorRule.setMonitor_templates(monitor_templates);

     

     

    localLBPoolMonitorAssociation[0].setMonitor_rule(localLBMonitorRule);

     

     

    i_interfaces.getLocalLBPool().set_monitor_association(localLBPoolMonitorAssociation);
  • Tried apply the pool as a default pool. but need to find out how. Has anyone done it? Please share the code. Thanks.

     

  • If you've already created the virtual server, you can use the set_default_pool_name() method, but I find it easier to apply the default pool at the time of virtual server creation. Something like:

    LocalLBVirtualServerVirtualServerResource[] resourceArray = new LocalLBVirtualServerVirtualServerResource[1];
    LocalLBVirtualServerVirtualServerResource poolResource = new LocalLBVirtualServerVirtualServerResource();
    
    poolResource.setType(iControl.LocalLBVirtualServerVirtualServerType.RESOURCE_TYPE_POOL);
    poolResource.setDefault_pool_name(poolNameVariable); 
    resourceArray[0] = poolResource;
    iControlInterfaces.getLocalLBVirtualServer().create(commonVirtualServerDefinitionArray, wildmasksString, resourceArray, localLBVirtualServerVirtualServerProfileArray);