From 1197c0b678e45222e41183a538340ae1806b839c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 5 Jul 2022 17:34:32 +0200 Subject: [dnbd3/vmstore] Add selection for DNBD3 server, or NFS mode, show any errors --- modules-available/vmstore/inc/vmstorebenchmark.inc.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'modules-available/vmstore/inc/vmstorebenchmark.inc.php') diff --git a/modules-available/vmstore/inc/vmstorebenchmark.inc.php b/modules-available/vmstore/inc/vmstorebenchmark.inc.php index 10c55431..3a696d04 100644 --- a/modules-available/vmstore/inc/vmstorebenchmark.inc.php +++ b/modules-available/vmstore/inc/vmstorebenchmark.inc.php @@ -25,12 +25,12 @@ class VmStoreBenchmark /** * @param array $machineUuids - * @param string $image - * @param bool $nfs + * @param string $image relative path/name of image + * @param string $serverOrMode IP address of DNBD3 server, OR 'auto' for all servers known to client, or 'nfs' for NFS * @param int $start timestamp when the clients should start * @return ?string taskId, or null on error */ - public static function start(string $id, array $machineUuids, string $image, bool $nfs, int &$start) + public static function start(string $id, array $machineUuids, string $image, string $serverOrMode, int &$start) { Module::isAvailable('rebootcontrol'); $clients = Database::queryAll('SELECT machineuuid, clientip FROM machine WHERE machineuuid IN (:uuids)', @@ -41,7 +41,13 @@ class VmStoreBenchmark // The more clients we have, the longer it takes to SSH into all of them. // As of 2022, RemoteExec processes 4 clients in parallel $start = ceil(count($clients) / 4 + 5 + time()); - $nfsOpt = $nfs ? '--nfs' : ''; + if ($serverOrMode === 'nfs') { + $modeOption = '--nfs'; + } elseif ($serverOrMode === 'auto') { + $modeOption = ''; + } else { + $modeOption = "--servers '$serverOrMode'"; + } // We fork off the benchmark into the background, and collect the results with another RemoteExec job // when we're done. This is because RemoteExec only does four concurrent SSH connections, so if we wanted to // do this the easy, synchronous way, we never could run more than four tests at the same time. @@ -49,7 +55,7 @@ class VmStoreBenchmark ( exec &> /dev/null < /dev/null setsid -image_speedcheck --start $start --console $nfsOpt --file "$image" > "/tmp/speedcheck-$id" +image_speedcheck --start $start --console $modeOption --file "$image" > "/tmp/speedcheck-$id" ) & COMMAND; $task = RebootControl::runScript($clients, $command); -- cgit v1.2.3-55-g7522