This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Automate Linux installation and recovery with SystemImager

By Paul Virijevich on May 19, 2006 (8:00:00 AM)

Share    Print    Comments   

Installing and recovering systems is one of the most time-consuming tasks for any IT department. Imaging software, commercial and open source, creates compressed images of a client's hard drive data and stores them on a central server. These images can then be used to restore systems or roll out new ones. One useful open source imaging applications is SystemImager.

SystemImager has many advantages over traditional imaging methods. It uses rsync to store the image remotely, and can do a backup or full install in just three to five minutes. Images are complete copies of a filesystem, and their files can be edited. Images on a server can be updated when a change is made to a client, and only the changes need be copied over to the image. You can also make changes to the image on the server and push it out to clients; once again, only the changes are copied. SystemImager also supports auto-installation; clients can receive an image based on their MAC addresses.

One potential disadvantage of SystemImager compared to commercial products is that no commercial support is available. This might not matter to you, but if your organization insists on it, you're out of luck.

SystemImager installation is time-consuming but simple. Download and extract the code, then run make all in the newly created directory. This downloads a whole bunch of stuff. It seems like SystemImager needs its own version of just about everything out there. Expect to use about 650MB of disk space for everything that SystemImager will download, but you can delete this all as soon as you are done with building the application.

Once everything finishes, issue the following commands to set up your SystemImager server:

make install_server_all
make install_boel_binaries_tarball
make install_initrd

For machines you want to back up, instead of doing all this downloading and compiling, just create an archive of the systemimager-3.6.3 directory with tar (tar -cvf sysimager.tar systemimager-3.6.3) and copy it over to the clients. Extract the archive (tar -xvf sysimager.tar) and run make install_client_all from the source directory.

One of the great things about SystemImager is that it is distribution-neutral. You can run a Debian server to dish out images made from Fedora, openSUSE, SLES, RHEL, or just about any other distribution.

When it comes to hardware, things get a little bit trickier. With a little extra work, you can use the same image for IDE, SATA, and SCSI drives -- but an image taken from an IDE machine won't work unmodified on a SCSI system. However, you could write a script to go through the image directory and change any references of hda to sda. Better yet, you could specify such a change in a post-install script that would run after you load the image on a client. See /var/lib/systemimager/scripts/post-install/README for more information. For simplicity's sake, however, if you have enough disk space on the server, you will probably just want to create separate images.

Creating an image

Now it's time to start creating images. For an example, say you name your image server master and your client bob. On bob, run the command si_prepareclient --server master. SystemImager warns you that it is about to store some information about your client in /etc/systemimager and configure your system to run rsync. Answer yes at this prompt, and yes again when it asks to start rsync as a daemon. After a few moments, your client is ready to have its image retrieved by the server.

Now log on to master and tell it to retrieve the image with si_getimage --golden-client bob --image bob-image. You will see a security warning about rsync. If you are on a trusted LAN, it is safe to continue. The imaging process should take from three to five minutes but will depend on the size of the image, the speed of your hard disks, and network throughput.

After the image is retrieved, SystemImager will prompt with some questions about how you want to handle IP addressing for the client when its image is restored. You can choose DHCP, static, or replicant. If your SystemImager server is also a DHCP server, you can tell it what IP address to give to any client requesting this image. By default, SystemImager will assign this image a random IP address just like any other DHCP client. However, you can use the si_mkdhcpstatic command to make the IP address it gets the first time the image's static IP every time it is installed. Static assigns the IP address the client has as it pulls the image from the server. Replicant never alters the IP address of the image, which is useful for backing up servers that need the same IP address when restored.

If you are running a DHCP server alongside SystemImager, you now have the option of choosing the IP address range for the clients with the si_addclients command. You can also specify what images clients should get based on their IP address. If you are not using DHCP, answer no and move on.

Your image is now in the server in the directory /var/lib/systemimager/images/bob. If you browse through the directory, you will notice that it has the exact same filesystem layout as the original.

Now that you have an image on the server, you can restore a client or roll out the image to new clients by using the command si_mkautoinstallcd --out-file image.iso on the server. This creates an ISO image you can burn to a CD.

If you are using SystemImager with DHCP, just pop the restore CD into a computer and watch SystemImager deploy the image based on the IP address of the client -- no interaction needed. If you want to install an image and are not deploying based on IP addresses, you can specify parameters at the boot prompt. For example, using kernel IMAGESERVER=192.168.0.1 IMAGENAME=bob at the boot CD prompt will deploy the image bob from the server at 192.168.0.1 to the client machine. This is useful when you want to deploy the same image over and over again, regardless of whether you are running a DHCP server in conjunction with SystemImager.

You may be wondering if you can use SystemImager over the public Internet using SSH. Supposedly you can, but the documentation on setting this up is pretty much non-existent, as the docs aren't very helpful. I did eventually stumble upon using ssh-user= as an option with si_getimage and si_updateclient. Doing so prompts for the password of the user you specify, but whether rsync is now tunneling through SSH is not apparent. I failed to find this feature anywhere in the documentation. It does show up if you do a si_getimage --help. Don't let this worry you too much, as you'll probably want to use SystemImager on a local network anyway.

