Client Management - Load balance devices across relays - USE WITH CAUTION

Version 2
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    BMC Client Management


    COMPONENT:

    Client Management


    APPLIES TO:

    BCM >= 12.0



    QUESTION:

    How to load balance client distribution across several relays?


    ANSWER:

    The enhancement request DRZKZ-5267 has been created to have an automatic load balancing for relays. Until this has been implemented the following can be setup to dispatch clients to relays.

    A) First possibility you have several Relays and you want to assign same amount of devices to them :

    1. Create a free query  for each one of your relays using the queries below.  Each query is increased by 1  for the value  CHAR(1))=

    Query for Relay 1
        SQL Server Query:
            Select DeviceName from Devices where TopologyType= '_DB_DEVTYPE_CLIENT_'  and
            CAST(([DeviceID]% (select COUNT(*) from Devices where Devices.TopologyType='_DB_DEVTYPE_RELAY_')+1) as INT)=1

        Oracle Query:
            Select DeviceName from Devices where Devices.TopologyType='_DB_DEVTYPE_CLIENT_'
            and trunc(( DeviceID) / ((select COUNT(DeviceID) from Devices where Devices.TopologyType='_DB_DEVTYPE_RELAY_')+1))=1


    Query for Relay 2
        SQL Server Query:
            Select DeviceName from Devices where TopologyType= '_DB_DEVTYPE_CLIENT_'  and
            CAST(([DeviceID]% (select COUNT(*) from Devices where Devices.TopologyType='_DB_DEVTYPE_RELAY_')+1) as INT)=2

        Oracle Query:
            Select DeviceName from Devices where Devices.TopologyType='_DB_DEVTYPE_CLIENT_'
            and trunc(( DeviceID) / ((select COUNT(DeviceID) from Devices where Devices.TopologyType='_DB_DEVTYPE_RELAY_')+1))=2


    Query for Relay 3
        SQL Server Query:
            Select DeviceName from Devices where TopologyType= '_DB_DEVTYPE_CLIENT_'  and
            CAST(([DeviceID]% (select COUNT(*) from Devices where Devices.TopologyType='_DB_DEVTYPE_RELAY_')+1) as INT)=3

        Oracle Query:
            Select DeviceName from Devices where Devices.TopologyType='_DB_DEVTYPE_CLIENT_'
            and trunc(( DeviceID) / ((select COUNT(DeviceID) from Devices where Devices.TopologyType='_DB_DEVTYPE_RELAY_')+1))=3

        
      
    ( repeat the query just increase the CHAR(1) value if you have more relays) 

    2. From each one of these queries you would then create a device group  

    3.  You would then create an operational rule for each relay .  The operational rule would be the step 'Relay Module Setup'  that points to the specific relay the operational rule is for.    

    4.  Assign the operational rule to the device group that matches the relay it was created for  


    This will update the devices and point them to the relay that was assigned to them via the query.   For this to work correctly you have to make sure the relays you plan on using are the only relays  and you create a query for each one. 



    B) Second possibility, You can manage all your devices with two Relays only:  

    In this example, there is only one Rollout configuration and devices are connected to Master after installation. This is why this query only focus to devices having ParentID=1000.

    1. Create a free query for each one of your two relays using the queries below.
    Then two device groups are populated depending on "where  DeviceID > ss.MAXDEVID" or "where  "DeviceID < ss.MAXDEVID"  :

      

        Oracle Query:
            select DeviceID,DeviceName from Devices, ( select max(trunc((ds.DeviceID-1000)/2) +1000) as MAXDEVID from Devices ds where TopologyType = '_DB_DEVTYPE_CLIENT_' and ParentID =1000 ) SS
            where  DeviceID > ss.MAXDEVID and TopologyType = '_DB_DEVTYPE_CLIENT_' and ParentID =1000 order by DeviceID

    2. From each one of these queries you would then create a device group 

    3.  You would then create an operational rule for each relay.  The operational rule would be the step 'Relay Module Setup' that points to the specific relay the operational rule is for.   

    4.  Assign the operational rule to the device group that matches the relay it was created for 

     


    Article Number:

    000140295


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles