Thursday, April 12, 2007

HOWTO Use SystemImager Once You Have It Installed (Ubuntu 6.10 Edgy Eft)

Anonymous said...

Can you post a system imager how to? We are a 1:1 school in New Palestine.

Well, since I've been working on this, your wish is my command! :-)

First of all, here is a HOWTO install SystemImager from source on Ubuntu Edgy Eft. The following instructions apply only after you've succesfully installed SystemImager on both the server and at least one client.

Second of all, the number one constraint under which we are working here at North is that we do not control the DHCP server, because of this we miss out on a lot of neat possibilities, and can't rely on the defaults being correct. If you do control your DHCP server, you might have an easier time following the Official Quick-Start instructions. These instructions are designed to work in our environment, and you're encouraged to diverge from them where it makes sense for you to.

Thirdly, I'm writing from the perspective of someone who has installed everything on Ubuntu Edgy Eft. Chances are that most of this applies regardless of your distribution, but it's possible that there are differences between distributions that I don't know about. Forewarned is forearmed.

And finally, these are instructions to get you up and running in the basics, there is a bit more to a smooth SystemImager installation than this, and I'll go more in-depth in the near future about the specific customizations we make here at North to have everything work smoothly, but until you have these basic processes working, those customizations won't do you much good.

Grabbing an image

After you have the golden client set up to your taste, the first thing you want to do is grab its image onto the server.

On the Golden Client, run:

$ sudo si_prepareclient --server $ServerIPorHostname --yes

When that drops you back to a command-line, you're ready, run this on the server:

$ sudo si_getimage --golden-client $GoldenClientIPorHostname --image $ImageName --quiet --exclude '/media/*' --exclude '/lib/klibc/events/*' --exclude '/etc/iftab' --update-script YES --ip-assignment DHCP --post-install reboot

Got that?

I use the golden client's IP address, since they all have the same hostname (nordx--image), and I use the number from their model number as my image name (all the images are the same except from the model they are built for) (170 for the 170Ls, 210 for the 210Ls, 1300 for the Inspiron 1300s). --quite is a personal choice of mine. The first two --excludes I plagiarized from the Official Quick-Start instructions, the third is to keep the imaged workstations from trying to use the wrong network interface information. The rest are to set up the auto-install script for the image so that the workstations reboot when they're done imaging. (Here at North, I have a script that configures the workstation's name, printer options, etc. the first time it is booted after the imaging process and then shuts down the workstation.)

It should be noted that if you control the DHCP server, you're likely running SystemImager on said DHCP server and you should examine what choices you want to make about how you use the auto-install script. You have a lot more flexibility than I do here, and may have better options available to you...

Your server should now be downloading the contents of your golden client via rsyncd and creating an image for you.

Use these same instructions to update your image whenever you modify your golden client (updating packages, installing or uninstalling, or modifying.)

rsync

We'll be using the SystemImager rsyncd server to run all this. This is the most basic way of using SystemImager, the default, and it's functional. It does have drawbacks when you want to image three-hundred workstations, though, so if you have that situation you may want to look at using the multicast and/or bittorrent transport methods after you get the basics set up. We'll discuss bittorrent as a compliment to this system in another post.

We need to make sure the server is running before we distribute images:

$ sudo /etc/init.d/systemimager-server-rsyncd start

If you're going to use the server a lot, it's probably a good idea to add the above command to your /etc/rc.local

Imaging a workstation

So, now that you have an image prepped and ready, how do you blow it out to your waiting workstations??? Well, the way we do it is we set up some USB keys to boot from that take care of everything. You plug a USB key into your server and:

$ sudo umount /dev/sda

$ si_mkautoinstalldisk --device /dev/sda --append "IMAGESERVER=$ImageServerIPAddress IMAGENAME=$ImageName SKIP_LOCAL_CFG=y" --yes

NOTE: Make sure you substitute /dev/sda above for the device path of your USB key. Especially if you have SATA hard disks, or if you have other USB drives mounted, it may not be /dev/sda. An easy way to tell what that is is to plug the USB key in, wait for the icon to appear on the Desktop, then run mount in a terminal and look at the last line, the very first item should be the device path for your USB key.

Now take your shiny auto-install USB key over to a workstation you intend to image and boot from it.

Note, you can pull the USB key out as soon as the kernel and initrd.img are loaded (as soon as the screen text turns grey and starts scrolling really fast) and move on to the next workstation you want to image.

Be aware that using the rsyncd server places certain limits and the more workstation you have imaging, the slower the process will go. rsyncd also takes a lot of memory on the server, so if you don't have much memory, don't do too many workstations. We have 512 MB of memory on the SystemImager server and could do one classroom of 32 workstations overnight ok, though the server slowed to a crawl. When we tried to image two classrooms, 64 workstations, the server started killing off rsyncd processes because it didn't have enough memory to run them all.

Updating a workstation

So, you've imaged the workstation, but a huge critical security patch has been released, or want to install a new application? (Any change you want to make, really)

Well, first update the golden client however you want it. Then grab the image again; there is no difference between grabbing the image the first time and grabbing it for an update.

After you're done with updating the image on the server, go to the workstation you want to update, and run the following:

$ sudo si_updateclient --server $ImageServerIPorHostname --image $ImageName --reboot

It will connect to the server, and download all the new files, (note that any changes made on the workstation will also be overwritten/deleted unless they're in a file or directory specified in /etc/systemimager/updateclient.local.exclude), and reboot.

That's it for the basics

I'll write some more about using bittorent with SystemImager, and such, in the near future.

Powered by ScribeFire.

2 Comments:

Anonymous Anonymous said...

Thanks! We had a huge mess when we used ZenWorks. Since the imaging is file-by-file rather than a direct sector/bit/whatever copy, the MBR wasn't updated. I'm sure that SystemImager will help us out in the future, especially considering that we have 90 1:1 machines and about 50 more student machines (possibly more in the future!) that have SLED installed. I'd like to switch to Ubuntu. Is that allowed under the 1:1 grant rules?

8:50:00 AM  
Blogger Simón A. Ruiz said...

Yeah, I had that issue with Ghost and it was a pain. I figured out how to grab the MBR from one disk and paste it to another using dd, but it was annoying.

That was one of the huge pluses of moving to SystemImager for us: it creates the partitions, transfers the files, and then sets up the boot-loader when it's done so the MBR is set up correctly for that machine every time.

Re: Switching to Ubuntu. I'm not aware of all the legalese, but I am aware of the following: We're the recipient of two Indiana ACCESS grants, we're using Ubuntu on those computers, and Mike Huffman knows about and approves of it.

So, yeah, it's allowed.

If you do decide to switch to Ubuntu, might I suggest joining the ubuntu-education mailing list and the new Indiana Ubuntu Local Community Team mailing list.

Shoot us any questions you have.

We're here to help! :-)

10:28:00 AM  

Post a Comment

Links to this post:

Create a Link

<< Home