cobbler buildiso, kickstart & satellite
Hi all,
I am trying to use cobbler in our environment when (so far ...) we cannot use PXE boot to provision servers.
So the obvious option is to use "cobbler buildiso" feature.
I create kickstart file using our internal Satellite server, then run "cobbler buildiso".
The iso is created but when I boot it I get the following message:
Unable to download the kickstart file. Please modify the kickstart parameter below or press cancel to proceed as an interactive install
The kickstart file is using the following command:
wget "http://(our satellite)/cblr/svc/op/trig/mode/pre/profile/prof1" -O /dev/null
We don't have any cblr/svc/... path on our Satellite.
I could modify the kickstart file but every time I modify kickstart file using Satellite I would need to repeat it.
Can I change cobbler config to use the correct path ?
Responses
Hi Przemyslaw, unfortunately you are getting in to some of the more complicated aspects of the kickstart.
Here is a very high level of what we do (as we cannot use PXE either):
RELEASE=server-6
VERSION=6.4
cd /var/satellite/rhn/kickstart/ks-rhel-x86_64-${RELEASE}-${VERSION}/
# CUSTOM SECTION HERE
for FILE in boot.msg isolinux.cfg splash.jpg; do cp isolinux/${FILE} isolinux/${FILE}.orig; done
cp /var/www/html/pub/isolinux/boot.msg-${RELEASE} isolinux/boot.msg
cp /var/www/html/pub/isolinux/splash.jpg isolinux/
cat /var/www/html/pub/isolinux/isolinux.cfg-${RELEASE} >> isolinux/isolinux.cfg
sed -i -e 's/timeout 600/timeout 0/g' isolinux/isolinux.cfg
So, in /var/www/html/pub/isolinux (path can be anywhere), I keep a copy of the isolinux.cfg and boot.msg - both of which are specific to server/workstation and 5 vs 6.
isolinux.cfg-server-6 (which gets copied to isolinux/isolinux.cfg)
label kickstart6
kernel vmlinuz
append initrd=initrd.img noipv6 lang=en_US ks=http://rhnsat01.corp.company.com/ks/cfg/org/1/label/kickstart6 dns=10.98.230.27,10.98.230.28 hostname=KickstartBox.corp.company.com ip=10. netmask=255.255.254.0 bond=bond0:em1,em2:mode=active-backup,primary=em1
and then boot.msg-server-6 (which get copied to isolinux/boot.msg)
splash.lss
Welcome to the Red Hat Linux 6 Kickstart CD!!!!
If you are kickstarting a serverfrom a Build/DHCP network,
then please type one of the following options listed below at the prompt and hit enter.
kickstart6 (Red Hat 6)
kickstart6vmware (Red Hat 6 VMWare Guest)
kickstart6kvm (Red Hat 6 KVM Guest)
kickstart6nj (Red Hat 6 NJ)
To build: arrow down to the build you need, and hit tab.
Update the values for your system (IP, netmask, etc..)
0f[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]07
Once you have copied the files to the isolinux directory (located in the Release and Version specific directory), I then execute:
mkisofs -o /var/www/html/pub/${RELEASE}-${VERSION}-`date +%Y%m%d`.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T `pwd`
This is actually what is in my "staging area"
/var/www/html/pub/isolinux/
-r--r--r-- 1 root root 973 Dec 4 14:18 boot.msg-server-5
-r--r--r-- 1 root root 553 May 14 2013 boot.msg-server-6
-r--r--r-- 1 root root 448 Oct 18 12:39 boot.msg-workstation-6
-rw-r--r-- 1 root root 33857 Apr 24 2013 image.lss
-rw-r--r-- 1 root root 12623407 Sep 19 10:38 initrd.img.vmxnet-rhel5
-rw-r--r-- 1 root root 1312 Mar 12 16:13 isolinux.cfg-server-5
-r--r--r-- 1 root root 1168 Mar 19 16:08 isolinux.cfg-server-6
-r--r--r-- 1 root root 274 Oct 18 12:41 isolinux.cfg-workstation-6
drwxr-xr-x 2 root root 4096 Dec 4 13:34 RCS
-rw-r--r-- 1 root root 58794 Apr 24 2013 splash.jpg
-rw-r--r-- 1 root root 175041 Sep 19 09:43 splash.lss
I apologize for the misdirection Przemyslaw.
I have not used the cobbler buildiso option, but I assume it probably does not require a workaround.
We have a dependency to roll our own ISOs (to include an initrd which has modules for the VMXnet driver in RHEL 5). Since we basically HAVE to use this method, we embraced it and optimized it a bit and use it for both RHEL 5 and 6.
Does anyone know where the (PXE) default and menu files are stored, or are the created on the fly during the buildiso process?
Hello Przemyslaw,
Kickstart path that you see is correct, you will not be able to locate this path on Red Hat Satellite server filesystem. But you should be able to access it in webui.
Here is the snip of cobbler menu after creating cobbler build iso
LABEL rhel_6u5:1:EXAMPLEORGANIZATION
MENU LABEL rhel_6u5:1:EXAMPLEORGANIZATION
kernel 1.krn
append initrd=1.img ks=http://satellite.example.com/cblr/svc/op/ks/profile/rhel_6u5:1:EXAMPLEORGANIZATION ksdevice=bootif lang= kssendmac text
In the kickstart path you have mentioned :1:EXAMPLEORGANIZATION part is missing. So can you confirm whether your menu have details as mentioned above or not.
Wget or accessing kickstart in webui should work, here is sample output of wget command
# wget http://satellite.example.com/cblr/svc/op/ks/profile/rhel_6u4:1:EXAMPLEORGANIZATION
--2014-03-21 23:37:32-- http://satellite.example.com/cblr/svc/op/ks/profile/rhel_6u4:1:EXAMPLEORGANIZATION
Resolving satellite.example.com... xx.xx.xx.xx
Connecting to satellite.example.com|xx.xx.xx.xx|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12398 (12K) [text/plain]
Saving to: “rhel_6u4:1:EXAMPLEORGANIZATION”
100%[==================================================================================================================>] 12,398 --.-K/s in 0s
2014-03-21 23:37:33 (672 MB/s) - “rhel_6u4:1:EXAMPLEORGANIZATION” saved [12398/12398]
Regards,
Ashish
Hi Przemyslaw - You can add the following to the line that starts with "append"
hostname=KickstartBox.corp.company.com ip=10.0.0.100 netmask=255.255.254.0 gateway=10.0.0.1 dns=10.10.10.20
So - in your specific case you would have
append initrd=/images/ks-rhel-x86_64-server-6-64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://X.X.X.X/cblr/svc/op/ks/profile/minimal64:1:company
hostname=KickstartBox.corp.company.com ip=10.0.0.100 netmask=255.255.254.0 gateway=10.0.0.1 dns=10.10.10.20
There are ways around the issue that have been mentioned, which are unfortunately somewhat cumbersome (i.e. having to manually enter the IP/hostname information). Other provisioning systems will enter that information on your behalf (boot options passed in by KVM, for example).
I think I have a better understanding of your goal, but I struggle to identify a solution (I'll ask a few folks while I'm at Summit today).
If you are identifying each host and creating an individual kickstart profile for them, I believe the following provides advice that would be helpful:
http://www.cobblerd.org/manuals/2.4.0/4/2/6_-_Build_ISO.html
I found a thread which was asking a very similar question and a person offered some suggestions:
https://www.redhat.com/archives/spacewalk-list/2012-March/msg00198.html
Hopefully that helps and I will ask around to see what others do.
I believe you should be able to find it in your "default" PXE file. (I'm doing this from memory - so, let me know if it's not correct).
Depending on your setup:
/var/lib/tftpboot/pxelinux.cfg/default
/tftpboot/pxelinux.cfg/default
In that default file, there should be an entry for "menu" and you should be able to see "minimal64:1:OURORGANIZATION" in both files.
Yes this path is virtual path and there is no actual file system path present on Red Hat Satellite server.
Have you tried accessing this path and are you able to access kickstart file ?
Hi Przemyslaw -
One item I found while discovering how kickstart works (without using DHCP/PXE).
The box boots from the ISO and you basically have to identify ALL of the necessary network configuration at boot time. (which makes sense)
The part that had given me problems for the longest time is that if you boot with a set of network values, once you pull down your ks.cfg file, it will apply the network settings from that file. (it seemed strange, to me, that the process did not simply retain all the network information from the boot definition).
That is why we identify hostname, ip, netmask, dns, etc.. at boot time and removed the network definition from the kickstart profile altogether.
So - I believe you do not have DNS in your cobbler file. Can you please validate that? Also - I assumed it gave you that resolution error when attempting to download the kickstart file (and then gave you an opportunity to modify the URL)? You can, of course, use an IP at that point to make sure that everything is working.
Also - if the DNS settings are all correct in your PXE/cobbler file and kickstart and you still get this error - it is possible that your build does not recognize your network devices on the host you are attempting to build. I believe you could see that by pressing CTRL-ALT-F3 (or F2) to see if it finds an ethernet device.
One very important bit of info: reverse DNS has to be working correctly, otherwise your box is named "localhost" I believe.
Pretty fun - right? ;-)
If you are not using DHCP (or if your DHCP has invalid DNS for your server environment), you need to define the DNS information in your PXE configuration (boot menu) and depending on how you are building your host, also in the kickstart profile.
In our case (booting from ISO) - we define our DNS in the boot menu and we do not have a "network" string in our kickstart.
As in the following example:
Our Menu has (as shown above also)
label kickstart6
kernel vmlinuz
append initrd=initrd.img noipv6 lang=en_US ks=http://rhnsat01.corp.company.com/ks/cfg/org/1/label/kickstart6 dns=10.98.230.27,10.98.230.28 hostname=KickstartBox.corp.company.com ip=10. netmask=255.255.254.0 bond=bond0:em1,em2:mode=active-backup,primary=em1
We boot from the ISO then select kickstart6 and hit
vmlinuz initrd=initrd.img ks=http://prhnsat01.corp.company.com/ks/cfg/org/1/label/kickstart6 dns=10.98.230.27,10.98.230.28 hostname=prhvsrv91.corp.company.com ip=10.98.196.132 netmask=255.255.254.0 gateway=10.98.196.1 bond=bond0:em1,p3p1:mode=active-backup,primary=em1
I realize this is a bit confusing to explain over a forum post - and I also realized that I need to document this better for my own environment to explain to my peers. Once I have done so, I'll post it publicly. Our approach might seem odd to other folks, but we have some interesting dependencies and restrictions in our environment and this is the best we could come up with (and it works rather well).
Another important file location (which you want to include with your backups)
/var/lib/cobbler/config/profiles.d
i really do apologize as I wish I had more experience with Cobbler.
Something needs to tell the client what the network information is. I think most folks prefer DHCP.
Without DHCP:
- you could put an IP in the default isolinux/isolinux.cfg file on your boot iso
- manually enter ip=
when you are booting from that ISO.
I believe your method of having customized builds from Cobbler would still work.
Put enough info in the isolinux.cfg to get the host talking with your Cobbler system, then have Cobbler provide a host-specific ks.cfg with the appropriate info for that client. Each system starts with the same IP and then gets handed off to Cobbler.
Ashish (or community) - can you confirm that the static IP for start and custom cobbler ks profile would work?
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
