code: func deleteVM(c context.Context, id, hostname string) error {
  	vm := &model.VM{
  		ID: id,
  	}
  	return datastore.RunInTransaction(c, func(c context.Context) error {
  		switch err := datastore.Get(c, vm); {
  		case err == datastore.ErrNoSuchEntity:
  			return nil
  		case err != nil:
  			return errors.Annotate(err, "failed to fetch VM").Err()
  		case vm.Hostname != hostname:
  			logging.Debugf(c, "VM %q does not exist", hostname)
  			return nil
  		}
  		if err := datastore.Delete(c, vm); err != nil {
  			return errors.Annotate(err, "failed to delete VM").Err()
  		}
  		return nil
  	}, nil)
  }
docs: // deleteVM deletes the given VM from the datastore if it exists.