Citrix The Independent Management Architecture service terminated with service-specific error 2147483659

In Citrix Presenstation Server version 4 and 4.5 you may receive the following error messages in the event log.

Event Type: Error
Event Source: Service Control Manager
Event Category: None
Event ID: 7024
Date: 01/08/2011
Time: 15:53:15
User: N/A
Computer: SERVER1
Description:
The Independent Management Architecture service terminated with service-specific error 2147483659 (0x8000000B).

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Event Type: Error
Event Source: IMAService
Event Category: None
Event ID: 3601
Date: 01/08/2011
Time: 15:53:15
User: N/A
Computer: SERVER1
Description:
Failed to load initial plugins with error IMA_RESULT_TIMEOUT

Event Type: Error
Event Source: IMAService
Event Category: None
Event ID: 3609
Date: 01/08/2011
Time: 15:53:15
User: N/A
Computer: SERVER1
Description:
Failed to load plugin ImaRuntimeSS.dll with error IMA_RESULT_TIMEOUT

Event Type: Error
Event Source: IMAService
Event Category: None
Event ID: 3609
Date: 01/08/2011
Time: 15:53:15
User: N/A
Computer: SERVER1
Description:
Failed to load plugin ImaPsSs.dll with error IMA_RESULT_TIMEOUT

Event Type: Error
Event Source: IMAService
Event Category: None
Event ID: 3615
Date: 01/08/2011
Time: 15:53:15
User: N/A
Computer: SERVER1
Description:
The server running MetaFrame Presentation Server failed to connect to the Data Store. Error – IMA_RESULT_TIMEOUT An unknown failure occurred while connecting to the database.

After initial investigation it wasn’t create if the IMA configuration was connecting to the datastore correctly so I followed CTX105257 to check the location of the DSN was correct. After looking through the config for some reason this server wasn’t connecting directly SQL instance but instead was indirectly connecting to another Presentation server which was down and hense the IMA service couldn’t find the datastore. I reconfigure the datastore to be the SQL instance and started the service which ultimately fixed this issue.