DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Load balancer group members value change as per environment.

    Posted Tue April 22, 2025 10:19 AM

    Generally we give member1, member2 names in the LB group and add entry in host alias in default domain and change IPs as per environment.
    HEre case is different , backend check DNS name of server and then forward request to  respective backend.
    So here we have given host1, host2 and host3 these are actual hosts and added entry in host alias.
    so they check on actual host at their LB end and connect to server..
    Now they do have different hosts for different environment and we can not change those in host alias as entries added are actual hosts.
    Tried changing with deployment policy but can see it is getting changed in deployment policy entries but only member's value is getting changed in actual configuration not for all the members.
    Please advise how to change host values in load balancer group.



    ------------------------------
    Snehal Yadav
    ------------------------------


  • 2.  RE: Load balancer group members value change as per environment.

    Posted Tue April 22, 2025 01:29 PM

    If I understand correctly, what you want is to deploy load balancer groups to other environments, but have the host definitions appropriate for that environment relative to the load balancer group?    That is, in your testing environment (UAT, SIT, whatever you may call it), you have host1, host2, etc, but in production, you need it to change to production hosts?   You're also using host aliases for this (which is clear).   

    So, say host1 = host1.UAT.com and host2 = host2.UAT.com, but in production they are host1.PROD.com and host2.PROD.com in some way?  Or, are you trying to add another host for the new environment?



    ------------------------------
    Joseph Morgan
    CEO - Independent
    ------------------------------



  • 3.  RE: Load balancer group members value change as per environment.

    Posted Wed April 23, 2025 02:28 AM

    Hello Joseph,

    Thank you for checking this.
    yes we have host1: uat.com and  host2: uat02.com but in prod it's host1:prod.com and host2: prod02.com
    And In load balancer group can not use alias as host1 and host2 but actual host needs to be added in the member ( that's the requirement from service provider)
    Now I want to change these actual host value in LB group , So tried deployment policy but it is changing only first value and 2nd value is not getting changed and uploaded in LB group
    Is there any other way we can change LB group member's actual host value?
    PFB entry used for deployment policy: Taking value of LBGroupMember1 and LBGroupMember2 from different xml file
    <ModifiedConfig>
        <Match>*/*/network/loadbalancer-group?Name=LBGroupName&amp;Property=LBGroupMembers/Server&amp;Value=.*</Match>
        <Type>change</Type>
        <Property/>
        <Value>@LBGroupMember1@</Value>
    </ModifiedConfig>
    <ModifiedConfig>
        <Match>*/*/network/loadbalancer-group?Name=LBGroupName&amp;Property=LBGroupMembers/Server&amp;Value=.*</Match>
        <Type>change</Type>
        <Property/>
        <Value>@LBGroupMember2@</Value>
    </ModifiedConfig>



    ------------------------------
    Snehal Yadav
    ------------------------------



  • 4.  RE: Load balancer group members value change as per environment.

    Posted Wed April 23, 2025 09:33 PM

    OK.  So I had no problem building a deployment policy to change the host in a member on a Load Balancer group.

    Try this:

    <ModifiedConfig>
        <Match>*/*/network/loadbalancer-group?Name=LBGroupName&amp;Property=LBGroupMembers/Server&amp;Value=uat.com</Match>
        <Type>change</Type>
        <Property/>
        <Value>prod.com</Value>
    </ModifiedConfig>
    <ModifiedConfig>
        <Match>*/*/network/loadbalancer-group?Name=LBGroupName&amp;Property=LBGroupMembers/Server&amp;Value=uat02.com</Match>
        <Type>change</Type>
        <Property/>
        <Value>prod02.com</Value>
    </ModifiedConfig>



    ------------------------------
    Joseph Morgan
    CEO - Independent
    ------------------------------



  • 5.  RE: Load balancer group members value change as per environment.

    Posted Thu April 24, 2025 01:22 AM

    We were trying with uat*01.com and uat*02.com like this but after giving actual values( uat-dev-01.com and uat-dev-02.com) issue is resolved now.
    Thank you so much for diving into this with prompt response. Really appreciate.
    Thank you.!



    ------------------------------
    Snehal Yadav
    ------------------------------



  • 6.  RE: Load balancer group members value change as per environment.

    Posted Thu April 24, 2025 01:59 PM

    No problem.  I'm glad you have it working.

    One thing to keep in mind is the match expression for a deployment policy is a PCRE.  So, in your case, when you enter "uat*01.com", you're effectively describing any member host having a name beginning with "ua", then optionally one or more "t"'s, followed by "01.com".   So, "ua01.com", "uat01.com", "uatt01.com", ..., "uattttttt01.com", etc.   Had you entered, "uat.+?01.com", it would have matched.  This expression describes any member host having a name beginning with "uat" followed by any number of characters (the '?' preventing it from being too greedy), followed by "01.com". 



    ------------------------------
    Joseph Morgan
    CEO - Independent
    ------------------------------