code: func expandConfig(c context.Context, payload proto.Message) error {
  	task, ok := payload.(*tasks.ExpandConfig)
  	switch {
  	case !ok:
  		return errors.Reason("unexpected payload type %T", payload).Err()
  	case task.GetId() == "":
  		return errors.Reason("ID is required").Err()
  	}
  	cfg, err := getConfig(c).Get(c, &config.GetRequest{Id: task.Id})
  	if err != nil {
  		return errors.Annotate(err, "failed to fetch config").Err()
  	}
  	now := clock.Now(c)
  	amt, err := cfg.Amount.GetAmount(now)
  	if err != nil {
  		return errors.Annotate(err, "failed to parse amount").Err()
  	}
  	t := make([]*tq.Task, amt)
  	for i := int32(0); i < amt; i++ {
  		t[i] = &tq.Task{
  			Payload: &tasks.CreateVM{
  				Id:         fmt.Sprintf("%s-%d", cfg.Prefix, i),
  				Attributes: cfg.Attributes,
  				Config:     task.Id,
  				Created: &timestamp.Timestamp{
  					Seconds: now.Unix(),
  				},
  				Index:    i,
  				Lifetime: cfg.Lifetime.GetSeconds(),
  				Prefix:   cfg.Prefix,
  				Revision: cfg.Revision,
  				Swarming: cfg.Swarming,
  				Timeout:  cfg.Timeout.GetSeconds(),
  			},
  		}
  	}
  	logging.Debugf(c, "creating %d VMs", len(t))
  	if err := getDispatcher(c).AddTask(c, t...); err != nil {
  		return errors.Annotate(err, "failed to schedule tasks").Err()
  	}
  	return nil
  }
docs: // expandConfig creates task queue tasks to create each VM in the given config.