Thursday 27 March 2014

Recreating JET templates for Solaris systems that have been left to fester...

In a former life the team I worked in inherited two estates of Solaris 8, 9 and 10 servers in a semi-neglected state, and eventually it became our task to ensure they could be recovered.

The answer naturally was some kind of Flash Archive combined with the usual dump the config of everything into /var/recovery/.

All of this is good and all, but how to fix things on the recovery side? Yes we could just stick a dvd in a machine, and recovery it manually. That would work, but it seemed a bit clunky, besides two issues came up...

  • most of the estate didn't have dvd drives, and in a few cases, didn't even have cdrom drives - either way boot media has always gone walkies by the time you need it. It had to be a network recovery.
  • the media we did have to hand didn't support ZFS format flar's.
So the decision was made to resurrect the JET install servers and to my horror these were in a terrible state on one side - ancient version of JET and templates that hadn't been touched for many years, the other they were setup to build a bare bones server that could then have a full restore dropped on top.

Surely there was a base OS command to retrospectively regenerate a system's JET template? no? Surely someones written a script to do this? no?

So I sat down and figured out a way and since this was developed on my time i'm offering it out to the unfortunate Solaris sysadmins who are stuck with management unwilling to let you go to 11. Here it is for your use - https://bitbucket.org/mfv2112/solrec. You don't need to use git, theres a download tab to fetch the scripts in a .zip, .tar.gz etc.

Its no frills, its pretty basic but it does just enough to get you going. Hopefully its written in such a way that you can extend if you need (I've not done Veritas boot for example - not that you should be using Veritas on your boot disks!). You'll need to configure a few variables in the scripts to point to the locations you like to keep stuff.

The process is fairly simple. Run take_flar.sh on your servers which will generate a .flar and a .jet file and copy those to your central location. The .jet file contains all the config that get_profile.ksh has managed to figure out from your system.

Known fields you need to manually check after generation:

  • base_config_ClientOS - obviously the script can't know what definitions you have in JET, it makes a stab at a sane name you're probably using.
  • base_config_ClientEther - you'll need to ensure the correct MAC is being used. Again, the script doesn't know which is your backup network.
  • base_config_sysidcfg_ip_address and base_config_sysidcfg_netmask - just be sure they are sane for your setup.
  • flash_archive_locations - again, the script can't know where you keep things in advance. You need to set this to your nfs/http/ftp server where you serve your images out from.
Once you check the above, on your jumpstart server run rebuild_profile.ksh yourhostname, it will create a blank template, merge in the data from the .jet file. With minimal tweaking, you should have enough to get going to perform a recovery.

At some point I'll include proper documentation in the source, but for now, this should get you going.








No comments: