VMware Cloud Community
NCC1470
Contributor
Contributor
Jump to solution

ESX 4 no more kickstart from harddisk: ks=hd:sda1/ks.cfg ?

Hi,

I am running a scripted install for 3.5.0 by placing the kickstart file on a "disposable" FAT partition and boot the installation with:

label text kernel /pxeboot/vmlinuz append initrd=/pxeboot/initrd.img text ks=hd:sda1/ks.cfg default text

...I was trying to install ESX 4 the same way but the kickstart file does not get read!

The installation guide is inconsistent here it gives: Default installation script, FTP, HTTP/HTTPS, NFS, USB flash drive (what reads for me as ks=hd...), Local disk

but only this kickstart locations for the boot: ks=cdrom:, ks=file://<path>/ks.cfg, ks=ftp://<server>/<path>/ks.cfg, ks=http://<server>/<path>/ks.cfg, nfs=nfs://<server>/<path>/ks.cfg

Any ideas?

Max

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Hi, Max,

ks=hd is not supported in vSphere 4.0.

If you have ks file on disk, you can use ks=UUID:.

For details, please refer to ESX and vCenter Server Installation Guide(http://www.vmware.com/pdf/vsphere4/r40/vsp_40_esx_vc_installation_guide.pdf), page 26.

Thanks.

Kern.

View solution in original post

Reply
0 Kudos
23 Replies
K-MaC
Expert
Expert
Jump to solution

Hello Max. Please take a look at the following page for help.

http://blog.laspina.ca/ubiquitous/automating-vsphere-esx4-host-installations

Cheers

Kevin

Cheers Kevin
NCC1470
Contributor
Contributor
Jump to solution

Hi Kevin,

this is a great resource but as in the installation guide there is no way to load the kickstart file from hard disk.

(I am getting a something "weasel skipped token": ks=hd:sda1/ks.cfg)

I was testing the installation with getting the ks.cfg from http what worked fine -but I do not have a http service in the productive environment.

Max

Reply
0 Kudos
mike_laspina
Champion
Champion
Jump to solution

Hi,

You cannot specify the linux kickstart hd method combined with a pxeboot based method. Keep in mind that the ESX 4 VMware install is not fully compatible with kickstart as specified in the docs.Many commands will not work.

The vSphere documentation specifies that you can use an extended partition ks spec on the local system using a UUID format. Never tried it myself and frankly I would not want to (ugly!).

ks=UUID:<partition-UUID>:/<path> Performs a scripted installation with a script located on the ext

partition with the given UUID.

vExpert 2009

http://blog.laspina.ca/ vExpert 2009
admin
Immortal
Immortal
Jump to solution

Hi, Max,

ks=hd is not supported in vSphere 4.0.

If you have ks file on disk, you can use ks=UUID:.

For details, please refer to ESX and vCenter Server Installation Guide(http://www.vmware.com/pdf/vsphere4/r40/vsp_40_esx_vc_installation_guide.pdf), page 26.

Thanks.

Kern.

Reply
0 Kudos
NCC1470
Contributor
Contributor
Jump to solution

...your are right UUID is ugly and impossible with the means of my pre installation system.

Anyway I found a way by adding my ks.cfg to the initrd.img and appended the ks as ks=file:///ks.cfg

Well, thank you for the support!

Lets hope VMware does not remove this way of configurating, too Smiley Wink

Max

...and now what I did to the initrd.img:

#make a temp home for the filesys in initrd.img

mkdir /esx/newinit

cd /esx/newinit

cp ../initrd.img .

#gunzip initrd.img

mv initrd.img initrd.im.gz

gunzip initrd.im.gz

#extract the filesystem in initrd

/esx/bin/cpio -i < initrd.im

copy ks.cfg

cp /esx/ks.cfg .

#clean up the init filesystem

rm initrd.im

#make the new inintrd.im

find .|/esx/bin/cpio -o --format='newc' > ../initrd.im

#compress the initrd.im

cd /esx

gzip initrd.im

#just rename

mv initrd.im.gz initrd.img

Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

ncc,

I'm using altiris and trying to get it to deploy vSphere. It does something very similar to your method, and injects a ks file into initrd.

Like this:

  1. Inject kickstart file into initrd

pushd .

cd $hddir/init

mkdir mountedinit

mv initrd.img initrd.gz

gunzip initrd.gz

mount initrd ./mountedinit -o loop

cp -af ks.cfg ./mountedinit

umount ./mountedinit

gzip initrd

mv initrd.gz initrd.img

popd

http:// ! -e $hddir/init/initrd.img && ErrorHandle 248

My problem is when I try using:

title RDP Linux Loader

root (hd0,0)

kernel /init/vmlinuz $k1 ks=file:///init/ks.cfg mem=512M

initrd /init/initrd.img

It says that ks.cfg does not exist. Altiris is using grub 0.97, and if I go to the command line and cat /init/ks.cfg, it is there and it is correct.

I've tried ks=file:///ks/cfg (not found)

ks=file:/ks/cfg (this works for ESX 3.5 - but for vsphere it just ignores it and doesn't even try to load a ks file)

and every other permutation I can think of.

What exact syntax are you using?

rgds,

rgds, John B
Reply
0 Kudos
NCC1470
Contributor
Contributor
Jump to solution

Hi John,

the format of the initrd.img file changed from 3.n to 4!

Your config works for 3.n where the initrd.img is a gziped cramfs file.

My config is for ESX 4 where the initrd.img is a gziped cpio Archive.

There for the steps you need for ESX4 are:

  1. make directory for the contence to the ram-fs

  2. copy the initrd.img to the new directory

  3. cd to the new directory

  4. rename initrd.img to initrd.im.gz

  5. unzip

  6. extract the filesystem in initrd

cpio -i < initrd.im

  1. copy ks.cfg

  2. clean up the init filesystem

rm initrd.im

  1. make the new inintrd.im

find .|/esx/bin/cpio -o --format='newc' > ../initrd.im

cd ..

  1. compress the initrd.im

gzip initrd.im

  1. rename to initrd.img

Important hind: the most difficult thing get a cpio that runs in the linux of altiris linux PE so I am attaching a running version (cpio-2.5)

Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

NCC1470,

Thanks a lot for your reply - that's exactly what I was needing. This is new to me so I've been struggling. These steps are performed in a script on the altiris server - so I can change the script. I'm not sure where to put the cpio though, as I'm not really sure where the script actually runs. The altiris deployment server is running on a Windows server, but there must be a linux environment that this script runs in (?) and that is where the cpio needs to go.

I might just try changing the script first - and see what happens.

rgds,

rgds, John B
Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

Max,

I've figured out how to get the cpio onto the altiris server, and my script (with your new commands) seems to run OK. The problem is still exactly the same ks.cfg does not exist. I know it does exist, as I can cat it from a grub command prompt. Once the kernel loads and weasel starts running, I don't know where the file is anymore (ie how you specifiy a path to it).

I think I'm going to have to redo how pxe is loading the kernel for ESX 4 Smiley Sad

rgds, John B
Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

FYI - I've gotten this to work. Thanks a lot for your help, as we wouldn't have gotten this far without it.

NOTE: In altiris, I had to make a big grub partition for all this unzipping etc. 500MB wasn't big enough, so I went to 2GB and that did the trick Smiley Wink

rgds, John B
Reply
0 Kudos
NCC1470
Contributor
Contributor
Jump to solution

...you found a bug in my documentation! -Thank you!

I changed the partition size without any notice to 2GB as you did.

Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

You are the only one (that I have found) who has posted any information on this. Documentation for altiris and vsphere seems pretty thin on the ground. My next challenge is to get a kickstart file that actually works (now that I'm finally able to process it).

Thanks again for your help.

rgds, John B
Reply
0 Kudos
rt7500
Contributor
Contributor
Jump to solution

Which file specifically did you modify to increase the grub.img and what line did you modify?

I've been trying the C:\Program Files\Altiris\eXpress\Deployment Server\PXE\MasterImages\MenuOption160\X86PC\pxelinux.cfg and C:\Program Files\Altiris\eXpress\Deployment Server\PXE
MenuOption160\X86PC\pxelinux.cfg with no luck when increasing the ramdisk_size=500000

Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

rt,

I didn't change a file or change the size of the grub image - I changed the size of the partition that gets created when the grub image is pushed down. I've attached a screenshot from the altiris job in the deployment console. In the step that pushes down grub.img - click on the advanced button.

rgds, John B
Reply
0 Kudos
allb18c
Enthusiast
Enthusiast
Jump to solution

Hi guys,

Is it possible to share (not a step-by-step) how you are able to use Altiris RDP to PXE boot for vSphere installs? High-level overview? It looks like I need to create a custom linux boot disk. I'm not sure what source files to use for it.

This looks to be a real time saver vs. the current method use are using.

Any assitance would be greatly appreciated.

Thanks.

Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

Are you using altiris for ESX 3.5 deployments? What I did was take a ESX 3.5 deployment and adapt it for vsphere. I wouldn't be able to talk you through it from scratch though.

rgds, John B
Reply
0 Kudos
allb18c
Enthusiast
Enthusiast
Jump to solution

We are not using altiris for ESX deployments. I started to look at it before when the winds were calm. I'll have to revisit it and go from there. I know there is a default ESX installation job so I'll take that and whats been written here and modify it. Thanks.

Reply
0 Kudos
TaupoJohn
Contributor
Contributor
Jump to solution

That's what I did. Change the vmesx.sh script with the stuff in here, and don't forget the part where you make the grub partition 2GB Smiley Wink

rgds, John B
Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

You can actually concatenate a gzipped cpio image directly onto the installer's initrd.img and use that, you don't have to unroll the installer image and roll it back up.

$ echo {list of files} | /bin/cpio --format=newc -o | /bin/gzip &gt; ksinitrd.img

$ cat initrd.img ksinitrd.img &gt; newinitrd.img

Reply
0 Kudos