Forum Discussion

sarat_82132's avatar
sarat_82132
Icon for Nimbostratus rankNimbostratus
Jun 25, 2015

Associate a Vserver with a property

Hi:

 

in my Irule I want to access a property that will be specific to the Vserver. this irule will be shared by multiple vservers but the property that I want to use will be specific to vserver. is there a way to set a property on vserver and I can read that in the Irule.

 

6 Replies

    • sarat_82132's avatar
      sarat_82132
      Icon for Nimbostratus rankNimbostratus
      let me give my example There are two Vservers vserver-1 is for all sales applications and vserver-2 is for all marketing applications. there is one IRule ( code snippet below ) which needs to fetch different data groups. The way I solved this is by creating two Irule Instances f5 and assocate irule-1 to vserver-1 and irule-2 to vserver-2. all the contents are excatly same for irule-1 and irule-2 except the value of the dg_application_list_name ( example below) . if this value somehow can be read from the Vserver, that will be very useful. when HTTP_REQUEST priority 100 { set dg_application_list_name "sales-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } } when HTTP_REQUEST priority 100 { set dg_application_list_name "marketing-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } }
    • Ronald_van_der_'s avatar
      Ronald_van_der_
      Icon for Nimbostratus rankNimbostratus
      Ok, so if I understand correctly, you want to use a VS-configuration 'item' as the value. In other words, use a global iRule for multiple VS' and based on the VS (name e.g.) change the 'value'?
    • sarat_82132's avatar
      sarat_82132
      Icon for Nimbostratus rankNimbostratus
      let me give my example There are two Vservers vserver-1 is for all sales applications and vserver-2 is for all marketing applications. there is one IRule ( code snippet below ) which needs to fetch different data groups. The way I solved this is by creating two Irule Instances f5 and assocate irule-1 to vserver-1 and irule-2 to vserver-2. all the contents are excatly same for irule-1 and irule-2 except the value of the dg_application_list_name ( example below) . if this value somehow can be read from the Vserver, that will be very useful. when HTTP_REQUEST priority 100 { set dg_application_list_name "sales-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } } when HTTP_REQUEST priority 100 { set dg_application_list_name "marketing-applications" set dg_application_list [class get $dg_application_list_name]}] foreach { row } $dg_application_list { do something } }
    • Ronald_van_der3's avatar
      Ronald_van_der3
      Icon for Nimbostratus rankNimbostratus
      Ok, so if I understand correctly, you want to use a VS-configuration 'item' as the value. In other words, use a global iRule for multiple VS' and based on the VS (name e.g.) change the 'value'?