Can't kickstart rhel7 from nfs

Latest response

Longtime rhel5/rhel6 kickstart user. However, when trying to get rhel7 to kickstart via nfs and a custom iso (using basically the same method as for RHEL6), it fails miserably:

dracut-initqueue[1042]:anaconda fetching kickstart from cdrom:/ks.cfg
dracut-initqueue[1042]:Warning: failed to fetch kickstart from cdrom:/ks.cfg
dracut-initqueue[1042]:anaconda: fetching kickstart from /dev/sr0:/ks.cfg
ISO 9660 Extensions: Microsoft Joliet Level 3
ISO 9660 Extensions: RRIP_1991A
dracut-initqueue[1042]: Warning: could not boot.
dracut-initqueue[1042]:Warning: /dev/root  does not exist
Starting Dracut Emergency Shell

I found a community article at https://access.redhat.com/solutions/1134003 and did as suggested. However, it doesn't help.

Any ideas? I suspect it may have something to do with the format of the ks.cfg file, but just not sure. Here's my kickstart file:

# This file was created for host tm1cldcmpl02-adm using make_ks.sh on Thu Jan 22 13:41:12 MST 2015

################## ITEMS IN THIS SECTION ARE HOST SPECIFIC #####################

# System Network Information
network --bootproto=static --ip=10.10.5.153 --netmask=255.255.255.0 --gateway=10.10.5.1 --nameserver=10.8.192.236,10.8.97.251,10.8.97.252 --device=eno4

# Disk to install to.  On SmartArray systems, this will be 'cciss/c0d0'.  On
# IDE systems, it will be 'hda'.  On SCSI/SATA systems, it will be 'sda'.
ignoredisk --only-use=sda

# System authentication information
#auth  --useshadow  --enablemd5  --enableldap --enableldapauth --ldapserver=unset --ldapbasedn=unset

# System bootloader installation.  The first disk in the driveorder should
# be the same disk as '--only-use' above
bootloader --location=mbr --driveorder=sda

# NFS source location
nfs --server=10.20.0.91 --dir=/vol/unixdepot/redhat/RHEL/KICKSTART/7.0 --opts=nolock
#url --url http://tadmin03.example.com/rhel

################# ITEMS ABOVE THIS POINT ARE HOST SPECIFIC #####################
# Install OS instead of upgrade
install

# Skip registration key
#key --skip

# Clear the Master Boot Record
zerombr

# Clear all partitions and re-initialize for Linux (MSDOS) style partitions
clearpart --all --initlabel

# Use text mode install instead of graphical
text

# Firewall disabled (iptables)
firewall --disabled

# SELinux disabled
selinux --disabled

# Do not run the Setup Agent on first boot
firstboot --disable

# Disable services
services --disabled iptables,ip6tables --enabled ntpd,xinetd

# System keyboard
keyboard us

# System language
lang en_US

# Installation logging level
logging --level=info

#Root password
rootpw --iscrypted xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Do not configure the X Window System
skipx

# System timezone
timezone --isUtc America/Denver

# Reboot after installation
#reboot

# Use Local Repositories to get LATEST updates
#repo --name=RHN_May5 --baseurl=http://tadmin03.example.com/rhel

# Disk partitioning information
part /boot --fstype ext3 --size=1024
part pv.00 --size=100 --grow
volgroup VolGroup00 --pesize=32768 pv.00
logvol / --fstype ext4 --name=lv_root --vgname=VolGroup00 --size=10240
logvol swap --fstype swap --name=lv_swap --vgname=VolGroup00 --size=8192
#logvol swap --fstype swap --name=lv_swap --vgname=VolGroup00 --size=32000
#logvol swap --fstype swap --name=lv_swap --vgname=VolGroup00 --size=2048
logvol /var --fstype ext4 --name=lv_var --vgname=VolGroup00 --size=5120
logvol /var/tmp --fstype ext4 --name=lv_vartmp --vgname=VolGroup00 --size=10240
#logvol /var/crash --fstype ext4 --name=lv_varcrash --vgname=VolGroup00 --size=3072
logvol /usr --fstype ext4 --name=lv_usr --vgname=VolGroup00 --size=10240
logvol /tmp --fstype ext4 --name=lv_tmp --vgname=VolGroup00 --size=4096
logvol /opt --fstype ext4 --name=lv_opt --vgname=VolGroup00 --size=10240

# Packages to install
%packages
#@base
#@core
#@console-internet
#@performance
#@perl-runtime
#@system-admin-tools
#@x11
@ X Window System
ksh
screen
telnet
openldap-clients
nss-pam-ldapd
nfs-utils
#ntp
#kexec-tools
lsscsi
#sysstat
glibc.i686
xinetd
sysfsutils
patch
iptraf
make
net-snmp
mcelog
redhat-lsb-core
hwloc
tunctl
tuned-utils
tuned
cpupowerutils
powertop
systemtap
%end

