def runPhase(self, count, op): for blocksize in self.blocksizes: # TODO we don't support pre-defined access patterns with 'latency', only integer block sizes blocksize = int(blocksize) # Run synexec master proc, port = libsynexec.start_master_on_controller(self.runPhasePrepareCommand(blocksize, op), self.jobid, len(self.vm)) for vm in self.vm: libsynexec.start_slave(vm, self.jobid, port) proc.wait() # Fetch results from slaves for vm in self.vm: for j in range(self.vbds_per_vm): results = vm.execguest("cat /root/out-%s" % chr(ord('b') + j)) for line in results.splitlines(): # Log format: Operation(r,w) iteration, blocksize, diskname, VM number on that SR, VBD number, number of bytes processed self.log("slave", "%s %d %d %s %s %d %s" % (op, count + 1, blocksize, vm.getName().split("-")[0], vm.getName().split("-")[1], j, line)) # Fetch log from master results = libsynexec.get_master_log_on_controller(self.jobid) for line in results.splitlines(): self.log("master", "%d %s" % (blocksize, line))
def invokeClients(self, host): # Run synexec master proc, port = libsynexec.start_master_on_controller("/bin/sh /root/synexec_cmd", self.jobid, self.numclients) # After all the servers have booted, set up synexec slave in each of the client VMs for i in range(0, self.numclients): # Write a file containing the apachebench command, pointing it at the relevant server VM target = self.servervms[i].getIP() self.clientvms[i].execguest("echo '%s' > /root/synexec_cmd" % (self.abCmd % target)) # Wait for the synexec master to tell this VM to run the apachebench command libsynexec.start_slave(self.clientvms[i], self.jobid, port) # Wait for jobs to complete proc.wait() # Fetch results from slaves for i in range (0, self.numclients): logFileRemote = "/root/ab.log" logFileLocal = "%s/ab-%d.log" % (xenrt.TEC().getLogdir(), i) sftp = self.clientvms[i].sftpClient() sftp.copyFrom(logFileRemote, logFileLocal) # Fetch log from master results = libsynexec.get_master_log_on_controller(self.jobid) self.log("synexec_master", "%s" % results)
def runPhase(self, count, op): for blocksize in self.blocksizes: # TODO we don't support pre-defined access patterns with 'latency', only integer block sizes blocksize = int(blocksize) # Run synexec master proc, port = libsynexec.start_master_on_controller( self.runPhasePrepareCommand(blocksize, op), self.jobid, len(self.vm)) for vm in self.vm: libsynexec.start_slave(vm, self.jobid, port) proc.wait() # Fetch results from slaves for vm in self.vm: for j in range(self.vbds_per_vm): results = vm.execguest("cat /root/out-%s" % chr(ord('b') + j)) for line in results.splitlines(): # Log format: Operation(r,w) iteration, blocksize, diskname, VM number on that SR, VBD number, number of bytes processed self.log( "slave", "%s %d %d %s %s %d %s" % (op, count + 1, blocksize, vm.getName().split("-")[0], vm.getName().split("-")[1], j, line)) # Fetch log from master results = libsynexec.get_master_log_on_controller(self.jobid) for line in results.splitlines(): self.log("master", "%d %s" % (blocksize, line))