code: func setCreated(c context.Context, id, url string, at time.Time) error {
  	vm := &model.VM{
  		ID: id,
  	}
  	return datastore.RunInTransaction(c, func(c context.Context) error {
  		if err := datastore.Get(c, vm); err != nil {
  			return errors.Annotate(err, "failed to fetch VM").Err()
  		}
  		if vm.URL != "" {
  			// Already created.
  			return nil
  		}
  		vm.Created = at.Unix()
  		vm.URL = url
  		if err := datastore.Put(c, vm); err != nil {
  			return errors.Annotate(err, "failed to store VM").Err()
  		}
  		return nil
  	}, nil)
  }
docs: // setCreated sets the GCE instance as created in the datastore if it isn't already.