static /etc/machine-id in ubuntu image = realy bad for ipv6

Post Reply
tobbe
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english
Contact:

static /etc/machine-id in ubuntu image = realy bad for ipv6

Unread post by tobbe » Fri Jul 20, 2018 3:26 am

Hi.

i found a problem, the ubuntu image contains a fixed machine id file in /etc/machine-id so if you have many machines they all end up with same machine id.
this is really bad because dhcpv6 uses the machine id to generate a duid that is supposed to be unique across all hosts.
since it is not they overwrite each others ipv6 adress and screwup the ip and hostname generation in my dhcp server.

changing this is not trivial and ihave not found out how to do it.
apparently you are supposed to be able to do:

Code: Select all

# rm /etc/machine-id
# systemd-machine-id-setup
but then systemd-machine-id-setup instead of picking a new random one it picks the old one.

so how do you reset the machine id properly so i can get dhcpv6 assigned adresses to not cause duplicates and in turn screwup glusterfs peer probe

User avatar
odroid
Site Admin
Posts: 29367
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by odroid » Fri Jul 20, 2018 10:00 am

Since the MAC address is a unique ID, there should be a way to generate the machine-id properly.

Code: Select all

odroid@odroid:~$ nmcli device show eth0 | grep -i hw
GENERAL.HWADDR:                         00:1E:06:30:88:91
But, I have no idea how "systemd-machine-id-setup" works.

BTW, do you use Ubuntu 18.04 minimal image? or, 16.04 minimal?

tobbe
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by tobbe » Fri Jul 20, 2018 2:38 pm

i use the image "ubuntu-18.04-4.14-minimal-odroid-xu4-20180531" on my 4 hc2

as i understand it the initial setup used in the image when you boot should in one way or the other create a new machine id, but this is not the case and image includes a static one (i believe systemd have a special setup tool for this purpose)
dhclient have several different ways of creating a dhcpv6 DUID (device unique identifier) but default one is to create a DUID based on machine id, this is then passed on to dhcpv6 server and dhcpv6 uses the generated DUID instead of how ipv4 uses the mac address.

so image needs fixing since i expect everyone that uses dhcpv6 and more than one odroid to run into problems.

i fixed the problem manually by doing:

Code: Select all

uuidgen | sed 's/-//g' > /etc/machine-id
and then rebooting.
above command assumes you have uuidgen installed which is not the case by default.

User avatar
OverSun
Posts: 1402
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by OverSun » Fri Jul 20, 2018 3:22 pm

https://www.freedesktop.org/software/sy ... .conf.html
DUIDType=
https://www.freedesktop.org/software/sy ... twork.html
ClientIdentifier=

It's much easier to use stateless RA for ipv6 than dhcp, less complications

tobbe
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by tobbe » Fri Jul 20, 2018 8:40 pm

OverSun wrote:It's much easier to use stateless RA for ipv6 than dhcp, less complications
yes but in my case dhcpv6 is enabled and i think it is a bad idea for image to be broken by default.
it took me a while to figure out the problems i was having was due to screwed up ipv6 adresses and hostnames.

User avatar
rooted
Posts: 6079
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by rooted » Sat Jul 21, 2018 1:38 am

tobbe wrote:
OverSun wrote:It's much easier to use stateless RA for ipv6 than dhcp, less complications
yes but in my case dhcpv6 is enabled and i think it is a bad idea for image to be broken by default.
it took me a while to figure out the problems i was having was due to screwed up ipv6 adresses and hostnames.
That's why there are revisions to the image, all issues can't be forseen.

A note in the wiki about this issue should be made in the meantime.

User avatar
mad_ady
Posts: 5096
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1
Location: Bucharest, Romania
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by mad_ady » Sat Jul 21, 2018 3:38 am

I've checked on 5 odroids that are ipv6 enabled and all have a different machine id. All of them run HK images:
* XU4 - 18.04 upgraded from 16.04
* 3 C2 - 16.04
* C1 - 16.04

