Automatic change “Max Server Memory” value if a Failover occurs

For Spanish version visit this link Cambiar automáticamente el valor de “Max Server Memory” si ocurre un Failover
In one of our environments, we have a cluster with two active-active nodes with one SQL Server instance in each one.
During this week, a fail of the service occurred in one of the nodes, which caused a failover to the node that was available.
The problem that we found was that the node only have 25GB of RAM memory and the value of “Max Server Memory” assigned for each instance was 20GB, so we have the risk that if the two instances beginning to need more RAM memory would come a moment that the Windows OS would lose performance.
  Read more of this post