Re: Single FAI server, multiple Debian versions?

2024-01-17 Diskussionsfäden Thomas Lange
> On Wed, 17 Jan 2024 12:27:30 +0100, Diego Zuccato 
>  said:

> Yup, sure!
> And in the list printed during boot there are both, with DEBIAN 
> preceding BOOKWORM. I see both var files being read & printed.

> Since the first workaround didn't work (even after changing 'echo' to 
> 'cat'), I resorted to adding files/etc/apt/sources.list/BOOKWORM64 with 
> the needed lines.
> At least now the packages get fetched from the right repository, but "it 
> smells worse than my yesterday diaper" (Baby Herman)...
I you have some problems, just put the fai.log onto paste.debian.net
and tell us on IRC #linux-fai (oftc.net). Then you can get quick help
from ohter FAI users.

regards Thomas


Re: Single FAI server, multiple Debian versions?

2024-01-17 Diskussionsfäden Diego Zuccato

Il 17/01/2024 10:55, Andrew Ruthven ha scritto:


On Wed, 2024-01-17 at 09:06 +0100, Diego Zuccato wrote:

I copied DEBIAN.var to BOOKWORM64.var, then changed the var to
release=bookworm .


It'll depend on what you're using as in our profile as well. You need to
have a class set that matches the class named used for the basefile you want
to use.

Are you setting BOOKWORM64?


Yup, sure!
And in the list printed during boot there are both, with DEBIAN 
preceding BOOKWORM. I see both var files being read & printed.


Since the first workaround didn't work (even after changing 'echo' to 
'cat'), I resorted to adding files/etc/apt/sources.list/BOOKWORM64 with 
the needed lines.
At least now the packages get fetched from the right repository, but "it 
smells worse than my yesterday diaper" (Baby Herman)...


--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786


Re: Single FAI server, multiple Debian versions?

2024-01-17 Diskussionsfäden Andrew Ruthven
Hey Diego,

On Wed, 2024-01-17 at 09:06 +0100, Diego Zuccato wrote:
> I copied DEBIAN.var to BOOKWORM64.var, then changed the var to 
> release=bookworm .

It'll depend on what you're using as in our profile as well. You need to
have a class set that matches the class named used for the basefile you want
to use.

Are you setting BOOKWORM64?

Cheers,
Andrew

-- 
Andrew Ruthven, Wellington, New Zealand
and...@etc.gen.nz |
Catalyst Cloud:   | This space intentionally left blank
 https://catalystcloud.nz |



Re: Single FAI server, multiple Debian versions?

2024-01-17 Diskussionsfäden Diego Zuccato

Il 16/01/2024 16:20, Robert Markula ha scritto:

Am 16.01.24 um 16:13 schrieb Diego Zuccato:
But now the install is saying that it's downloading bullseye packages 
even if I specified class BOOKWORM64. Surely I've messed up something. 
Work for tomorrow :)
Have a look at your class/DEBIAN file in your FAI config space. There 
should be a line that says:

release=bookworm

I have a DEBIAN.var file that also defines some other variables.

Alternatively, if you want to be able to install multiple distributions 
or versions, you can create your own class/BOOKWORM64.var file. It just 
needs to contain the 'release'-line from above.
I copied DEBIAN.var to BOOKWORM64.var, then changed the var to 
release=bookworm .
I also defined APTPROXY line to be sure file got read. And Actually it 
is. But in the console I get a

