code: func EnsureKVMs(c context.Context, cfgs []*config.Datacenter, platformIds, rackIds map[string]int64) (map[string]int64, error) {
  	t := &KVMsTable{}
  	t.platforms = platformIds
  	t.racks = rackIds
  	if err := t.fetch(c); err != nil {
  		return nil, errors.Annotate(err, "failed to fetch KVMs").Err()
  	}
  	if err := t.computeChanges(c, cfgs); err != nil {
  		return nil, errors.Annotate(err, "failed to compute changes").Err()
  	}
  	if err := t.add(c); err != nil {
  		return nil, errors.Annotate(err, "failed to add KVMs").Err()
  	}
  	if err := t.remove(c); err != nil {
  		return nil, errors.Annotate(err, "failed to remove KVMs").Err()
  	}
  	if err := t.update(c); err != nil {
  		return nil, errors.Annotate(err, "failed to update KVMs").Err()
  	}
  	return t.ids(c), nil
  }
docs: // EnsureKVMs ensures the database contains exactly the given KVMs.
  // Returns a map of KVM names to IDs in the database.