예제 #1
0
def Prepare(benchmark_spec):
    """Install SPEC SFS 2014.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
    gluster_servers = benchmark_spec.vm_groups['gluster_servers']
    clients = benchmark_spec.vm_groups['clients']
    prime_client = clients[0]

    # Set up Gluster
    if gluster_servers:
        gluster.ConfigureServers(gluster_servers, _VOLUME_NAME)

        args = [((client, gluster_servers[0], _VOLUME_NAME, _MOUNT_POINT), {})
                for client in clients]
        vm_util.RunThreaded(gluster.MountGluster, args)

    # Set up SPEC
    vm_util.RunThreaded(_PrepareSpec, clients)

    # Create a backup of the config file.
    prime_client.RemoteCommand('cp {0} {0}.bak'.format(
        posixpath.join(_SPEC_DIR, _SPEC_CONFIG)))

    prime_client.AuthenticateVm()
    # Make sure any Static VMs are setup correctly.
    for client in clients:
        prime_client.TestAuthentication(client)
def Prepare(benchmark_spec):
    """Install SPEC SFS 2014.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
        required to run the benchmark.
  """
    gluster_servers = benchmark_spec.vm_groups['gluster_servers']
    clients = benchmark_spec.vm_groups['clients']
    prime_client = clients[0]

    # Set up Gluster
    if gluster_servers:
        gluster.ConfigureServers(gluster_servers, _VOLUME_NAME)

        args = [((client, gluster_servers[0], _VOLUME_NAME, _MOUNT_POINT), {})
                for client in clients]
        vm_util.RunThreaded(gluster.MountGluster, args)

    # Set up SPEC
    vm_util.RunThreaded(_PrepareSpec, clients)

    if FLAGS.specsfs2014_config:
        prime_client.PushFile(data.ResourcePath(FLAGS.specsfs2014_config),
                              posixpath.join(_SPEC_DIR, _SPEC_CONFIG))
    else:
        _ConfigureSpec(prime_client, clients)

    prime_client.AuthenticateVm()
    # Make sure any Static VMs are setup correctly.
    for client in clients:
        prime_client.TestAuthentication(client)
def Prepare(benchmark_spec):
    """Set up GlusterFS and install fio.

  Args:
    benchmark_spec: The benchmark specification. Contains all data that is
      required to run the benchmark.
  """
    gluster_servers = benchmark_spec.vm_groups['gluster_servers']
    clients = benchmark_spec.vm_groups['clients']
    client_vm = clients[0]

    vm_util.RunThreaded(lambda vm: vm.Install('fio'),
                        gluster_servers + clients)
    for vm in gluster_servers:
        vm.SetReadAhead(_NUM_SECTORS_READ_AHEAD,
                        [d.GetDevicePath() for d in vm.scratch_disks])

    # Set up Gluster
    if gluster_servers:
        gluster.ConfigureServers(gluster_servers, _VOLUME_NAME)

        args = [((client, gluster_servers[0], _VOLUME_NAME, _MOUNT_POINT), {})
                for client in clients]
        vm_util.RunThreaded(gluster.MountGluster, args)

        gluster_address = gluster_servers[0].internal_ip
        client_vm.RemoteCommand('sudo mkdir -p /testdir')
        client_vm.RemoteCommand('sudo mount %s:/vol01 /testdir -t glusterfs' %
                                gluster_address)