If you don't want to drag a CD around to every client, install the SystemImager client software on the client to be imaged. Then use si_updateclient --server master --image bob to install the image bob. There is one constraint. This method does not change the partitions on the existing client. It does not alter/etc/fstab, but it does update the bootloader configuration. If the new image has a different root partition (say sda2 instead of sda3), you will need to edit the new bootloader configuration and put back in sda3 as the root partition. Basically, you are getting the contents of the filesystems and their layout on your existing partitions. This may sound a little scary, but go ahead and try it. It actually works quite well.

Updating images and clients

The ability to update images or clients takes SystemImager beyond ordinary imaging software. Say you make changes on a client and want the image on the server to match the changes. All you have to do is run the si_prepareclient and si_getimage sequence again. SystemImager updates only the changes made on the client. The update will include altered files and new files on the host, and remove deleted files from the image.

The si_updateclient command lets you move in the opposite direction. If you have hundreds of machines with the same image, just update the master image and pull only the changes from the master image to the destinations. This could be useful for updating all servers after a security patch comes out. It is also simpler and cheaper than running a satellite update server as some "enterprise" Linux distributions suggest.

SystemImager does have some downsides. The binary packages for installing the software on RPM and Debian-based systems are out of date, so you must endure the long install process of the source code package. I also had to install some extra Perl modules, namely XML::Simple and AppConfig. This was not obvious until I tried to run a SystemImager command the first time. You would hope that this information would be in the documentation, yet that also seems out of date.

Don't let these shortcomings get in your way. From a technology standpoint, SystemImager is hard to beat. You get the functionality of both an image and an update server in one package. Let's also not forget the other thing it has going for it -- speed. Once you get SystemImager up and running, you'll wonder how you were ever able to live without it.

Share    Print    Comments   

Comments

on Automate Linux installation and recovery with SystemImager

Note: Comments are owned by the poster. We are not responsible for their content.

attention lazy systems managers !

Posted by: Anonymous Coward on May 21, 2006 06:56 PM
Get this magic wand ! Wave it regularly ! Re-image troublesome systems, without having to understand problems or fix them ! Reduce support costs and system downtime ! Just like Windows !

#

Re:attention lazy systems managers !

Posted by: Anonymous Coward on May 23, 2006 04:53 AM
! Re-image troublesome systems, without having to understand problems or fix them ! Reduce support costs and system downtime ! Just like Windows !

Or be a tough guy, like the parent poster, and spend three days trying to figure out how to get the resolution back to where it was by manually recompiling kernel modules and fiddling with xorg.conf!

<MANAGER> You spent three days getting the video settings right? Instead of 15 minutes to reimage?? With all the other things that you were supposed to be doing??? Are you kidding????

YOU ARE SO FIRED!!!!! </MANAGER>

#

relief joint

