Automatic Service Profile Fail-Over

Version 2

    One of the great things about UCS Manager is that you have complete access to the Management Information Tree (configuration management database) for a UCS domain that can scale to 160 servers.  Integrators can use the client integration technology of their choice to configure, manage and monitor a UCS domain.  This allows integrators to focus on the problem they wish to solve, rather than the intricacies of a proprietary interface.  A great example of this ease of integration is the automatic service profile fail-over script that I demonstrated at Cisco Live.    You can download the sample code from here:  MonitorSp.

     

    The script periodically polls the UCS Manager to determine the health of a named service profile.  If the physical server associated with the service profile has a fatal fault (based on a csv file of fatal faults), the script will decommission the server.  When a server is decommissioned and the service profile is associated with a compute pool, UCS Manager will automatically associate the service profile with another available server.    It is quite impressive that this advanced functionality is based on only 5 PowerTool cmdlets:

     

    Get Service Profile Hierarchy:

    $lSpMos = (Get-UcsServiceProfile -dn $aInSpDn -hierarchy)     

     

    Get Compute Hierarchy:

    $lBladeMos = (Get-UcsManagedObject -dn $aInDn -hierarchy)

     

    Delete our requirement: 

    Get-UcsServiceProfile -dn $aInSpDn | Disconnect-UcsServiceProfile -force

     

    Decomission our server:

    Set-UcsManagedObject -force -XmlTag computeBlade -PropertyMap @{dn = $lPnDn ; lc= "decommission"}

     

    Associate a service profile with a server:

    Get-UcsServiceProfile -dn $aInSpDn | Associate-UcsServiceProfile -ServerPoolName $lPoolName -force

     

    This script illustrates some real UCS product differentiators:

    • UCS Manager can be used to quickly repurpose hardware, expand computing capacity, and replace failed hardware resources;
    • Service profiles can assure that hardware configuration is identical right down to the bios settings and firmware versions;
    • UCS faults can be easily queried and are automatically correlated (faults are children of the affected object);
    • Server pools provide a means to identity migration targets ahead of time; The personality of the server is applied at association time.

     

    Please note that this script was created for illustrative purposes only (so, run it on your UCS Platform Emulator and not your production network!) Creating a robust and fault tolerant UCS deployment is an involed problem and will often include:

    • Monitoring server health - snmp, call-home, querying faults and statistics;        
    • Integration with software stack - both application and process monitoring;
    • Safety mechanisms: throttling migration, integration with existing monitoring processes (to prevent compounding the problem);

     

    Enjoy  Ike