Archive for March, 2018

When your CentOS 7 install fails, anaconda in CLI to the rescue

2018/03/08

Ok, I know I’m always trying to do stuff a bit non-standard (No, running Mageia everywhere IS standard !!)

So this time, I wanted to update my CentOS 6 deployment server in Geneva to CentOS 7 and automate its setup with ansible (I already have some playbooks here to help).

The server is in a DMZ, with pretty strict security control, which normally isn’t an issue, but when eveything else fails…

Ok, so first yum update on that machine didn’t work. Lot’s of issues with that. Most of the messages you find on the net recommend to install another server in parallel. Fine, but this is not a VM, but a real machine (HPE ProLiant DL 180 Gen9) and I don’t have another one ! So I tried to update some packages manually. To make a long story short, glibc updated, but after that nothing worked as you enter in a nightmare with incorrect paths (they put everything under /usr in CentOS 7, so all /bin or /sbin binaries were not working anymore). Ok, so I had to reinstall the machine as no other method could rescue the situation, hopefully keeping my /prj FS safe.

So you use the marvelous Virtual Media feature of your server in order to mount a local ISO image on your system as a local CD of your remotely managed machine. So you download your CentOS 7 DVD latest version and try that. But it doesn’t work. Once again systemd fails to do something (logind launch in that case), and after that nothing works 😦 Did I say already I hate systemd ? And even more the people behind it who think they are always right because it just works for them 😦

After trying multiple things, I found out that CentOS 7.3 was going further on that system, so worked with that. Further meaning I was able to get a shell, but the graphical interface never wanted to launch. And using inst.vnc is not an option due to firewalling restrictions I can’t change on my end. Using inst.sshd was one way to have a working remote access. So I used that and tried to launch anaconda manually.

I used the text mode version, but it wasn’t able to reuse my existing partioning schema, as I found out. Yes, because I’m picky (I know !) on partitioning schema, and that machine had to use md RAID devices in parallel with normal partitions, and LVM on top + ext4 FS as that’s what I want (why do you want to use Linux, if the system dictates to you what to use !! then use Windows instead :-). And I wanted to keep some existing partitions safe. But launching anaconda manually didn’t take in account my existing partitioning schema (or I didn’t find how, in text mode you don’t get much help) so I lost everything on the server, without any warning concerning partitions 😦 So back to backups then.

Ok so now I really have a new install to make, but still with the same partitioning schema. So I decided to create a kickstart for the machine, which would contain that partitioning schema so anaconda could use it (and get the rest of the conf at the same time).

The partitioning shema is as follow (nothing fancy, but nos completely standard either):

part /boot/efi --fstype=efi --ondisk=sda --size=200
part /boot --fstype=ext4 --ondisk=sda --size=500
part /tmp --fstype=ext4 --ondisk=sdb --size=700
part raid.01 --ondisk=sda --grow --size=200
part raid.02 --ondisk=sdb --grow --size=200

raid pv.01 --fstype ext4 --device pv.01 --level=RAID1 raid.01 raid.02
volgroup vg_dl180 --pesize=4096 pv.01
logvol / --fstype=ext4 --name=lv_root --vgname=vg_dl180 --size=40000
logvol /var --fstype=ext4 --name=lv_var --vgname=vg_dl180 --size=10000
logvol swap --name=lv_swap --vgname=vg_dl180 --size=4000
logvol /prj --fstype=ext4 --name=lv_prj --vgname=vg_dl180 --size=520 --grow

Now I don’t want to burn a new DVD to put the ks file on it, so I thought, let’s use the network.

But the instructions which tell you that you can use an instruction to set up the network statically (I have no DHCP server as this server will become the DHCP server of this LAN !) on your system forget one point. If you use ip=IPaddr::GW:NM:… and also inst.ks=http://somewhere/x.ks then the IP is put in DHCP mode automagically :-((

Ok, so now looking at the boot logs, I see that it tries to download the ks file, but can’t because it didn’t get the IP address through DHCP which is why I wanted to pass a static IP conf to it !!!

So you can’t use the inst.ks option, if you need static IP. In fact this is written but in the ip documentation. So let’s do that. You boot again (on my ADSL connection, it’s 30′ each time you try something so we’re 2 days after the start of course) and get to a shell with the IP setup correctly, but no ks file.

And I don’t have anything on that LAN of course, to share with http or NFS. So let’s find a way. Use https://file.io ! You can upload there a text file like the ks file, and get a URL so you can download it with wget in your shell ! (you need to setup the nameserver with the nameserver= option at boot time, or adapt your /etc/resolv.conf locally).

So now I have an IP conf, a local repo (seen as a CD) and the ks file !! I just now need to find a way to say to anaconda to use it. The useful doc can be found on the Fedora Wiki. Ok, not very detailed, but enough for me to try !

I needed to launch it with:
anaconda --text --kickstartfile=file.ks

I had to interactively change the source repo, as I had given a URL in the ks file, but for a reason it didn’t seem to work, so I pointed to the local CD instead (slower as the Virtual media was getting the content of CentOS through my ADSL link, and in that sense, it’s slow ! Luckily I only had 300 packages to install). I also had to setup a simple account (just in case)

And then it worked ! it took time, but worked ! It built my partition schema the way I wanted, and installed everything, including the boot loader correctly (was a UEFI conf).

So next time I’ll be stuck by anaconda not starting graphically, I know what to do, and hopefully you too 🙂

Next step is to automate its configuration, and capture that so I can present it during the upcoming HPE TSS event in Den Haag !

Advertisements

Recrutement d’un ou d’une Chef de projet de migration à Libre Office

2018/03/05

From: COMPARAT Laurence <laurence.comparat@grenoble.fr>
Date: 2018-03-04 14:30 GMT+01:00

Bonjour,

Je vous remercie de faire circuler cette information dans vos réseaux :

La Ville de Grenoble recrute, via son service commun avec la Métropole et le CCAS, un.e Chef.fe de projet migration à Libre Office :

https://www.lametro.fr/offre/161/23-cdd-3-ans-chef-de-projet-migration-a-libre-office.htm

Cordialement,

Laurence Comparat

*”Sauvons la liberté par notre fraternité, la liberté sauvera le reste.”
Victor Hugo.*

Adjointe au Maire – Ville de Grenoble
Accès à l’information et libération des données publiques
Utilisation et diffusion des logiciels libres – Administration générale
Secrétariat : 04 76 76 38 53