diff --git a/lib/backend.py b/lib/backend.py
index 2c5471b861b4ba37afd975a6141d61f1417bd199..abe6b3944b7358e9d74e3a1fc7283e9911428e85 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -110,7 +110,7 @@ class RPCFail(Exception):
   """
 
 
-def GetInstReasonFilename(instance_name):
+def _GetInstReasonFilename(instance_name):
   """Path of the file containing the reason of the instance status change.
 
   @type instance_name: string
@@ -122,6 +122,22 @@ def GetInstReasonFilename(instance_name):
   return utils.PathJoin(pathutils.INSTANCE_REASON_DIR, instance_name)
 
 
+def _StoreInstReasonTrail(instance_name, trail):
+  """Serialize a reason trail related to an instance change of state to file.
+
+  The exact location of the file depends on the name of the instance and on
+  the configuration of the Ganeti cluster defined at deploy time.
+
+  @type instance_name: string
+  @param instance_name: The name of the instance
+  @rtype: None
+
+  """
+  json = serializer.DumpJson(trail)
+  filename = _GetInstReasonFilename(instance_name)
+  utils.WriteFile(filename, data=json)
+
+
 def _Fail(msg, *args, **kwargs):
   """Log an error and the raise an RPCFail exception.