[Xenial 2.0] tgt fails to start with tgtadm out of memory error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Undecided
|
Unassigned | ||
tgt (Ubuntu) |
Fix Released
|
Medium
|
Christian Ehrhardt |
Bug Description
fresh install of Xenial daily image + MAAS Version 2.0.0 (alpha3+bzr4804.
After image import of 14.04, 15.04, 16.04 images for amd64 and arm64 tgt/tgtadm stops working and fails with out of memory error. The server is a Opteron 6200 with 24 cores and 16Gb of memory. After image import free memory = approx 200Mb. When We only have the Trusty images tgt run just fine. Tried several fresh installs and configurations and all have the same result.
systemctl status tgt.service - WITH ONLY TRUSTY IMAGES:
● tgt.service - (i)SCSI target daemon
Loaded: loaded (/lib/systemd/
Active: active (running) since Thu 2016-03-17 16:42:02 EDT; 50min ago
Docs: man:tgtd(8)
Main PID: 15321 (tgtd)
Status: "Starting event loop..."
Tasks: 145 (limit: 512)
Memory: 1.6M
CPU: 545ms
CGroup: /system.
└─15321 /usr/sbin/tgtd -f
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: device_mgmt(246) sz:102 params:
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: bs_thread_open(409) 16
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: device_mgmt(246) sz:102 params:
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: bs_thread_open(409) 16
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: device_mgmt(246) sz:102 params:
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: bs_thread_open(409) 16
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: device_mgmt(246) sz:102 params:
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: bs_thread_open(409) 16
Mar 17 17:03:00 stratar8 tgtd[15321]: tgtd: device_mgmt(246) sz:102 params:
systemctl status tgt.services with Trusty, Vivid and Xenial amd64 and arm64 (after import but before reboot or service restart):
systemctl status tgt.service
● tgt.service - (i)SCSI target daemon
Loaded: loaded (/lib/systemd/
Active: active (running) since Thu 2016-03-17 16:42:02 EDT; 52min ago
Docs: man:tgtd(8)
Main PID: 15321 (tgtd)
Status: "Starting event loop..."
Tasks: 497 (limit: 512)
Memory: 9.0M
CPU: 621ms
CGroup: /system.
└─15321 /usr/sbin/tgtd -f
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 9
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 8
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 7
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 6
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 5
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 4
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 3
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 2
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 1
Mar 17 17:33:13 stratar8 tgtd[15321]: tgtd: bs_thread_open(437) stopped the worker thread 0
systemctl status tgt.service after attempted service restart / system reboot:
● tgt.service - (i)SCSI target daemon
Loaded: loaded (/lib/systemd/
Active: deactivating (stop-sigterm) (Result: exit-code) since Thu 2016-03-17 17:45:46 EDT; 35s ago
Docs: man:tgtd(8)
Process: 27874 ExecStop=
Process: 27836 ExecStop=
Process: 27800 ExecStop=
Process: 27797 ExecStop=
Process: 27888 ExecStartPost=
Process: 27883 ExecStartPost=
Main PID: 27877 (tgtd)
Status: "Starting event loop..."
Tasks: 497 (limit: 512)
Memory: 9.0M
CPU: 713ms
CGroup: /system.
└─27877 /usr/sbin/tgtd -f
Mar 17 17:45:47 stratar8 tgtd[27877]: tgtd: bs_thread_open(437) stopped the worker thread 4
Mar 17 17:45:47 stratar8 tgtd[27877]: tgtd: bs_thread_open(437) stopped the worker thread 3
Mar 17 17:45:47 stratar8 tgtd[27877]: tgtd: bs_thread_open(437) stopped the worker thread 2
Mar 17 17:45:47 stratar8 tgtd[27877]: tgtd: bs_thread_open(437) stopped the worker thread 1
Mar 17 17:45:47 stratar8 tgtd[27877]: tgtd: bs_thread_open(437) stopped the worker thread 0
Mar 17 17:45:47 stratar8 tgt-admin[27888]: tgtadm: out of memory
Mar 17 17:45:47 stratar8 tgt-admin[27888]: Command:
Mar 17 17:45:47 stratar8 tgt-admin[27888]: tgtadm -C 0 --lld iscsi --op new --mode logicalunit --tid 32 --lun 1 -b /var/lib/
Mar 17 17:45:47 stratar8 systemd[1]: tgt.service: Control process exited, code=exited status=22
dpkg -l '*maas*'|cat:
dpkg -l '*maas*'|cat
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii maas 2.0.0~alpha3+
ii maas-cli 2.0.0~alpha3+
un maas-cluster-
ii maas-common 2.0.0~alpha3+
ii maas-dhcp 2.0.0~alpha3+
ii maas-dns 2.0.0~alpha3+
ii maas-proxy 2.0.0~alpha3+
ii maas-rack-
ii maas-region-
ii maas-region-
un python-django-maas <none> <none> (no description available)
un python-maas-client <none> <none> (no description available)
un python-
ii python3-django-maas 2.0.0~alpha3+
ii python3-maas-client 2.0.0~alpha3+
ii python3-
tgt version
tgt 1:1.0.62-1ubuntu2 amd64 Linux SCSI target user-space daemon and tools
tags: | added: arm64 |
tags: | added: tgtadm |
Changed in maas: | |
status: | New → Invalid |
Changed in tgt (Ubuntu): | |
status: | Triaged → In Progress |
Upon further investigation it turns out that this is a problem with systems running kernel 4.3 or newer. It stems from the systemd limit of 512 tasks. This explains why the problem only occurred when multiple arch images (amd64 and arm64) were downloaded. Adding "TasksMax=infinity" to the /lib/system/ systemd/ tgt.service file (under the Service section) resolved the problem and allows tgtadm to start without error.