I have seen a couple messages here and around the net around getting the 
cobbler partition selection to work, but I am having a devil of a time.

I have a kickstart that I have converted to use in cobbler.  I have slightly 
modified the pre_partition_select snippet that comes with cobbler 2.0.11.  It 
is working fine under centos 6, but I cannot get it to work on centos 5.  Under 
centos 5 kickstarting it appeared that the /tmp/partinfo file is never created 
or imported.

I saw some a tip about the python path possibly not getting set within 
anaconda, so I changed the 'set \$(list-harddrives)' line to 'set 
\$(PYTHONPATH=/usr/lib/booty list-harddrives)', which didn't help.

When kickstarting centos 5, anaconda never seems to get the PART= lines and 
prompts me to decide on partitions.  Needless to say this invalidates the whole 
unattended setup paradigm :).

With centos 6, it just seemed to work.

As of today, I am getting a different set of errors.  Now I am getting all 
sorts of weird errors on centos 5 & 6.

When I run cobbler validateks, all my EL6 profiles and systems check out fine, 
but all the 5 ones error with:

checking url: http://10.74.67.42/cblr/svc/op/ks/profile/centos5_32
running: /usr/bin/ksvalidator 
"http://10.74.67.42/cblr/svc/op/ks/profile/centos5_32";
received on stdout: The following problem occurred on line 52 of the kickstart 
file:

Unknown command: set

The following problem occurred on line 53 of the kickstart file:

Unknown command: let

The following problem occurred on line 54 of the kickstart file:
etc, about 50 of these per kickstart.  When I actually tried to kickstart a 
test machine with that profile, anaconda bailed at the same line, with the same 
error "Unknown command: set"

I have two questions. 1) is there any way to get better visibility into the 
kickstart/anaconda process?  It is very frustrating to try and debug this 
process by manually working through the kickstart (when possible) and then 
copying the log files over to another machine to look at, not to mention the 
10+ minutes these servers take to reboot.

2) Are people generally using something else for partition selection?  Our 
environment doesn't really have that many variables around partitioning.  I set 
a ksmeta "isvirt" so that vms get a different partition layout than physical 
servers, and I need a good way to select the first /dev/cciss/ drive for HP 
servers, and ideally a way to exclude SAN volumes so I don't accidentally 
reformat a SAN database when rebuilding a box (which has happened, luckily a 
SAN volume that was due to be reclaimed anyway and was unneeded).  I saw some 
messages on the redhat-kickstart list about using /proc/partitions to do this 
perhaps?

Sorry about the length of this email, trying to be thorough.  For anybody still 
reading, here is the snippet, followed by the relevant portions of my kickstart 
templates.

# partition details calculation

# Determine how many drives we have
set \$(PYTHONPATH=/usr/lib/booty list-harddrives)
let numd=\$#/2
d1=\$1
d2=\$3
# want to know exactly what the list-harddrives outputs
# from the stub code it is a sorted list of <name> <size> of all drives.
# echo \$(list-harddrives)
# Get the ksmeta variable, if passed in.  If this is a virtual, we want to set 
up the partitions correctly.
#set $isvirt = $getVar('isvirt', None)

# Determine architecture-specific partitioning needs
EFI_PART=""
PPC_PREP_PART=""
BOOT_PART=""
ROOT_PART=""
SWAP_PART=""
VAR_PART=""

case \$(uname -m) in
    ia64)
        EFI_PART="part /boot/efi --fstype vfat --size 200 --recommended 
--ondisk=\$d1"
        ;;
    ppc*)
        PPC_PREP_PART="part None --fstype 'PPC PReP Boot' --size 8"
        BOOT_PART="part /boot --fstype ext3 --size 200 --recommended 
--ondisk=\$d1"
        ;;
    *)
        BOOT_PART="part /boot --fstype ext3 --size 200 --recommended 
--ondisk=\$d1"
        ;;
esac

# Now set our partitions based on whether this is a vm or not
#if $isvirt == "true"
ROOT_PART="part /     --asprimary --fstype ext3 
--fsoptions=\"defaults,noatime\" --size=5000 --ondisk=\$d1 --recommended"
SWAP_PART="part swap  --asprimary --fstype swap --size=1000 --ondisk=\$d1 
--recommended"
VAR_PART="part /var   --asprimary --fstype ext3 
--fsoptions=\"defaults,noatime\" --size=8000 --grow --ondisk=\$d1"
#else
ROOT_PART="part /     --asprimary --fstype ext3 
--fsoptions=\"defaults,noatime\" --size=12000 --grow --ondisk=\$d1 
--recommended"
SWAP_PART="part swap  --asprimary --fstype swap --size=8192 --ondisk=\$d1 
--recommended"
#end if

cat <<EOF > /tmp/partinfo
\$EFI_PART
\$PPC_PREP_PART
\$BOOT_PART
\$ROOT_PART
\$VAR_PART
\$SWAP_PART
# This should be the last line of pre_partition_info_gmi cobbler snippet
EOF
# End pre_partition_select_gmi /tmp/partinfo and /root/partinfo should hold 
instructions


Kickstart template:
# kickstart template for el5 OSes
# partinfo not currently working.

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --disable
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, 
include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config')
# Reboot after installation
reboot

#Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone --utc America/Vancouver
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
$SNIPPET('pre_partition_select_gmi')
%pre
$SNIPPET('log_ks_pre')
$kickstart_start
$SNIPPET('pre_install_network_config')
$SNIPPET('main_partition_select')

# Enable installation monitoring
#$SNIPPET('pre_anamon')
%end

%packages --excludedocs
$SNIPPET('func_install_if_enabled')
$SNIPPET('puppet_install_if_enabled')
$SNIPPET('koan_install_if_virt')
@legacy-software-support
@system-tools
vim-enhanced

%post
$SNIPPET('log_ks_post')
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
$SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
# $SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
# $SNIPPET('post_anamon')
# Start final steps
$SNIPPET('post_housecleaning_gmi')
$SNIPPET('puppet_register_if_enabled')
$SNIPPET('post_puppet_initial_runs')

$kickstart_done
# End final steps

Pretty much the only differences between my centos 5 & 6 kickstart templates is 
the removal of the %end tags:
diff gmi_base.ks gmi_base_centos5.ks 
1,3c1,2
< # kickstart template for Fedora 8 and later.
< # (includes %end blocks)
< # do not use with earlier distros
---
> # kickstart template for el5 OSes
> # partinfo not currently working.
44c43
< 
---
> $SNIPPET('pre_partition_select_gmi')
49c48,49
< $SNIPPET('pre_partition_select_gmi')
---
> $SNIPPET('main_partition_select')
> 
54,55c54
< $SNIPPET('main_partition_select')
< %packages --excludedocs --ignoremissing
---
> %packages --excludedocs
142d140
< %end
165d162
< %end

Thanks so much for any assistance with this.

Jim Goddard
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to