Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit 537ed28

Browse files
committed
run.py: adding --mid argument to set the machine id explicitly
Signed-off-by: Reto Achermann <achreto@gmail.com>
1 parent 2e929a7 commit 537ed28

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kernel/run.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ def get_network_config(workers):
107107
# DCM Scheduler arguments
108108
parser.add_argument("--dcm-path",
109109
help='Path of DCM jar to use (defaults to latest release)', required=False, default=None)
110+
parser.add_argument("--mid",
111+
help="Machine id to set for this instance", required=False, default=None)
110112

111113
# QEMU related arguments
112114
parser.add_argument("--qemu-nodes", type=int,
@@ -332,7 +334,10 @@ def deploy(args):
332334
# Append globally unique machine id to cmd (for rackscale)
333335
# as well as a number of workers (clients)
334336
if args.cmd and NETWORK_CONFIG[args.tap]['mid'] != None:
335-
args.cmd += " mid={}".format(NETWORK_CONFIG[args.tap]['mid'])
337+
if args.mid is None :
338+
args.cmd += " mid={}".format(NETWORK_CONFIG[args.tap]['mid'])
339+
else :
340+
args.cmd += f" mid={args.mid}"
336341
if is_controller or is_client:
337342
args.cmd += " workers={}".format(args.workers)
338343
# Write kernel cmd-line file in ESP dir

0 commit comments

Comments
 (0)