def Prepare(benchmark_spec):
  benchmark_spec.always_call_cleanup = True
  vms = benchmark_spec.vms

  # TODO: in the future, it might be nice to chagne this so that
  # a gcp_bigtable.GcpBigtableCluster can be created with an
  # flag that says don't create/delete the cluster.  That would
  # reduce the code paths here.
  if FLAGS.google_bigtable_cluster_name is None:
    cluster_name = 'pkb-bigtable-{0}'.format(FLAGS.run_uri)
    project = FLAGS.project or _GetDefaultProject()
    logging.info('Creating bigtable cluster %s', cluster_name)
    zone = FLAGS.google_bigtable_zone_name
    benchmark_spec.bigtable_cluster = gcp_bigtable.GcpBigtableCluster(
        cluster_name, CLUSTER_SIZE, project, zone)
    benchmark_spec.bigtable_cluster.Create()
    cluster = _GetClusterDescription(project,
                                     FLAGS.google_bigtable_zone_name,
                                     cluster_name)
    logging.info('Cluster %s created successfully', cluster)

  vm_util.RunThreaded(_Install, vms)

  # Create table
  hbase_ycsb.CreateYCSBTable(vms[0], table_name=_GetTableName(),
                             use_snappy=False, limit_filesize=False)
Prepare the virtual machines to run cloud bigtable.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/cloud_bigtable_ycsb_benchmark.py/Prepare