code: func (a *Agent) makeNodeID() (string, error) {
  	// If they've disabled host-based IDs then just make a random one.
  	if a.config.DisableHostNodeID {
  		return a.makeRandomID()
  	}
  
  	// Try to get a stable ID associated with the host itself.
  	info, err := host.Info()
  	if err != nil {
  		a.logger.Printf("[DEBUG] agent: Couldn't get a unique ID from the host: %v", err)
  		return a.makeRandomID()
  	}
  
  	// Make sure the host ID parses as a UUID, since we don't have complete
  	// control over this process.
  	id := strings.ToLower(info.HostID)
  	if _, err := uuid.ParseUUID(id); err != nil {
  		a.logger.Printf("[DEBUG] agent: Unique ID %q from host isn't formatted as a UUID: %v",
  			id, err)
  		return a.makeRandomID()
  	}
  
  	// Hash the input to make it well distributed. The reported Host UUID may be
  	// similar across nodes if they are on a cloud provider or on motherboards
  	// created from the same batch.
  	buf := sha512.Sum512([]byte(id))
  	id = fmt.Sprintf("%08x-%04x-%04x-%04x-%12x",
  		buf[0:4],
  		buf[4:6],
  		buf[6:8],
  		buf[8:10],
  		buf[10:16])
  
  	a.logger.Printf("[DEBUG] agent: Using unique ID %q from host as node ID", id)
  	return id, nil
  }
docs: // makeNodeID will try to find a host-specific ID, or else will generate a
  // random ID. The returned ID will always be formatted as a GUID. We don't tell
  // the caller whether this ID is random or stable since the consequences are
  // high for us if this changes, so we will persist it either way. This will let
  // gopsutil change implementations without affecting in-place upgrades of nodes.