"xe-daemon" in TrueNAS core domU writes to non-existent nodes of a vanilla Xen dom0 (ie. not XAPI-based)
Description
Problem/Justification
Impact
Activity

Michelle Johnson May 24, 2023 at 12:44 PM
At this time there is insufficient information to proceed with the investigation. If at any time additional debugging information is supplied this ticket may be reopened for evaluation.

iX-Tony May 16, 2023 at 12:36 PM
If you use the link in the first comment to upload your files, they are only accassible by iX developers. The developers get many tickets every day, so they typically do not look into tickets unless they have a debug attached.

Cyril REBERT May 13, 2023 at 12:10 AM
Wait, what ? That’s an INSANE amount of private information ! Sorry but I’m not comfortable with sharing that much.
I know that you have procedures and all, but why on earth would you need all that info for this kind of bug report ?!

Michelle Johnson May 10, 2023 at 12:08 PM
Thank you for your report, !
Please use the link in the system-generated message below to attach a system debug file. Link to this ticket after you upload the file and before you click Save.
To generate a debug file on TrueNAS CORE, log in to the TrueNAS web interface, go to System > Advanced, then click Save Debug and wait for the file to download to your local system. In TrueNAS SCALE, this option is in System Settings > Advanced.

Cyril REBERT May 9, 2023 at 2:39 PM
Sorry, there are a few mistakes in the bug report, and analyzing the files I found a few other problems/remarks.
About “xenstore-write-cached attr/PVAddons
/*" in “xe-update-guest-attrs“ (lines 175-180), it works reliably and is not related to the NICs nodes as wrongly written previously …
Although, why updating those values each minute ? AFAIK they can only change during a system update, and FreeNAS forces a reboot after an update anyway.
Same for ballooning, shouldn’t :
be only executed once, when “xe-daemon“ starts ?
So, moving lines 172-180 to “xe-daemon“ ? I know the values won’t get updated if they didn’t change, but some code is still executed. Or is it because “better safe than sorry” ?
In “xe-update-guest-attrs“, concerning NICs values in xenstore, as written (in a bad way) in my previous comment, it does not take into account VLAN interfaces :
Two solutions, either use :
or when creating interfaces, include xn with vlan, like “xn_vlan0“ or similar.
In any case, you would then also need to edit all the “sed 's/xn/eth/g'“ and alikes.
Also, and if correctly reading the manpage, the paths used are wrong.
The paths written to dom0 are :
“attr/$DEV_ID” when it should be “attr/vif/$DEV_ID“
“attr/$DEV_ID/ip“ when it should be “attr/vif/DEVID/ipv4/INDEX = IPV4_ADDRESS”
Talking about paths, I think the “PVAddons/*” nodes should be written to “data/” (like meminfo*, os_* and updated), and not to “attr/”, which seem reserved for vifs only.
Last, about domid. In “xe-update-guest-attrs“, it tries to :
But on my system, there’s no “unique-domain-id“ node (result: “xenstore-read: couldn't read path /local/domain/3/unique-domain-id“). So neither the comparison to detect domain change afterwards does work, nor is it written the first time, breaking subsequent calls.
Is it my dom0 which does not create the expected node, or should the “unique-domain-id“ be removed from this line ?
(From the docs, I thought you meant to use “/local/domain/${domid}/vm“, which returns “/vm/[A_GUID]“, but it’s not guest readable).
Side notes :
should I update the bug report title (if I can), as finally I spotted more than “writing to non-existent nodes” ? ^^
should I post this bug somewhere else ? Note that I already posted on xen-devel (got an answer today so it may not be stalled).
Thanks, I hope this report is now correct.
Details
Details
Assignee

Reporter

Context:
Debian dom0, vanilla Xen 4.14.5
TrueNAS core HVM domU, “xe-daemon“ got installed and runs
The problem is that the node the “xe-daemon” tries to write to does not exist in dom0, as I’m not using a XAPI-based dom0.
This is the output in dom0 “xenstore-access.log“, repeated each minute :
I've posted on the xen-devel mailing list about it, but I don't think it's useful to post the full bug report here, as I wasn’t aware of some specifics. Tell me if I'm wrong.
The bug report and the possible answers/fixes can be read at : , it seems stalled though, and in my case may be only half of the solution : shouldn’t the “xe-daemon” be adapted to a vanilla Xen dom0 ?
Considered files:
/usr/local/sbin/xe-daemon
/usr/local/sbin/xe-update-guest-attrs
The xenstore is on truenas :
The offending line in “xe-update-guest-attrs“ is line 173:
Note that ballooning in dom0 -and- the TrueNAS domU is disabled.
The following lines in “xe-update-guest-attrs“ are correctly written to dom0 xenstore :
But kind of incorrectly :
as I have two NICs with an IP, and the IP listed here is unused (ie. linked to no service like SSH, NFS, SMB, etc).
Those parts also get correctly written to dom0 xenstore :
To prevent TrueNAS from filling the log file, the quick fix I use is to kill the “xe-daemon” after domU boot. I may be wrong, but it seems useless in my case/config to keep it running.
As for the possible solutions I see :
use different scripts on vanilla Xen dom0s and XAPI-based ones
if not, distinguish values between both dom0 types
as per a Xen ML answer, create the offending xenstore node(s) (even if not using them) and give it write rights. IIRC, this must be done by the Xen team. But why writing to a node each minute if it’s not used/useless, it’s a waste of ressources
Thanks all, have a nice day.