fcopy: no matching file for any class for etc/apt/sources.list defined
so it seems it copies the one from nfsroot (it should be handled by 
scripts/LAST/50-misc , but isn't LAST a bit late?).


So I also added hooks/task_repository/repository.BOOKWORM64 containing:
-8<--
#!/bin/bash

echo < $target/etc/apt/sources.list
# Created by $0
deb $apt_cdn/debian $release main contrib non-free
deb $security_cdn/debian-security ${secsuite} main contrib non-free
EOF
-8<--
But it seems it's not the correct solution, since task_updatebase still 
fetches from bullseye :(

Hints?

Tks.

--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786


Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Andrew Ruthven
On Tue, 2024-01-16 at 14:15 +0100, Diego Zuccato wrote:
> Tks, that's indeed way easier. And more manageable, especially if the 
> files are kept on a dedicated http server => no changes to nfsroot.

They're kept in the config directory structure that is mounted to
/var/lib/fai/config . Not in the nfsroot.

I use git-annex for tracking the basefiles with git, but without ballooning
the size of my git repo.

> The con is that the file needs to be saved somewhere on the local system 
> before being extracted, and that could be a problem with small disks, 
> while with nfsroot it is accessible as a normal file and does not need 
> to be copied.

Already answered by Thomas.

> Will dig this, too. For now I'm trying to get rid of some spurious error 
> messages (related to PCI addresses that are not available, probably a 
> BIOS issue) that prevent install to automatically reboot.

This is an on-going battle with every new hardware type! Definitely worth
doing though.

Cheers,
Andrew

-- 
Andrew Ruthven, Wellington, New Zealand
and...@etc.gen.nz |
Catalyst Cloud:   | This space intentionally left blank
 https://catalystcloud.nz |



Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Robert Markula



Am 16.01.24 um 16:13 schrieb Diego Zuccato:
But now the install is saying that it's downloading bullseye packages 
even if I specified class BOOKWORM64. Surely I've messed up something. 
Work for tomorrow :)


Have a look at your class/DEBIAN file in your FAI config space. There 
should be a line that says:


release=bookworm

Alternatively, if you want to be able to install multiple distributions 
or versions, you can create your own class/BOOKWORM64.var file. It just 
needs to contain the 'release'-line from above.


Cheers,

Robert


OpenPGP_0x7D6C604A57E37237.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Diego Zuccato

Il 16/01/2024 15:00, Thomas Lange ha scritto:


 > Tks, that's indeed way easier. And more manageable, especially if the
 > files are kept on a dedicated http server => no changes to nfsroot.
 > The con is that the file needs to be saved somewhere on the local system
 > before being extracted, and that could be a problem with small disks,
No. The tar file is downloaded into a directory that is a RAM disk.


Good. I noticed after answering that basefiles are well under 100MB.

But now the install is saying that it's downloading bullseye packages 
even if I specified class BOOKWORM64. Surely I've messed up something. 
Work for tomorrow :)


Tks for all the help!

--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786


Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Thomas Lange
> On Tue, 16 Jan 2024 14:15:04 +0100, Diego Zuccato 
>  said:

> Tks, that's indeed way easier. And more manageable, especially if the 
> files are kept on a dedicated http server => no changes to nfsroot.
> The con is that the file needs to be saved somewhere on the local system 
> before being extracted, and that could be a problem with small disks, 
No. The tar file is downloaded into a directory that is a RAM disk.

-- 
regards Thomas


Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Diego Zuccato
Tks, that's indeed way easier. And more manageable, especially if the 
files are kept on a dedicated http server => no changes to nfsroot.
The con is that the file needs to be saved somewhere on the local system 
before being extracted, and that could be a problem with small disks, 
while with nfsroot it is accessible as a normal file and does not need 
to be copied.


Will dig this, too. For now I'm trying to get rid of some spurious error 
messages (related to PCI addresses that are not available, probably a 
BIOS issue) that prevent install to automatically reboot.


Diego

Il 16/01/2024 10:59, Andrew Ruthven ha scritto:

You can install multiple debian (and even ubuntu) releases from the
same nfsroot, if you run ``debootstrap`` at installtime.


It is much faster if you use basefiles, and have one per release you
install. See https://fai-project.org/fai-guide/ and search for basefiles.

We set a class of $RELEASE_$ARCH and use that to select the basefile.

Cheers,
Andrew



--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786


Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Robert Markula

Am 16.01.24 um 10:59 schrieb Andrew Ruthven:

It is much faster if you use basefiles, and have one per release you
install. See https://fai-project.org/fai-guide/ and search for basefiles.
Using basefiles you can not only install different versions of Debian, 
but different distributions altogether. Debian, Ubuntu, CentOS, Rocky, 
you name it.


OpenPGP_0x7D6C604A57E37237.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Andrew Ruthven
> You can install multiple debian (and even ubuntu) releases from the
> same nfsroot, if you run ``debootstrap`` at installtime.

