def METHOD_NAME(benchmark_spec):
  """Prepare the virtual machines to run YCSB against memcached.
  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
  clients = benchmark_spec.vm_groups['clients']
  assert clients, benchmark_spec.vm_groups
  hosts = []
  if FLAGS.memcached_scenario == 'managed':
    # We need to delete the managed memcached backend when we're done
    benchmark_spec.always_call_cleanup = True
    if FLAGS.memcached_managed == provider_info.GCP:
      raise NotImplementedError("GCP managed memcached backend not implemented "
                                "yet")
    elif FLAGS.memcached_managed == provider_info.AWS:
      cluster_id = 'pkb%s' % FLAGS.run_uri
      service = providers.aws.elasticache.ElastiCacheMemcacheService(
          aws_network.AwsNetwork.GetNetwork(clients[0]),
          cluster_id, FLAGS.memcached_elasticache_region,
          FLAGS.memcached_elasticache_node_type,
          FLAGS.memcached_elasticache_num_servers)
    service.Create()
    hosts = service.GetHosts()
    benchmark_spec.service = service
    benchmark_spec.metadata = service.GetMetadata()
  else:
    # custom scenario
    # Install memcached on all the servers
    servers = benchmark_spec.vm_groups['servers']
    assert servers, 'No memcached servers: {0}'.format(benchmark_spec.vm_groups)
    memcached_install_fns = \
        [functools.partial(memcached_server.ConfigureAndStart, vm)
         for vm in servers]
    background_tasks.RunThreaded(lambda f: f(), memcached_install_fns)
    hosts = ['%s:%s' % (vm.internal_ip, memcached_server.MEMCACHED_PORT)
             for vm in servers]
    benchmark_spec.metadata = {'ycsb_client_vms': FLAGS.ycsb_client_vms,
                               'ycsb_server_vms': len(servers),
                               'cache_size': FLAGS.memcached_size_mb}
  assert len(hosts) > 0
  ycsb_install_fns = [functools.partial(vm.Install, 'ycsb')
                      for vm in clients]
  background_tasks.RunThreaded(lambda f: f(), ycsb_install_fns)
  benchmark_spec.executor = ycsb.YCSBExecutor(
      'memcached',
      **{'memcached.hosts': ','.join(hosts)})