def run_all_tasks(app, vms):
    hosts = []
    host_info = {}
    appname = app['name'].split(':')[1]
    for appdef in env.manifest['applications']:
        if appdef['name'] == appname:
            break
    else:
        error.raise_error('Application definition not found?')

    for vm in app['vms']:
        if vm['name'] not in vms:
            continue
        ipaddr = vm['dynamicMetadata']['externalIp']
        hosts.append(ipaddr)
        host_info[ipaddr] = vm['name']

    env.test_id = os.urandom(16).encode('hex')
    console.info('Starting run `{0}`.', env.test_id)
    env.host_info = host_info
    env.start_time = int(time.time())
    env.lock = multiprocessing.Lock()
    manager = multiprocessing.Manager()
    env.shared_state = manager.dict()
    for vmname in vms:
        vmstate = {}
        vmstate['exited'] = False
        vmstate['completed_tasks'] = {}
        vmstate['shell_env_update'] = {}
        env.shared_state[vmname] = vmstate
    env.appdef = appdef
    env.application = app
    env.vms = vms

    fab.env.user = 'ravello'
    fab.env.key_filename = env.private_key_file
    fab.env.disable_known_hosts = True
    fab.env.remote_interrupt = True
    fab.env.hosts = hosts
    fab.env.parallel = True
    fab.env.output_prefix = env.debug
    fabric.state.output.running = env.debug
    fabric.state.output.output = True
    fabric.state.output.status = env.debug

    # This is where it all happens...
    noun = inflect.plural_noun('virtual machine', len(vms))
    console.info('Executing tasks on {0} {1}...', len(vms), noun)

    fabric.tasks.execute(run_tasklist, env)

    errors = set()
    for vmname in vms:
        vmstate = env.shared_state[vmname]
        for taskname,status in vmstate['completed_tasks'].items():
            if status != 0:
                errors.add('`{0}` on `{1}`'.format(taskname, vmname))

    if not errors:
        console.info('All tasks were executed succesfully!')
    else:
        what = inflect.plural_noun('task', len(errors))
        errapps = ', '.join(errors)
        console.error('The following {0} failed: {1}', what, errapps)

    fabric.network.disconnect_all()
    return len(errors)
Run the runbook for an application ``app``.
dataset/ETHPy150Open ravello/testmill/lib/testmill/tasks.py/run_all_tasks