#NEWLINE# def Prepare( benchmark_spec ) : #NEWLINE# #INDENT# 'Prepare the virtual machine to run FIO.\n\n     This includes installing fio, bc, and libaio1 and pre-filling the\n     attached disk. We also make sure the job file is always located\n     at the same path on the local machine.\n\n  Args:\n    benchmark_spec: The benchmark specification. Contains all data that is\n        required to run the benchmark.\n\n  ' #NEWLINE# WarnOnBadFlags ( ) #NEWLINE# vm = benchmark_spec . vms [ 0 ] #NEWLINE# logging . info ( 'FIO prepare on %s' , vm ) #NEWLINE# vm . Install ( 'fio' ) #NEWLINE# disk = vm . scratch_disks [ 0 ] #NEWLINE# if FillTarget ( ) : #NEWLINE# #INDENT# logging . info ( 'Fill device %s on %s' , disk . GetDevicePath ( ) , vm ) #NEWLINE# FillDevice ( vm , disk , FLAGS . fio_fill_size ) #NEWLINE# #UNINDENT# if ( FLAGS . fio_target_mode == AGAINST_FILE_WITH_FILL_MODE ) : #NEWLINE# #INDENT# disk . mount_point = ( FLAGS . scratch_dir or MOUNT_POINT ) #NEWLINE# vm . FormatDisk ( disk . GetDevicePath ( ) ) #NEWLINE# vm . MountDisk ( disk . GetDevicePath ( ) , disk . mount_point )