# Stuff to run before kickstart begins
%pre
%end

# Stuff to run after kickstart completes
%post
mkdir /unixdepot
ln -s /bin/ksh /usr/bin/ksh
# unixdepot mountpoint and post scripts added by make_ks.sh script
mount -o nolock 10.20.0.91:/vol/unixdepot /unixdepot
/unixdepot/redhat/scripts/rhelfinish-test 7.0
cp /unixdepot/redhat/repos/latest/*.repo /etc/yum.repos.d/
yum --nogpgcheck -y update
%end

Responses

Can you throw 3 x tilde's around your ks file to preserve the formatting?
~~~
code here
~~~

Also - can we see what your boot string looks like? I.e. vmlinuz initrd=initrd.img ks=blah... network=blah
Are you using PXE, or boot media?

I struggled a bit getting my RHEL 7 kickstart to work, but I finally managed to get through the issues.

Just in case you're in the same boat as I was, initially, there are some tweaks to the parameters with EL 7 as well. I.e. some params require a 'ks." in front of the variable now, etc...

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-kickstart-installations.html

Check out the following, especially:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html#sect-kickstart-syntax-changes

$ ksverdiff -f RHEL6 -t RHEL7

Thanks for reformatting. From your thread I believe you are booting from CD/DVD and you have a ks.cfg file on the DVD? Which then has the NFS location for the installation source listed in your ks.cfg file.

I am still curious what your actual boot/install string looks like. In my case, I use PXE, and then host my ks.cfg file on a web server that is accessible from the kickstart client.

Here are the boot strings I have in my /tftpboot/pxelinux.cfg/default which would be your isolinux.cfg file on your DVD

# CENT-7.0-x86_64
label CENT7A
  kernel CentOS-7.0-x86_64/vmlinuz
  append initrd=CentOS-7.0-x86_64/initrd.img inst.ksdevice=link inst.ks=http://192.168.0.4/CENT7A.ks inst.gpt ip=dhcp

label RHELH01
  kernel RHEL-6.5-x86_64/vmlinuz
  IPAPPEND 2
  append initrd=RHEL-6.5-x86_64/initrd.img ksdevice=bootif ramdisk=5939 dhcpclass=RHEL-6.5-x86_64 noipv6 ks=http://192.168.0.4/RHELH01.ks

I am showing both so you can see the immediate differences side-by-side. If you created your own DVD for installation, I suspect that perhaps the DVD label is not matching what you have for inst.stage2=""
You may be able to see what your label is by running blkid from the dracut emergency shell, which I should return something similar to

# blkid | grep RHEL-7
/dev/loop1: UUID="2014-05-07-03-58-46-00" LABEL="RHEL-7.0 Server.x86_64" TYPE="iso9660" PTTYPE="dos" 

We've scrubbed your domain name and encrypted password from the posted kickstart.

I have several customers, and one uses nfs for kickstarts. I occasionally have to re-share the nfs share (our nfs is on solaris, ugh...).

Annoyance #2 for me, I've occasionally during the kickstart had to tell it to use the same nfs mount i fed it when it complains, and do this a few times, and then after some persistence, it worked. (mercifully, this problem went away)

Annoyance #3 for me, Is the nfs you have on nfsv4? That may add some additional "fun". When booting the system from either boot media or the installation dvd, adding the "nameserver" directive as part of the "linux ks" portion has helped us.

Some initial thoughts, good luck

I can't speak to your particulars, but I have used NFS kickstart quite heavily, where both the ks.cfg and the installation source is on NFS (but I still use a boot disk for the kernel). I tried using nfsv4 once, but was unsuccessful. nfsv3 works very well, however. If your server is configured with ports to allow v3, try that.

I spent the better part of a day trying to get kickstart to work using nfsv4. no joy. it almost worked when the kernel and kickstart script were available on ftp, but even with just the install tree on nfsv4, it eventually died. When I opened the ports on the server and allowed V3, everything worked like a champ.
Again, this should be documented in the kickstart section of the Installation Manual.
(btw, this wasnt in answer to the question - I was already working on it.)

I did try adding vers=3 to the options line. It did change the error just a bit from what I originally posted above, but still won't boot. Now it looks like:

dracut-initqueue[1043]:Warning: failed to fetch kickstart from cdrom:/ks.cfg
dracut-initqueue[1043]: Warning: could not boot.
dracut-initqueue[1043]:Warning: failed to fetch kickstart from cdrom:/ks.cfg
dracut-initqueue[1043]: Warning: could not boot.
dracut-initqueue[1043]:Warning: /dev/root  does not exist
Starting Dracut Emergency Shell

So, looks like a giant step backward.

Hi UNIX Team,
if we could see the "boot string" (I'm not exactly sure what it is called) that is used, that might help us identify what is going wrong. It seems like it is failing before NFS would be a part of the equation (i.e. it cannot find your ks.cfg). It is as though it cannot find the image to boot from and cannot proceed to do/find anything else after that point.
You should have a file RHEL-7.0-x86_64/isolinux/isolinux.cfg which will define the boot options. Does your script customize that file? If so, does it customize in a way that was configured for RHEL 5/6? RHEL 7 is a bit different.

RHEL 7
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 rescue quiet

RHEL 6
append initrd=initrd.img xdriver=vesa nomodeset

Once your installation has failed (and dropped to that Emergency Shell), try running blkid and check your labels.

I'm getting farther, to the point where I know it's actually reading the ks.cfg (I deliberately introduced a bogus keyword in it, and got the expected error). Now it looks like:

mount: /dev/sr0 is write-protected, mounting read-only
Warning: no suitable images
Warning: Could not boot

So, here's the boot line from isolinux.cfg:

default RHEL7
prompt 1
timeout 600
display host.msg
F1 host.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label RHEL7
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 inst.ks=cdrom:/ks.cfg ip=10.xx.xx.xxx netmask   =255.255.255.0 gateway=10.xx.xxx.1 nameserver=10.xxx.xx.xx,10.xxx.xx.xx ksdevice=eno4 rescue

the blkid shows, for /dev/sr0:

/dev/sr0: UUID="2015-01-26-09-57-19-00" LABEL="RHEL7.0 Server.x86_64" TYPE="iso9660"

I was trying to figure out why I had not dealt with inst.stage2= before (I also double-checked my DHPC/tftp/PXE/HTTP setup as well). I actually never define that value.
I'm still a bit confused, but I am wondering whether you need that definition at all (since you define the location of your installation in ks.cfg file).

nfs --server=10.20.0.91 --dir=/vol/unixdepot/redhat/RHEL/KICKSTART/7.0 --opts=nolock

I hate to dump a link to a doc without having the ability to explain this issue away, but I would review this to see if it helps:
http://fedoraproject.org/wiki/Anaconda_Boot_Options

Per:

How to create customized bootable boot ISO image in Red Hat Enterprise Linux 7 ?
https://access.redhat.com/solutions/1147263

The "inst.stage2=" needs to point to the repository which in this case appears to be on the NFS server.

did you find a solution?
I can't install it too. It gives me an error:
Warning: no suitable images
mount: /dev/sr0 is write protected, mounting RO
mount /dev/sr0 is already mounted or /run/install/repo busy
warning: Couldn't mount /dev/sr0
Warning: no suitable images

blkid gives me this:
/dev/sr0: UUID="2015-07-07-14-01-27-00" LABEL="RHEL-7.1 Server.x86_64" TYPE="iso9660"
/dev/sda1: UUID="bla bla bla" TYPE=ext4
/dev/sda2: UUID"bla bla bla blab" TYPE="LVM2_member"

please advise!!!!

P.S. What should i have in this folder (NFS location)?
nfs --server=10.20.0.91 --dir=/vol/unixdepot/redhat/RHEL/KICKSTART/7.0 --opts=nolock

thanks in advance!

The labelling issue is for the BOOT iso, not the installation iso placed on NFS.

I have success this way...

  • server VM to install is configured with BIOS rather than EFI, to boot the isolinux kernel from the custom iso

  • the custom iso for booting is created from rhel-server-7.2-x86_64-boot.iso (smaller than rhel-server-7.2-x86_64-dvd.iso) because my virtual optical boot drive is on a slow network connection. The full installation iso (rhel-server-7.2-x86_64-dvd.iso) and my-kickstart.cfg are both in the same NFS directory on a server with a fast network connection. The original rhel boot iso was mounted -o loop and its entire contents copied to a directory my-custom-boot-iso for modification.

  • 'append' line in my-custom-boot-iso/isolinux/isolinux.cfg specifies the NFS kickstart, and (IMPORTANT!!!) hd:LABEL= must match the label used for the custom iso with mkisofs. I also tweaked other incidental options to liking (inst.resolution=1440x900).

append initrd=initrd.img inst.stage2=hd:LABEL=Custom\x20RHEL-7.2\x20x86_64 inst.ks=nfs:nfs-server-name:/nfs-path/my-kickstart.cfg
  • when creating the custom iso, the disc label after -V must match the line above. "\x20" in hd:LABEL is the space character in -V, if you insist on using spaces in the label.
mkisofs -o custom-rhel-7.2-boot.iso -V "Custom RHEL-7.2 x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T my-custom-boot-iso/
  • "custom-rhel-7.2-boot.iso" and "my-custom-boot-iso" are paths relative to the current directory. The "isolinux/..." paths are relative to the root of the custom boot iso after it has been created.

  • my-kickstart.cfg contains the lines:

install
nfs --server=nfs-server-name --dir=/nfs-path
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage
  • the installation fails in the repo configuration step if both the Server-HighAvailability and Server-ResilientStorage repo lines are removed from my-kickstart.cfg, so I leave them both there.
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.