You can use the OnlineRetryLimit attribute to specify the number of retries that the agent should perform to bring the resource online.