Maybe the problem is in the 18.04 image? How can I check if I get my IPv6 via RA or DHCP6? I know RA is enabled in my router and DHCP6 is used on the WAN side.
The IPs I have are derived from the MAC address, so I guess I'm not using dhcp

tobbe
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by tobbe » Sat Jul 21, 2018 9:54 pm

i wish i could use fedora on my odroid-hc2 devices...
after several days struggling with getting gluster-block working i think im about to give up with it.

something that should be a simple package install turns out to be much more complicated for many reasons.
first, package tcmu-runner is missing from ubuntu.
downloading and building this manual works but only after you figure out that you also need to patch a few files manualy to work around a compilation problem

then the bigger problem, building and getting gluster-block to work.
same here, source files needs patching to make it build.
then next problem is that the saver/restore script that is related to targetcli is not using systemd making the systemd unit files fail since it expects to setup some dependencies.
so those scripts need to be converted to systemd unit files first and then disable the sys-v init script it replaces.

THEN once you have gluster-blockd running and try to actually add something it segfaults when writing to the log file.
turning off the gluster-blockd logging makes it past that BUT then comes a new problem related to targetcli and readline

so instead of a oneline command like "dnf install gluster-block" became much longer and didnt even work in the end (i made notes for all steps so i could replicate them)

i did try to get fedora booting on my odroid-hc2 but they all ended up getting stuck shortly after boot for some reason (this was another "fun" experience figuring out how to create a working image)

i just wish odroid/hardkernel could upstream more of their work

oh, and i forgot, smartd from smartmontools is also broken due to as i understand it lack of support or info around the sata bridge.

User avatar
mad_ady
Posts: 5096
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1
Location: Bucharest, Romania
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by mad_ady » Sat Jul 21, 2018 10:14 pm

You can run smartctl -d sat to get readings.
You might be able to get fedora running inside a lxc container, but nit sure if it helps you.

tobbe
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by tobbe » Sat Jul 21, 2018 11:06 pm

mad_ady wrote:You can run smartctl -d sat to get readings.
yes i know, but that unfortunately doesn't mean that smart daemon works.
apparently (for some odd reason) you can have smartctl working but not the daemon, one would think if smartctl works then the daemon should work too but no.

i saw a discussion about this when searching for information, something about missing/broken support for the sata bridge chip due to kernel module not being mainlined or well supported or similar.

User avatar
mad_ady
Posts: 5096
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1
Location: Bucharest, Romania
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by mad_ady » Sat Jul 21, 2018 11:09 pm

Isn't there a config file where you can add the -d sat option? I am not using smartmontools because polling the disk keeps it awake and spinning and for my needs I want the opposite.

tobbe
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by tobbe » Wed Jul 25, 2018 6:02 pm

mad_ady wrote:Isn't there a config file where you can add the -d sat option?
it doesn't work for smartd daemon, it just complains.
it is not the first time i have this kind of problem with smartd, on my other computer the raid controller i can see smart atributes just fine with smartctl but smartd errors and refuses to have anything to do with the disks
mad_ady wrote:I am not using smartmontools because polling the disk keeps it awake and spinning and for my needs I want the opposite.
there is an option so smartd does not poll the disks if it is in sleep mode so it avoids waking up sleeping disks.

User avatar
mad_ady
Posts: 5096
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1
Location: Bucharest, Romania
Contact:

Re: static /etc/machine-id in ubuntu image = realy bad for i

Unread post by mad_ady » Wed Jul 25, 2018 6:20 pm

there is an option so smartd does not poll the disks if it is in sleep mode so it avoids waking up sleeping disks.
Yes, but if you poll every 5 minutes and the disk is set to go to sleep after 5-10 minutes, once it wakes up polling will keep it up and prevent it from going to sleep (unless you manually put it to sleep)

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 2 guests