Me and my fat fingers

My colleagues at Red Hat think that all new virtual machines should be provisioned from reproducible kickstart scripts, and we have some wonderful tools to do that like cobbler.

Over in the real world, on the production server I help to administer in my spare time, the usual method to provision new VMs is to use dd to clone whichever existing VM is “nearest” to what we’re trying to do. We sync this archetypal VM (while it’s running), pause it, dd if=/dev/raid/src of=/dev/raid/targ, boot the target and adjust its hostname.

Usually works well, except this afternoon I fat-fingered the dd command, and overwrote the first 1.7 MB of disk on an existing virtual machine. ext3 filesystem not very happy about this.

So begins a lengthy rebuild process.

Now, where are those reproducible kickstart scripts again?

Update

I managed to recover the wordpress directory and a few other things using guestfish:

$ guestfish -r -a /dev/raid/gallroot -m /dev/sda tar-out /usr/share/wordpress wordpress.tar
$ ls -l wordpress.tar 
-rw-rw-r-- 1 rjones rjones 192901120 2009-10-16 23:04 wordpress.tar
$ tar tf wordpress.tar | head
./
./wp-settings.php
./wp-admin/
./wp-admin/edit-link-categories.php
./wp-admin/edit-category-form.php
./wp-admin/edit-form-comment.php
./wp-admin/options-writing.php
./wp-admin/index-extra.php
./wp-admin/index.php
./wp-admin/admin-footer.php

7 Comments

Filed under Uncategorized

7 responses to “Me and my fat fingers

  1. I did that with a floppy disk image once. /dev/sdb and /dev/sdc are so *similar*….

  2. (it was a USB floppy drive).

  3. Seth Vidal

    in the real world – kickstart is used all the time, for all installs.

    If someone is not using kickstart for deployment that is usually due to ignorance.

  4. Joshua Jackson

    Whether it’s done through kickstart or through puppet or some other thing, when you can create your systems with a script then you’ve really got your stuff together.

    But maybe that’s aiming a little high. Why not start by setting up automated backups for any servers you care about? A few minutes spent setting up rsnapshot will save you a lot of time in the future.

    Now if you could generate a kickstart script from inspecting a vm, that might be interesting..

  5. Seth Vidal

    Joshua:
    make a standard kickstart and look at:

    yum-debug-dump

    yum-debug-restore

  6. rich

    I should mention that the server and guests are all running Debian, so debootstrap would be more appropriate than kickstart. (deboostrap was how the original guest was created).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s