VMware Cloud Community
kri-2
Hot Shot
Hot Shot
Jump to solution

Automating installation of ESX4 with kickstart

Hi,

we used to install our esx3.5 from a remastered cdiso which included the ks.cfg file. The kickstart file did some pre and postscripts. The network line in the ks.cfg was nearly blank and so the text mode dialog showed up and asked for ip, subnet, gateway, nameserver. After entering the data the hostname was provided from dns and the installation began using a nfs share.

The network line looked like this:

network --bootproto static --addvmportgroup=1 --vlanid=0

Now I am trying to do it the same with esx4:

I did a manual install of esx4 and copied the /root/ks.cfg to the esx4.iso. The network line was changed to:

network --addvmportgroup=true --device=vmnic0 --bootproto=static

When booting from the cd the menu shows up and asks to select the installation mode: text, graphical, overwritevmfs,...Here I press F2 and enter ks=cdrom:/ks.cfg.

After this the setup boots up but throws an error: bootproto was set to static but "--ip=" was not set. See the screenshot! This is not the expected behaviour :-(.

Does anyone here use the same way of installation? This method is used here, because of not having dhcp or pxe available.

Hoping that someone can help me! Any ideas here?

Chris

Reply
0 Kudos
1 Solution

Accepted Solutions
GraphiteDak
Enthusiast
Enthusiast
Jump to solution

All,

Finally got some time to work in the %pre section to get user input. tty1 must be used only. I am only grabbing IP and fqdn hostname as the rest is read from the append line of pxelinux. Using this you only need one kickstart if your hardware is like. Much better than 100's right? Only takes a few seconds to get user input.

Here is the kickstart up until the %post section which is just normal stuff. Much can be moved to %pre if need be.

View solution in original post

Reply
0 Kudos
16 Replies
allb18c
Enthusiast
Enthusiast
Jump to solution

Try this - it works for us and we went throught the same boat from 3.5u4 to 4.0 scripted installs:

network --bootproto=static --ip=XXX.XXX.XXX.XXX --netmask=XXX.XXX.XXX.XXX --gateway=XXX.XXX.XXX.XXX --nameserver=XXX.XXX.XXX.XXX --hostname=hostname --device=vmnic0 --addvmportgroup=0

Reply
0 Kudos
kri-2
Hot Shot
Hot Shot
Jump to solution

Hi,

thanks for your answer. But this is what I do not want to. If I hardscript the IP configurations how do I install another host? I want to use the same iso and ks.cfg file for every host I install. The choice of which one to install is done by entering different IPs.

Or do you really mean to use the "XXX"s in the ks.cfg file?

Chris

Reply
0 Kudos
GraphiteDak
Enthusiast
Enthusiast
Jump to solution

I am in the same boat here. In the old kickstart you could leave the networking blank and it would prompt you. With hundreds of hosts, having separate hardcoded hostnames and IP addresses and multiple kickstarts is absolutely NOT an option. VMware needs to add the ability to prompt for networking information during the kickstart install.

I guess we'll have to come up with a %pre section to grab input until this is resolved.

kri-2
Hot Shot
Hot Shot
Jump to solution

hi,

good to here someone has exactly the same problem. So i can be sure i am not doing anything wrong.

I remember trying to get some userinteraction with "read" in %pre with 3.x but had some strange problems with timeouts while waiting for input.

Did you already try it in 4? Please don't forget me if you have any good solution! Smiley Happy

Bye, Chris

Reply
0 Kudos
GraphiteDak
Enthusiast
Enthusiast
Jump to solution

read doesn't appear to work at the moment and still trying to figure out why. weasel fires off the temp script but nothing will echo to the screen and input doesn't appear to work either.

I would think it's much easier for vmware to just have the networkconfig portion work the same as before where if it doen't find the network line in the ks it will prompt you for it. Let's hope they read these threads..

Reply
0 Kudos
allb18c
Enthusiast
Enthusiast
Jump to solution

Why dont you guys just create a build repository with all IP host information? In our environment, we have a ks script for each of our hosts. When there is a new build out, we only update the path to the new media location and any agents if applicable. Our Host IP's stay static so we build the script once and forget it.

GraphiteDak
Enthusiast
Enthusiast
Jump to solution

Because we aren't talking about just a few servers here. :smileygrin: I do a TON of post script installations and if something would change I don't necessarily want to edit the amount of KS's I'd have to.

Reply
0 Kudos
allb18c
Enthusiast
Enthusiast
Jump to solution

100 host environment here my friend...;)

