private void createTasks(boolean skipFailure) {
    // high level topology tasks such as INSTALL, START, ...
    topologyTasks.add(new PersistHostResourcesTask(topology, this));
    topologyTasks.add(new RegisterWithConfigGroupTask(topology, this));

    InstallHostTask installTask = new InstallHostTask(topology, this, skipFailure);
    topologyTasks.add(installTask);
    logicalTaskMap.put(installTask, new HashMap<>());

    boolean skipStartTaskCreate = topology.getProvisionAction().equals(INSTALL_ONLY);
    boolean skipInstallTaskCreate = topology.getProvisionAction().equals(START_ONLY);

    StartHostTask startTask = null;
    if (!skipStartTaskCreate) {
      startTask = new StartHostTask(topology, this, skipFailure);
      topologyTasks.add(startTask);
      logicalTaskMap.put(startTask, new HashMap<>());
    } else {
      LOG.info("Skipping Start task creation since provision action = " + topology.getProvisionAction());
    }

    // lower level logical component level tasks which get mapped to physical tasks
    HostGroup hostGroup = getHostGroup();
    Collection<String> startOnlyComponents = hostGroup.getComponentNames(START_ONLY);
    Collection<String> installOnlyComponents = hostGroup.getComponentNames(INSTALL_ONLY);
    Collection<String> installAndStartComponents = hostGroup.getComponentNames(INSTALL_AND_START);

    for (String component : hostGroup.getComponentNames()) {
      if (component == null || component.equals("AMBARI_SERVER")) {
        LOG.info("Skipping component {} when creating request\n", component);
        continue;
      }

      String hostName = getHostName() != null ?
          getHostName() :
          "PENDING HOST ASSIGNMENT : HOSTGROUP=" + getHostgroupName();

      AmbariContext context = topology.getAmbariContext();
      Stack stack = hostGroup.getStack();

      // Skip INSTALL task in case server component is marked as START_ONLY, or the cluster provision_action is
      // START_ONLY, unless component is marked with INSTALL_ONLY or INSTALL_AND_START.
      if (startOnlyComponents.contains(component) || (skipInstallTaskCreate &&
        !installOnlyComponents.contains(component) && !installAndStartComponents.contains(component))
          && stack != null && !stack.getComponentInfo(component).isClient()) {
        LOG.info("Skipping create of INSTALL task for {} on {}.", component, hostName);
      } else {
        HostRoleCommand logicalInstallTask = context.createAmbariTask(
          getRequestId(), id, component, hostName, AmbariContext.TaskType.INSTALL, skipFailure);
        logicalTasks.put(logicalInstallTask.getTaskId(), logicalInstallTask);
        logicalTaskMap.get(installTask).put(component, logicalInstallTask.getTaskId());
      }

      // Skip START task if component is a client, or ir marked as INSTALL_ONLY or cluster provision_action is
      // INSTALL_ONLY
      if (installOnlyComponents.contains(component) || skipStartTaskCreate ||
        (stack != null && stack.getComponentInfo(component).isClient())) {
        LOG.info("Skipping create of START task for {} on {}.", component, hostName);
      } else {
        HostRoleCommand logicalStartTask = context.createAmbariTask(
            getRequestId(), id, component, hostName, AmbariContext.TaskType.START, skipFailure);
        logicalTasks.put(logicalStartTask.getTaskId(), logicalStartTask);
        logicalTaskMap.get(startTask).put(component, logicalStartTask.getTaskId());
      }
    }
  }
Only to be used when replaying persisted requests upon server startup.

@param requestId    logical request id
@param id           host request id
@param predicate    host predicate
@param topology     cluster topology
@param entity       host request entity
ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java