cobbler buildiso, kickstart & satellite

Latest response

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

Hi James,

I am a bit confused. Does that mean that "buildiso" option doesn't work and I have to use workarounds ?

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

Hello Ashish,

I have got something like that:

# cobbler profile list
   minimal64:1:OURORGANIZATION

Where can I find cobbler menu to verify it ?

Hi Ashish,

when I compare yours pxelinux.cfg/default file and mine it seems they differe quite a lot. Ours is:

LABEL minimal64:1:company
        kernel /images/ks-rhel-x86_64-server-6-64/vmlinuz
        MENU LABEL minimal64:1:company
        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
        ipappend 2

When I boot from my buildiso ISO the network card is not configured and it can't download any kickstart. Can I include somehow IP address in the ISO (without specifying it on the command line) so that it could download kickstart file ?

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 

Hi James,

this is what I wanted to avoid - imagine I have to install tens of hundreds servers without having DHCP/PXE boot environment - a nightmare ...

Isn't cobbler supposed to deal with it ? I mean "buildiso" option in manuals is described as an option to install automatically in environments without DHCP/PXE boot. If you have DHCP server you can specify in a client MAC address. And that is all.

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.

In our case I don't mind if I have to use "cobbler system add ...(with different ip for each system)" several times - we can create script and automate it - that is no problem.

The ideal solution is the following:
- boot ISO built with "cobbler buildiso"
- press ENTER to boot and install particular system (without having DHCP/PXE) choosen from menu
and that's all.

From the URL - it says:

Alternatively, you could go your other route of adding the system to cobbler prior to building the ISO and just hitting ENTER on the desired system 

And this is the approach I have chosen. But it doesn't work ...

Actually I can now choose from ISO menu particular system to install (I have forgotten to add --system option before ...) but the error I get is:

ERROR: Error downloading http://<our satellite>/cblr/svc/op/ks/system/<our system to install>: Couldn't resolve host name

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.

You are correct James,

On Red Hat Satellite default tftpboot location is /var/lib/tftpboot/. Bellow file is update on every execution of "cobbler sync" with new kickstart profiles created using satellite webui.

/var/lib/tftpboot/pxelinux.cfg/default

Regards,
Ashish

This is my /var/lib/tftpboot/pxelinux.cfg/default file:

# cat /var/lib/tftpboot/pxelinux.cfg/default
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://fedorahosted.org/cobbler
TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local

LABEL local
        MENU LABEL (local)
        MENU DEFAULT
        LOCALBOOT 0

LABEL minimal64:1:OURORGANIZATION
        kernel /images/ks-rhel-x86_64-server-6-64/vmlinuz
        MENU LABEL minimal64:1:OURORGANIZATION
        append initrd=/images/ks-rhel-x86_64-server-6-64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://10.222.16.56/cblr/svc/op/ks/profile/minimal64:1:OURORGANIZATION
        ipappend 2

Is the path cblr/svc/op/ks sort of virtual path ?

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 ?

I have tried that and now it is complaining that couldn't resolve our Satellite host name.
Why is that ?
Can I add nameserver option using the kickstart WEB UI ?

I have just found where I can add it: Kickstart Details -> Advanced Options -> network

But I still have the same error:

Couldn't resolve host name.

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 , we then populate all of the following:

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

Hi James,

I can't use dhcp nor PXE. I have to use buildiso + static IP addresses.
Do I have to specify IP address every time I boot from this (build)iso ? I thought I could use "cobbler system add ..." and just boot server which should automatically install taking all network data from cobbler. Is it doable ?

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?

For various reasons we can't use DHCP so we have to use buildiso option. But I thought that I don't have to use static IP address in any kickstart related files and use cobbler for it (cobbler system add ...)

Close

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