private void createHostTasks(AddServiceInfo request) {
    LOG.info("Creating host tasks for {}", request);

    ProvisionActionPredicateBuilder predicates = new ProvisionActionPredicateBuilder(request);
    for (ProvisionStep step : ProvisionStep.values()) {
      predicates.getPredicate(step).ifPresent(predicate ->
        resourceProviders.updateHostComponentDesiredState(request, predicate, step)
      );
    }

    try {
      request.getStages().persist();
    } catch (AmbariException e) {
      CHECK.wrapInUnchecked(e, IllegalStateException::new, "Error creating host tasks for %s", request);
    }
  }
Creates the service, component and host component resources for the request.
ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java