Posted by: Anonymous Coward on May 28, 2006 06:13 PM
<tt>[URL=http://painrelief.fanspace.com/index.htm] Pain relief [/URL]
[URL=http://lowerbackpain.0pi.com/backpain.htm] Back Pain [/URL]
[URL=http://painreliefproduct.guildspace.com] Pain relief [/URL]
[URL=http://painreliefmedic.friendpages.c<nobr>o<wbr></nobr> m] Pain relief [/URL]
[URL=http://nervepainrelief.jeeran.com/pa<nobr>i<wbr></nobr> nrelief.htm] Nerve pain relief [/URL]</tt>

#

Would be a good addition to Ubuntu respository?

Posted by: Anonymous Coward on May 19, 2006 07:51 PM
This feature would be a wonderful addition to Ubuntu respository. I Ubuntu supported this...? Well, a simple GUI version, that is, it just would add so much more to Ubuntu as the whole backup and restore over the network for a school, SMB, or Enterprise would be very easy to do.

Also would be good to be able to select certain directory or files for backup only and not complete image! Because if rolling out one complete image to all clients, well that could be the template for a restore, and then all we would need to store/restore are the actual user files.

#

Re:Would be a good addition to Ubuntu respository?

Posted by: Anonymous Coward on May 20, 2006 01:28 AM
Debian Sid has got it in its repository, so it shouldn't be that hard to get it in Ubuntu.

#

Pain

Posted by: Anonymous Coward on May 28, 2006 06:14 PM
<tt>[URL=http://painrelief.fanspace.com/index.htm] Pain relief [/URL]
[URL=http://lowerbackpain.0pi.com/backpain.htm] Back Pain [/URL]
[URL=http://painreliefproduct.guildspace.com] Pain relief [/URL]
[URL=http://painreliefmedic.friendpages.c<nobr>o<wbr></nobr> m] Pain relief [/URL]
[URL=http://nervepainrelief.jeeran.com/pa<nobr>i<wbr></nobr> nrelief.htm] Nerve pain relief [/URL]</tt>

#

RE:Would be a good addition to Ubuntu respository?

Posted by: Anonymous Coward on June 27, 2006 04:08 PM
apt-get install python2.3-dev rsync dosfstools libappconfig-perl libxml-parser-perl libxml-simple-perl mkisofs mtools liburi-perl libwww-perl libexpat1 libxml-namespacesupport-perl libxml-sax-perl libxml-libxml-perl libxml-sax-expat-perl libhtml-parser-perl libhtml-tree-perl libxml-libxml-common-perl libxml2 libhtml-tagset-perl libhtml-tagset-perl libnet-netmask-perl libtool bc patch make libreadline5-dev libncurses5-dev gettext uuid-dev libuuid1 flex g++ gcc zlib-bin zlib1g openssl libssl-dev python bzip2 vim mc zlibc libtool libreadline5-dev libncurses5-dev gettext uuid-dev libuuid1 zlib1g-dev libdevmapper1.01 libdevmapper-dev

for systemimager (server) you need also:
dhcp3,tftp, tftpd, ha-tfptboot,syslinux, pxe, systemconfigurator si systemimager-boot (add deb <a href="http://download.systemimager.org/debian" title="systemimager.org">http://download.systemimager.org/debian</a systemimager.org> stable main in<nobr> <wbr></nobr>/etc/apt/sources.list)

The file<nobr> <wbr></nobr>/tftpboot/pxelinux.cfg/default should contain:

DEFAULT systemimager

#
# Uncomment next line to send pxelinux boot prompt over serial port 0.
# NOTE: Be sure your serial port speed is appropriate (57600, 9600, etc.)
#
#SERIAL 0 57600
LABEL systemimager
DISPLAY message.txt
PROMPT 1
TIMEOUT 50
KERNEL kernel
APPEND vga=extended initrd=initrd.img root=/dev/ram

#

Why not use Radmind?

Posted by: Anonymous Coward on May 20, 2006 12:09 PM
<a href="http://radmind.org/" title="radmind.org">http://radmind.org/</a radmind.org>

'nuff said.

#

They get the incompatibility with Fedora fixed?

Posted by: Anonymous Coward on May 20, 2006 07:34 PM
Used it a LOT to deploy RH7.2 systems a long time ago. Gave it a shot on a Fedora Core 4 box not too long ago. Gave me fits.

They get it fixed yet?

#

No support?? Did you even look?

Posted by: Anonymous Coward on May 20, 2006 11:31 PM
One potential disadvantage of SystemImager compared to commercial products is that no commercial support is available.

This is BS. There are lots of small Linux support companies which will add this to their repertoire if a real customer with real $$ wants it.

#

mondo

Posted by: Anonymous Coward on May 20, 2006 11:38 PM
is mondorescue better than systemimager or vice versa?

#

HowTo CLONE WINDOWS XP/2000 INSTALLATIONS

Posted by: Anonymous Coward on May 22, 2006 10:29 AM
Not sure how to clone Linux partitions, but there is this article about,....

HOWTO CLONE WINDOWS XP/2000
INSTALLATIONS FROM LINUX (BACK-UPS).


A guide to cloning (for backing-up, or just duplicating) your XP/2000 installations using Linux.

This will save you a lot of time next time you have to reinstall Windows.

Interested then click here:

<a href="http://linux.coconia.net/" title="coconia.net">http://linux.coconia.net/</a coconia.net>

The reason that this is so useful, is because:

So, you have installed Windows. Now you have the difficult task of reinstalling and customizing, Microsoft Office, all of your third party software, such as, Adobe Reader, Photoshop, Virus protection, your printer drivers, etc, etc. This all takes a lot of time and effort, especially if you happen to have lost the disk that came with your printer that included the printer drivers. Even worse, you often find that the disk that came with your printer does not have the necessary Windows XP/2000 drivers.

So, reestablishing a Windows system is a royal pain in the ass. In contrast, if you are satisfied with only partially accelerated video drivers, reestablishing a Novelle SuSE 10.0, is pretty much all done in 30 or 40 minutes. However, if, for example, you have an ATI video card and wish to install the fully accelerated ATI drivers, this may take you forever, as the installation seems to have been deliberately sabotaged.

On occasions, getting Windows back to the way it was, has taken all day (and sometimes longer). When people tell you how easy Windows is to install, they as lying by omission, as they omit to tell you that the install is just the beginning of reestablishing a Windows system.


Quote is from: <a href="http://linux.coconia.net/addingXP.htm" title="coconia.net">http://linux.coconia.net/addingXP.htm</a coconia.net>

Cloning, saves you the need to reinstall and customize all of your third party software and drivers, as cloning saves your system as is.

#

Re:HowTo CLONE WINDOWS XP/2000 INSTALLATIONS

Posted by: Anonymous Coward on June 27, 2006 04:03 PM
You must have in<nobr> <wbr></nobr>/tftpboot/pxelinux.cfg/default the following :

DEFAULT systemimager

#
# Uncomment next line to send pxelinux boot prompt over serial port 0.
# NOTE: Be sure your serial port speed is appropriate (57600, 9600, etc.)
#
#SERIAL 0 57600
LABEL systemimager
DISPLAY message.txt
PROMPT 1
TIMEOUT 50
KERNEL kernel
APPEND vga=extended initrd=initrd.img boot=/dev/ram

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya