Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/plugins/multilab.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ Use the system-wide _netlab_ status file if multiple users start lab instances o
All _netlab_ users should be able to write to the _netlab_ status file and the parent directory.
```

_netlab_ locks the status file every time a lab instance changes its status, and gives up if it cannot get the lock within three seconds (*Cannot lock lab status file*). When many lab instances start or stop at the same time, increase the timeout with the **‌defaults.lab_status_lock_timeout** parameter (in seconds), for example:

```
defaults.lab_status_lock_timeout: 10
```

**Dynamic labs:** Users can run multiple lab instances, including several instances of the same lab topology. Each instance still needs a unique multilab ID that has to be allocated by an external system that passes **defaults.multilab.id** to _netlab_.

```{tip}
Expand Down
2 changes: 1 addition & 1 deletion netsim/utils/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def change_status(topology: Box, callback: typing.Callable[[Box,Box], None]) ->
log.fatal(f'Cannot create lab status directory {status_dir}')

try: # Try to lock the status file
lock = FileLock(lock_file, timeout=3)
lock = FileLock(lock_file, timeout=topology.defaults.get('lab_status_lock_timeout',3))
lock.acquire()
if os.path.exists(status_file): # If the status file exists, read it
try:
Expand Down
Loading