Search

About this Archive

This page is an archive of entries from January 2008 listed from newest to oldest.

October 2007 is the previous archive.

February 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

My Latest Tweet

    loading...

January 2008 Archives

Using Virt-clone

| | Comments (0) | TrackBacks (0)
Using the libvirt tool virt-clone is pretty simple to make a new guest image.

virt-clone -o ORIGINAL_GUEST -n NEW_GUEST_NAME -f /new/guest/disk/file
There's not much more to it.  Virt-clone takes care of all the unique stuff (uuid, mac address, etc).

I am a genious (SIC)

| | Comments (0) | TrackBacks (0)
I have two Debian servers, One is the old one, running on hardware that dell is no longer supporting (without us shelling out again) in a couple months. The other -- the new one-- is a virtual instance I have just installed on top of Citrix XenServer. Both are running Debian 4.0 "Etch". 

The application we have running on the old server has quite a few dependencies, and the Operating system hasn't been re-installed in quite some time. As a matter of fact, it is running an image which was based off an image which was based off an image.  In other words, I needed a quick and dirty way of installing all the packages which are needed on the new server, without using the old image.

Here's what I did:

First, on both servers I made a list of the packages which were installed. I did this by running the command:
root@oldhost # dpkg -l > packages.old
and on the new server:
root@newserver # dpkg -l > packages.new
I then combined the lists using text tools such as 'cat' 'sort' 'uniq' etc...
Then I used vimdiff to find the differences between the two servers and make choices as to which packages I wanted installed.  All in all I ended up with a third list which was my cleaned list of packages.

After copying the clean list to the new server, I ran this command:
perl-01:/tmp# for i in `cat packages.final` ; do dpkg -l $i &>/dev/null && echo "found package: $i, doing nothing" || apt-get install $i; done

This command will install a package if it's not currently on the system, and output "found package $foo, doing nothing" if it is already installed. You have only to sit at the prompt and answer any of the dpkg-configure questions which may pop up.

Cool, no?