It is much faster if you use basefiles, and have one per release you
install. See https://fai-project.org/fai-guide/ and search for basefiles.

We set a class of $RELEASE_$ARCH and use that to select the basefile.

Cheers,
Andrew

-- 
Andrew Ruthven, Wellington, New Zealand
and...@etc.gen.nz |
Catalyst Cloud:   | This space intentionally left blank
 https://catalystcloud.nz |



Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Diego Zuccato

Tks for the fast answer.
I'll have to dig a bit deeper (never used debootstrap explicitly), so it 
will take a bit more to fully understand.


Diego

Il 16/01/2024 10:43, Henning Glawe ha scritto:

Moin,

On Tue, Jan 16, 2024 at 10:22:42AM +0100, Diego Zuccato wrote:

Is it possible to use a single FAI server to install multiple Debian
releases (to different machines, obv)?

I'm currently installing bullseye, but I'd like to start testing
bookworm deployments.
I can't find a howto for setting up multiple NFSROOTs (better if with no
changes to the current one, to avoid breaking the working setup).


You can install multiple debian (and even ubuntu) releases from the
same nfsroot, if you run ``debootstrap`` at installtime.

All you have to do is to delete the pre-built base tarball after building
the nfsroot and provide the right settings in your fai config.

We use a hook

--- /etc/fai/nfsroot-hooks/50remove-base-tar ---
#!/bin/bash
rm -f $NFSROOT/var/tmp/base.t*


and set, depending on the target host classes ``$FAI_DEBOOTSTRAP`` and
``$FAI_DEBOOTSTRAP_OPTS``, e.g.:

--- $FAI/class/BOOKWORM.var 
#!/bin/bash
FAI_DEBOOTSTRAP="bookworm http://mpsd-deb-bookworm.desy.de/debian;
FAI_DEBOOTSTRAP_OPTS="--include=aptitude,gnupg"


FAI then runs debootstrap with the given options when installing.



--
Diego Zuccato
DIFA - Dip. di Fisica e Astronomia
Servizi Informatici
Alma Mater Studiorum - Università di Bologna
V.le Berti-Pichat 6/2 - 40127 Bologna - Italy
tel.: +39 051 20 95786


Re: Single FAI server, multiple Debian versions?

2024-01-16 Diskussionsfäden Henning Glawe
Moin,

On Tue, Jan 16, 2024 at 10:22:42AM +0100, Diego Zuccato wrote:
> Is it possible to use a single FAI server to install multiple Debian
> releases (to different machines, obv)?
> 
> I'm currently installing bullseye, but I'd like to start testing
> bookworm deployments.
> I can't find a howto for setting up multiple NFSROOTs (better if with no
> changes to the current one, to avoid breaking the working setup).

You can install multiple debian (and even ubuntu) releases from the
same nfsroot, if you run ``debootstrap`` at installtime.

All you have to do is to delete the pre-built base tarball after building
the nfsroot and provide the right settings in your fai config.

We use a hook

--- /etc/fai/nfsroot-hooks/50remove-base-tar ---
#!/bin/bash
rm -f $NFSROOT/var/tmp/base.t*


and set, depending on the target host classes ``$FAI_DEBOOTSTRAP`` and
``$FAI_DEBOOTSTRAP_OPTS``, e.g.:

--- $FAI/class/BOOKWORM.var 
#!/bin/bash
FAI_DEBOOTSTRAP="bookworm http://mpsd-deb-bookworm.desy.de/debian;
FAI_DEBOOTSTRAP_OPTS="--include=aptitude,gnupg"


FAI then runs debootstrap with the given options when installing.

-- 
Mit freundlichen Grüßen
Henning Glawe

Dr. Henning Glawe
Max-Planck-Institut für Struktur und Dynamik der Materie
Geb. 99 (CFEL), Luruper Chaussee 149, 22761 Hamburg, Germany
http://www.mpsd.mpg.de/, Email: henning.gl...@mpsd.mpg.de
Building/Room: 99/O2.100, Phone: +49-40-8998-88392