Reply
0 Kudos
GraphiteDak
Enthusiast
Enthusiast
Jump to solution

many many more... Smiley Wink

Reply
0 Kudos
kri-2
Hot Shot
Hot Shot
Jump to solution

Hi allb,

what do you mean with a build repo and where do you have it? Is it on the installation medium (cd, iso, usb) or in the network (nfs, http)?

And at what point do you define which host to install? Is it at the bootmenu which is build of the syslinux.cfg? If yes, how many entries can a syslinux.cfg have?

Chris

Reply
0 Kudos
allb18c
Enthusiast
Enthusiast
Jump to solution

Hi Chris,

We dont mess with creating a tweaked ISO.

The scripts/media are held on the network which can be accessed via nfs or http.

PXE boot or direct attached DVD is utilized to boot the kernel and initrd. After it loads we

hit F2 and then specify the path to the script in question. ie. ks=nfs://some.server.example.com/path/to/%ESXhostname%.cfg

The scipt will provide the specific IP information in order for automated installation to occur.

In my opinion this is easier than manually inputting IP's everytime you want to rebuild a host.

The installation guide speaks to this.

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

Hi,

When you enter the kickstart location after pressing F2, Ex: ks=cdrom:/ks.cfg, just enter the ip along with it.

Ex: ks=cdrom:/ks.cfg ksdevice=vmnic0 ip=

This would take the ip specified as static ip for this host.

Hope it helps.

Thanks

Reply
0 Kudos
mikeyhoward
Enthusiast
Enthusiast
Jump to solution

kickstartesx.com will handle all of this for you. The initial beta will be for ISO only, but NFS, HTTP and FTP will follow very soon after

-


Visit: http://www.kickstartesx.com

Rapid deployment, zero intervention

Blogging: http://www.mikehoward.me.uk
Reply
0 Kudos
GraphiteDak
Enthusiast
Enthusiast
Jump to solution

All,

Finally got some time to work in the %pre section to get user input. tty1 must be used only. I am only grabbing IP and fqdn hostname as the rest is read from the append line of pxelinux. Using this you only need one kickstart if your hardware is like. Much better than 100's right? Only takes a few seconds to get user input.

Here is the kickstart up until the %post section which is just normal stuff. Much can be moved to %pre if need be.

Reply
0 Kudos
dougdavis22
Hot Shot
Hot Shot
Jump to solution

GraphiteDak,

Thanks for posting your ks.cfg file - this has really helped me make progress with my own for ESX4.

I'm having some problems getting my %post to run correctly though - wonder if you or anyone else can help. I've attached an edited version of my %post that was working in 3.5 but doesn't work with 4.

First problem is that the files I'm trying to copy to /tmp in the --nochroot section don't stick i.e. they seem to be copied there during installation, but then when the server reboots they're not there afterwards. This may also be part of my other problem in that the esxconfig.sh script either isn't being written or is disappearing along with the other files I expect to see in /tmp.

Any ideas what's going wrong?

Any help greatly appreciated.

Thanks,

Doug.

Reply
0 Kudos
Hiney
Enthusiast
Enthusiast
Jump to solution

That's pretty cool. at the %pre stage, do you have an IP number (eg dhcp) ? if so, you could just lwpDownload the information from the master build server (based on mac addr or just the prompted for hostname - without domain) instead of asking for all of it. I don't know the conditions that are available at that point in the build, it mightn't be possible.

I have a server.conf, and a script that processes it to produce individual ks files and a pxelinux conf entries, in an attempt to deal with the issue, but i only have 50 or so servers. the more you have the better the lwpDownload option looks

"I have an inferiority complex, it's just not a very good one."

"I have an inferiority complex, it's just not a very good one."
Reply
0 Kudos