Forum Discussion

Rob_Burton_1739's avatar
Rob_Burton_1739
Icon for Nimbostratus rankNimbostratus
Aug 08, 2017

can we use iRules to dynamically change the resource pool in a VIP

I wish to utilise my VIPS with switchable resource pools during an infrastructure migration, changing the VIP names is not an option, so what I want to know is how I can configure an iRule to choose a resource pool preferable using a single setting in the F5 to switch the resource pools in multiple VIPs

 

Is this possible and if so how would I code the iRule?

 

2 Replies

  • Hello Rob,

    Using irules you can choose which pool you want to send traffic to.

    The is a sample of an irule that will do that

    when HTTP_REQUEST {
     pool pool_name 
    }
    

    Now you can adapt this irule to check conditions and based on matched condition route the trafic to different pool.

    Not sure what you want to do exactly.

    Please explain more so we can adapt the irule.

    Regards

  • You could use a DataGroup to do this and have all your iRules reference it. You could then make it as simple or complex as you need it, however, simplistically it would look something like

    ltm data-group internal /Common/environment
    records {
    32bit { }
    }
    type string
    }
    
    
        when HTTP_REQUEST {
    
            if { [match class 64bit equals environment] } {
             pool MachinePool_64
            } else {
             pool MachinePool_32
            }
    }