Hello All,
I have a KS.cfg script that appears to work good. Except for the partitioning part of my script, when I use the script the storage does not show up (even after rescan). But when I do a normal install (not scripted) the local storage shows up, here is the partitioning information from my script, can somebody please tell me if they see the error, or show me yours that works correctly. Thank you.
Clear Partitions
clearpart --all --initlabel --drives=sda
Partitioning
part /boot --fstype ext3 --size 100 --ondisk sda
part / --fstype ext3 --size 4824 --ondisk sda
part None --fstype vmfs3 --size 2100 --grow --ondisk sda
part swap --size 544 --ondisk sda
part /var/log --fstype ext3 --size 1456 --grow --ondisk sda
part None --fstype vmkcore --size 100 --ondisk sda
Are you sure sda is the controller that you want to install it on? For example when I partition my HP servers sda is not the local storage controller cciss\c0d0 is. In fact sda is my first san lun. What type of server are you using and what storage controller do you have?
After it boots, what does fdisk -l show?
Also, thats a 2.1GB vmfs3 partition - I'm pretty sure thats smaller than the required minimum size.
--Matt
This is on a Sun Microsystems Sun Fire x4100 M2. I had spot checked a couple of other ESX servers and they all had sda as the device it was installed on, I just checked another one that was recently added and it is showing sdc. The storage controller is LSI. So if the /dev/sdX can change how do I script that?
Here is the output of fdisk -l
Disk /dev/sda: 291.9 GB, 291999055872 bytes
255 heads, 63 sectors/track, 35500 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 628 4939987+ 83 Linux
/dev/sda3 629 21173 165027712+ fb Unknown
/dev/sda4 21174 35500 115081627+ f Win95 Ext'd (LBA)
/dev/sda5 21174 35418 114422931 83 Linux
/dev/sda6 35419 35487 554211 82 Linux swap
/dev/sda7 35488 35500 104391 fc Unknown
I took the 2.1GB vmfs partition from an existing ESX server. That can be changed in the script, right?
What do you end up with when you use the ks.cfg?
-KjB
What does the fdisk -l report? You obviously have a system up and running, so how is the partition laid out on it?
-KjB
Here is the output of a ESX host that was not installed via KS.cfg script:
Disk /dev/sda: 145.9 GB, 145999527936 bytes
255 heads, 63 sectors/track, 17750 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 650 5116702+ 83 Linux
/dev/sda3 651 17414 134656830 fb Unknown
/dev/sda4 17415 17750 2698920 f Win95 Ext'd (LBA)
/dev/sda5 17415 17483 554211 82 Linux swap
/dev/sda6 17484 17737 2040223+ 83 Linux
/dev/sda7 17738 17750 104391 fc Unknown
Forgive for I do not see much of a difference.
Question: Where did you create this file? Was it on a windows system, or on a linux box? You may have the classic dos2unix problem, and your syntax looks correct. Open the file on a Linux/unix system, and run 'cat -A ks.cfg'
See if you have ^M at the end of each line
If you do, it's in windows format, and must be converted. To do that:
type 'vi ks.cfg'
type ":"
type "set noexrc fileformat=unix"
type the Esc key
Then type: ":wq!"
Run 'cat -A ks.cfg' again and make sure the ^M are gone and all you have are $ at the end of the line.
Hopefully that should fix your problem.
-KjB
The file was created from the ESX server web scripted installer page, how would the file format corrupt only the local storage portion of the install? Every thing else works fine, and this is a random problem. I have installed other ESX servers via the script and was able to see local storage fine.
I did the 'cat -A KS.cfg' on the file and I saw $ on every line, at the begening and end. Still puzzled.
Can you post the ks.cfg so we can take a look?
-KjB
Here are the contents...
install
#Regional Settings
keyboard us
lang en_US
langsupport --default en_US
timezone America/Chicago
#Mouse
mouse none
#X windowing System
skipx
#Text Mode
text
#Installation Method
#Network install type
%include /tmp/networkconfig
#root Password
rootpw --iscrypted 47896ghUIU&yhu&T&rR65$F
#Firewall settings
firewall --disabled
#Authconfig
authconfig --enableshadow --enablemd5
#BootLoader
bootloader --location=mbr
#Reboot?
reboot
#VMware Specific Commands
vmaccepteula
#Clear Partitions
clearpart --all --initlabel --drives=sda
#Partitioning
part /boot --fstype ext3 --size 100 --ondisk sda
part / --fstype ext3 --size 4824 --ondisk sda
part None --fstype vmfs3 --size 2100 --grow --ondisk sda
part swap --size 544 --ondisk sda
part /var/log --fstype ext3 --size 1456 --grow --ondisk sda
part None --fstype vmkcore --size 100 --ondisk sda
%packages
@base
%pre
set -- `cat /proc/cmdline`
for I in $*; do case "$I" in =) eval $I;; esac; done
echo IP address found $ESXIP
cat << EOF >> /tmp/networkconfig
network --device eth0 --bootproto static --ip 192.168.4.$ --netmask 255.255.255.0 --gateway 192.168.4.1 --nameserver 192.168.1.43 --hostname ESX0$.com
EOF
%post
#!/bin/sh
cat > /tmp/esxcfg.sh << EOF1
#!/bin/sh
#Configure ESX Server
#Add 2nd DNS setting
echo nameserver 192.168.1.44 >> /etc/resolv.conf
#Activate changes to reflect them into Virtual Center
service mgmt-vmware restart
EOF1
#Make esxcfg.sh eXecutable
chmod +x /tmp/esxcfg.sh
#Backup original rc.local file
cp /etc/rc.d/rc.local /etc/rc.d/rc.local.bak
#Make esxcfg.sh run from rc.local and make rc.local reset itself
cat >> /etc/rc.d/rc.local <<EOF
cd /tmp
/tmp/esxcfg.sh
mv -f /etc/rc.d/rc.local.bak /etc/rc.d/rc.local
EOF
Try this for the part section:
part /boot --fstype ext3 --size=100 --ondisk=sda
part / --fstype ext3 --size=4824 --ondisk=sda
part None --fstype vmfs3 --size=2100 --grow --ondisk=sda
part swap --size=544 --ondisk=sda
part /var/log --fstype ext3 --size=1456 --grow --ondisk=sda
part None --fstype vmkcore --size=100 --ondisk=sda
-KjB
Message was edited by: kjb007 : forgot an =
Hi,
are you sure that your script really perform a VMFS format?
Looks like it only create the partition table entries and perform the format for the linux partitions.
Not sure, I thought that was performed during the install automatically. This config file was created with the scripted installer builder from an ESX server, is there a command I can issue to ensure the partition is formatted?
vmkfstools can be used to create a vmfs if it hasn't already been done: vmkfstools -C vmfs3 -S <NAME_HERE> vmhba0:0:0:0
-KjB
This has been postponed until I get more time, for now not using an KS.cfg script is the workaround. Thanks all for your input.