I got around this issue with a loop (below) that runs each task one at a time remotely, running a new task when a previous task completes. This lets you assign multiple tasks under the same job to the same host (I am distributing a couple hundred tests across a dozen hosts with this method). Sounds like what you need.
The following code assumes you have already created a job with a long list of tasks, with multiple tasks assigned to the same host. You can do this programmatically.
function RunJob(jobName)
{
// keep track of the Task row number for each host
var runningHosts = new ActiveXObject("Scripting.Dictionary");
// run through the list of tasks and begin the first one for each host
var tasks = NetworkSuite.Jobs.ItemByName(jobName).Tasks;
for (var i = 0; i < tasks.Count; i++)
{
var task = tasks.Items(i);
var hostName = task.Host.Name;
if (task.Active && !runningHosts.Exists(hostName))
{
runningHosts.Add(hostName, i);
task.Run(false);
}
}
// periodically check the list of tasks and see if one is finished
var done = false;
while (!done)
{
aqUtils.Delay(60000);
var hostNames = runningHosts.Keys().toArray();
for (var j = 0; j < runningHosts.Count; j++)
{
var hostName = hostNames[j];
var lastTaskIndex = runningHosts.Item(hostName);
var lastTask = tasks.Items(lastTaskIndex);
if (lastTask.State == ns_Idle) // is the last task for this host finished?
{
// find the next task for this host and run it
var i = lastTaskIndex + 1;
for (; i < tasks.Count; i++)
{
var task = tasks.Items(i);
var taskHostName = task.Host.Name;
if (task.Active && taskHostName == hostName)
{
runningHosts.Item(hostName) = i;
task.Run(false);
break;
}
}
// check if this host is finished with all tasks
// if so, remove it from the dictionary
if (i == tasks.Count)
{
runningHosts.Remove(hostName);
if (runningHosts.Count == 0)
done = true;
break; // jumps back to the while loop
}
}
}
}
}