def ModifyInstanceMetadata(metadata):
  if not constants.ENABLE_METAD:
    raise errors.ProgrammerError("The metadata deamon is disabled, yet"
                                 " ModifyInstanceMetadata has been called")

  if not utils.IsDaemonAlive(constants.METAD):
    result = utils.RunCmd([pathutils.DAEMON_UTIL, "start", constants.METAD])
    if result.failed:
      raise errors.HypervisorError("Failed to start metadata daemon")

  with contextlib.closing(metad.Client()) as client:
    client.UpdateConfig(metadata)
Sends instance data to the metadata daemon.
dataset/ETHPy150Open ganeti/ganeti/lib/backend.py/ModifyInstanceMetadata