Automated upgrade (reinstallation)
We prefer to reinstall rather than do ubuntu upgrades on hosts; it's cleaner. The other way you might wind up with old outdated packages anf config files lying around, plus who knows what other cruft.
Contents |
Basic steps
Typically you can do this:
Dhcp file entry
Check that it is in the dhcp file on brewster. There are three files:
- /etc/dhcp3/linux-host-entries.ttyS1-115200
- This contains hosts that support the maximum line speed, including all Dell PowerEdge R410 and R610s.
- linux-host-entries.ttyS1-57600
- This contains hosts that don't support the higher line speed. Those include ...
- hmm I just looked at the PowerEdge R300 manual and it lists 115200 as the default for the serial port.
- So why would fenari (PowerEdge R300) be in the linux-host-entries.ttyS1-57600 file?
- Likewise it seems that the Dell PowerEdge 1950 and 2950 both seem to support 115200, so what's up with that?
- linux-host-entries.ttyS0-57600
- This contains only dataset1 because of its port setup and line speed; we have no other hosts with that configuration.
An average stanza might look like this:
host search14 {
option pxelinux.pathprefix "karmic-installer/";
filename "karmic-installer/ubuntu-installer/amd64/pxelinux.0";
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address search14.pmtpa.wmnet;
}
for any unbuntu install that is not the default version. That version currently is lucid; a stanza for a host booting with lucid will look like this:
host srv280 {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address srv280.pmtpa.wmnet;
}
Apaches are being installed with Ubuntu 8.04; everything else gets 10.04.
Put the FQDN for the fixed address line; for hosts with public IPs this will be something like *.wikimedia.org.
Don't forget to restart dhcp when done.
Partitions
If it's a reinstall you probably don't need to change your partition layout. You should format the partitions though. Most hosts don't have LVM, only the boxes with arrays. In the directory /srv/autoinstall on brewster there should already be a file that handles the partition layout for your host(s), and it should already be included in netboot.cfg. If not and you are automating this for the first time, create a config file with a name descriptive of the host(s). For example, we have apache.cfg, db.cfg. You can steal from one of the existing files as a base.
Here's a sample config file:
# Application server specific configuration
# Implementation specific hack:
d-i partman-auto/init_automatically_partition select 20some_device__________/var/lib/partman/devices/=dev=sda
d-i partman-auto/method string regular
d-i partman-auto/disk string /dev/sda
d-i partman/choose_partition select Finish partitioning and write changes to disk
d-i partman/confirm boolean true
# Note, expert_recipe wants to fill up the entire disk
# See http://d-i.alioth.debian.org/svn/debian-installer/installer/doc/devel/partman-auto-recipe.txt
d-i partman-auto/expert_recipe string apache : 3000 5000 8000 ext3 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / } . 1000 1000 1000 linux-swap method{ swap } format{ } . 64 1000 10000000 jfs method{ format } format{ } use_filesystem{ } filesystem{ jfs } mountpoint{ /a } .
d-i partman-auto/choose_recipe apache
# Preseeding of other packages
fontconfig fontconfig/enable_bitmaps boolean true
These are preseed file entries that get fed to prompts issued by the installer. Syntax:
<owner> <question name> <question type> <value>
- <owner>: "d-i" which stands for Debian Installer.
- <question name>: partman-auto, partman-auto-raid and partman-auto-lvm are the packages that handle automatic partitioning of
various types, and some of the questions (prompts) issued by them are described here: [1]
- <question type> says what sort of value to expect (eg string, boolean, select (for a menu)...)
- <question value> this is where you put the answer that you would otherwise be entering interactively
NOTE that after the question type you can put only one space or tab; any other whitespace will get stuffed in at the front of the value, which you probably don't want.
The first few lines of the sample config file should be obvious: select the device, choose the partition method and confirm. After that an "expert recipe" for partioning is defined, and given the name "apache". This allows it to be chosen later from the list of recipes.
Let's look at the particular recipe: it says
- 3000 5000 8000 ext3 $primary{ } $bootable{ } method{ format } format{ } use_filesystem{ } filesystem{ ext3 } mountpoint{ / }
- 3000: minumum size of partition in mb
- 5000: priority if it and other listed partitions are vying for space on the disk (this is compared with the priorities of the other partitions)
- 8000: maximum size of partition in mb (80GB; this is for 80GB disks, which the apaches all have.)
- ext3: filesystem type
- $primary{ }: this is a primary, not logical partition
- $bootable{ }: this is a bootable partition
- method{ format }: set to format to format the partition, to "keep" to not format, and to "swap" for swap partitions
- format{ }: also needed so the partition will be formatted
- use_filesystem{ }: this partition will have a filesystem on it (it won't be swap, lvm, etc)
- filesystem{ ext3 }: what filesystem it gets
- mountpoint{ / }: where it's mounted
The other two lines in the recipe should now be obvious.
- 1000 1000 1000 linux-swap method{ swap } format{ }
- 64 1000 10000000 jfs method{ format } format{ } use_filesystem{ } filesystem{ jfs } mountpoint{ /a }
Full documentation on preseed files here: [2]
Full documentation on partman-auto preseeding for recipe creation here: [3]
Other info for preseeding
The above stanza had some fontconfig stuff in it. Which hosts should get that? What else do we need to look out for?
Adding to netboot.cfg
Really, you're adding to pressed.cfg, as Debian docs say, but that's just a symlink, so... After you have tweaked the server config file to your liking, add it in to netboot.cfg. Example of a netconfig addition below:
amslvs*) echo squid-raid1.cfg ;;
The string before the ) is a regexp that expands to all hostnames covered by specified config file. Be careful to get the regexp right!
You won't need to restart anything; these changes take place immediately.
And now boot
Connect to the management console on the host you are reinstalling. Reboot; for dells, F12 during post should get it to PXE boot.
If you see a complaint about no dhcp offers received, this is likely an indication that the host is ont he wrong vlan or that you got the FQDN wrong ... or that you forgot to restart dhcp after adding the stanza for the host.
Post install
Make any changes needed (or add a new entry) to puppet for the host.
And finally...
Profit! :-P