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

Moderators: mdrjr, odroid

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

Unread postby 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
tobbe
 
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english

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

Unread postby 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?
User avatar
odroid
Site Admin
 
Posts: 28853
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

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

Unread postby 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.
tobbe
 
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english

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

Unread postby 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
User avatar
OverSun
 
Posts: 1386
Joined: Mon Apr 29, 2013 5:12 pm
languages_spoken: english

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

Unread postby 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.
tobbe
 
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english

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

Unread postby 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
rooted
 
Posts: 5676
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

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

Unread postby 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
User avatar
mad_ady
 
Posts: 4704
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

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

Unread postby 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.
tobbe
 
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english

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

Unread postby 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.
User avatar
mad_ady
 
Posts: 4704
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

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

Unread postby 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.
tobbe
 
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english

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

Unread postby 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.
User avatar
mad_ady
 
Posts: 4704
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

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

Unread postby 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.
tobbe
 
Posts: 6
Joined: Fri Jul 20, 2018 3:18 am
languages_spoken: english

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

Unread postby 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)
User avatar
mad_ady
 
Posts: 4704
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1


Return to Issues

Who is online

Users browsing this forum: No registered users and 3 guests