ext/instance-debootstrap.git
15 years agoinstance-debootstrap: release 0.6 v0.6
Guido Trotter [Mon, 26 Jan 2009 15:58:39 +0000]
instance-debootstrap: release 0.6

This commit also updates the NEWS file

Reviewed-by: iustinp

15 years agodevel/upload: add a missing wait
Guido Trotter [Mon, 26 Jan 2009 15:58:26 +0000]
devel/upload: add a missing wait

Without this the script exits, and removes the temporary directory,
before rsync is done.

Reviewed-by: iustinp

15 years agoUse losetup rather than -o loop
Guido Trotter [Mon, 26 Jan 2009 12:19:31 +0000]
Use losetup rather than -o loop

If the device we're given is actually a file, rather than just mounting
it with the -o loop option, we'll explicitely losetup it to a device,
and losetup -d (detach) it at the end. This allows us to do more actions
on the target device (for example partition it, if needed).

Reviewed-by: iustinp

15 years agoAbstract cleanups in a CLEANUP array
Guido Trotter [Mon, 26 Jan 2009 12:19:19 +0000]
Abstract cleanups in a CLEANUP array

Rather than just having two cleanups for the whole script (namely the
umounting and removal of the temp directory) we can change cleanups with
an array structure, which is then executed in reverse order. This will
be used to add more operations that need their own cleanup, in a
structured way.

Reviewed-by: iustinp

15 years agoAdd devel/upload script
Guido Trotter [Mon, 26 Jan 2009 10:34:30 +0000]
Add devel/upload script

This eases development/debugging of the os script.
It's mostly copied from its ganeti counterpart.

Reviewed-by: iustinp

15 years agodefaults: update EXTRA_PKGS comments
Guido Trotter [Mon, 26 Jan 2009 10:34:18 +0000]
defaults: update EXTRA_PKGS comments

EXTRA_PKGS comments used to be xen specific, and also a bit outdated.
With this patch we make them hypervisor agnostic, and then we provide
some sane defaults for different hypervisors/distro. Moreover we no
longer state that lenny doesn't have xen support for amd64, as it does.

Reviewed-by: iustinp

15 years agoinstance debootstrap: enable import
Guido Trotter [Wed, 22 Oct 2008 14:09:42 +0000]
instance debootstrap: enable import

Reviewed-by: iustinp

15 years agoinstance debootstrap: enable export
Guido Trotter [Wed, 22 Oct 2008 14:09:28 +0000]
instance debootstrap: enable export

Avoid exporting swap devices

Reviewed-by: iustinp

15 years agocommon.sh: output all errors to stderr
Guido Trotter [Wed, 22 Oct 2008 14:09:16 +0000]
common.sh: output all errors to stderr

Create a log_error function that outputs to stderr and use it to send
error messages. This also clarifies error messages a bit and fixes one
wrong check for new_name rather than old_name.

Reviewed-by: iustinp

15 years agoUse basename when checking the script name
Guido Trotter [Wed, 22 Oct 2008 14:09:04 +0000]
Use basename when checking the script name

Also save it to the SCRIPT_NAME variable to avoid calling basename every
time or forgetting to call it.

Reviewed-by: iustinp

15 years agosearch for vol_id and use retrocompatible options
Guido Trotter [Wed, 22 Oct 2008 14:08:52 +0000]
search for vol_id and use retrocompatible options

older versions of udev, for example the one on dapper, install vol_id in
/lib/udev but not in /sbin. They also require shorter options, which
happen to work on newer udev as well.

Reviewed-by: iustinp

15 years agouse proper variable name INSTANCE_NAME
Guido Trotter [Fri, 17 Oct 2008 14:21:41 +0000]
use proper variable name INSTANCE_NAME

the design doc the api version 10 uses the INSTANCE_NAME variable name
to refer to an instance, but we were incorrectly expecting INSTANCE

Reviwed-by: iustinp

15 years agoShip common.sh with the debootstrap os
Guido Trotter [Fri, 17 Oct 2008 14:21:30 +0000]
Ship common.sh with the debootstrap os

Reviwed-by: iustinp

15 years agoOLD/NEW swap, fix get_api10_arguments too
Guido Trotter [Thu, 16 Oct 2008 16:38:53 +0000]
OLD/NEW swap, fix get_api10_arguments too

Reviewed-by: iustinp

15 years agorename: invert old and new instance name
Guido Trotter [Thu, 16 Oct 2008 13:35:31 +0000]
rename: invert old and new instance name

For compatibility with what ganeti internally does the name passed in
INSTANCE_NAME is the new one, and the old one is passed in
OLD_INSTANCE_NAME.

Reviewed-by: iustinp

15 years agoinstance-debootstrap: Support both api 5 and 10
Guido Trotter [Thu, 16 Oct 2008 09:20:36 +0000]
instance-debootstrap: Support both api 5 and 10

Reviewed-by: iustinp

15 years agocommon.sh parsing for api10 arguments
Guido Trotter [Thu, 16 Oct 2008 09:20:26 +0000]
common.sh parsing for api10 arguments

If OS_API_VERSION has value 10 we'll check and parse the arguments using
the version 10 style, as described by the relevant design doc, and save
them to the old names we used before. This makes the create and rename
scripts version 6 compatible (except for bugs, that is), while import
and export will need some more work.

Reviewed-by: iustinp

15 years agoMake $swapdev optional
Guido Trotter [Thu, 16 Oct 2008 09:20:16 +0000]
Make $swapdev optional

In create and import we'll only use a swap device only if swapdev is
set.  This is for compatibility with the OS API version 10, where no swap
is going to be set up.

Reviewed-by: iustinp

15 years agoParse command line arguments in common.sh
Guido Trotter [Thu, 16 Oct 2008 09:20:04 +0000]
Parse command line arguments in common.sh

Currently each of the 4 OS API scripts parses its command line
separately. Creating common.sh lets us centralize this behavior.

For the rename script we change the old_name variable to just instance
for more uniformity with what the new version of the API will do.

Reviewed-by: iustinp

15 years agoUse vol_id to calculate volume UUIDs
Guido Trotter [Tue, 26 Aug 2008 13:32:47 +0000]
Use vol_id to calculate volume UUIDs

This allows the UUID to be calculated in a standard way no matter what
the filesystem in use is. It requires udev to be installed.

Reviewed-by: imsnah

15 years agodebootstrap create: activate serial console
Guido Trotter [Thu, 14 Aug 2008 15:15:12 +0000]
debootstrap create: activate serial console

If we make sure that the instance os spawns a getty on /dev/console we
cover both the case where console is on tty1 and the serial console one
where it's on ttyS0. In order to do this we modify /etc/inittab on
debian, and /etc/event.d on ubuntu.

Reviewed-by: imsnah

15 years agoUse UUID-based mounts for create and import
Guido Trotter [Thu, 14 Aug 2008 10:24:35 +0000]
Use UUID-based mounts for create and import

With this change we mount our root and swap filesystems in /etc/fstab
based on their UUID rather than on their device name. This makes the
system resistent to device name changes, and makes sure the operating
system will find its devices whether they're seen as scsi, ide, virtio,
or some other new type/name.

This change makes the OS be able to boot under KVM, but also
xen+paravirt_ops and other possibly other hypervisors.

Reviewed-by: imsnah

15 years agoMake the 0.5 release v0.5
Iustin Pop [Mon, 7 Jul 2008 14:20:08 +0000]
Make the 0.5 release

This patch updates the NEWS file and changes the version number to 0.5.

Reviewed-by: ultrotter

15 years agoAllow enabling of a proxy for debootstrap
Iustin Pop [Mon, 7 Jul 2008 12:59:18 +0000]
Allow enabling of a proxy for debootstrap

This is valid only for non-cached installs, of course, but it's still a
useful thing.

Reviewed-by: imsnah

15 years agoFix a wrong dirname
Iustin Pop [Mon, 7 Jul 2008 12:33:33 +0000]
Fix a wrong dirname

Reviewed-by: ultrotter

15 years agoUpdate the README file
Iustin Pop [Mon, 7 Jul 2008 08:54:09 +0000]
Update the README file

This patch updates the README file with the changes in the installation
process (due to autotools) and the new settings file.

The readme file is now in restructured text format.

Reviewed-by: imsnah

15 years agoAllow customization of installation directory
Iustin Pop [Mon, 7 Jul 2008 08:54:00 +0000]
Allow customization of installation directory

Currently the OS definition is installed always under
$datadir/ganeti/os, but this doesn't work if ganeti was configure with a
different OS dir.

This patch allows customization of the os dir at configure time, via a
new '--with-os-dir=...' variable. This allows for example:
  ./configure --with-os-dir=/srv/ganeti/os ...

Reviewed-by: imsnah

15 years agoRework the caching mechanism
Iustin Pop [Sun, 6 Jul 2008 17:30:01 +0000]
Rework the caching mechanism

Following the introduction of ./configure options and the configuration
files, this patch simplifies the caching settings:
  - the generation of the cache is done in the settings file, via
    GENERATE_CACHE (if set to "yes" it will enable the creation)
  - the cleaning of the cache is done also in the settings file, via the
    CLEAN_CACHE variable; set to empty it will disable the cache,
    otherwise it's interpreted as the number of days to keep the cache

The location of the cache has also been moved from the current dir to
under localstatedir, which is more FHS compliant (patch taken from the
debian package); this means with localstatedir=/var, the location of the
cache will be /var/cache/ganeti-instance-debootstrap.

Reviewed-by: imsnah

15 years agoInclude the defaults file in the dist archive
Iustin Pop [Sun, 6 Jul 2008 17:19:46 +0000]
Include the defaults file in the dist archive

Reviewed-by: imsnah

15 years agoRework the create script
Iustin Pop [Fri, 4 Jul 2008 20:08:10 +0000]
Rework the create script

This patch changes much of the internals of the create script:
  - we no longer harcode the variables suite, extrapkgs, mirror, etc.
    but instead read them from a config file
  - since we can install multiple suited, the cache filename is
    arch and suite dependant
  - ship a defaults file (but do not install it, that is easier done in
    the packaging)

The defaults file does not have any extra settings activated, so the
default values from the create script will be used. The patch also
changes the script to install in this default mode debian lenny and not
etch.

Reviewed-by: imsnah

15 years agoSwitch indendation to two spaces
Iustin Pop [Fri, 4 Jul 2008 19:55:24 +0000]
Switch indendation to two spaces

Unify all indentation from one tab to two spaces.

Reviewed-by: imsnah

15 years agoRemove the ‘version’ file
Iustin Pop [Fri, 4 Jul 2008 19:47:12 +0000]
Remove the ‘version’ file

Since now the version is coded in configure.ac, the version file is
obsolete.

Reviewed-by: imsnah

15 years agoStart autogenerating the create script
Iustin Pop [Fri, 4 Jul 2008 19:45:54 +0000]
Start autogenerating the create script

This patch changes the create script to be autogenerated so that we can
use the configure-time variables.

Reviewed-by: imsnah

15 years agoStart autotool-ing the debootstrap instance
Iustin Pop [Tue, 1 Jul 2008 07:59:18 +0000]
Start autotool-ing the debootstrap instance

This patch is the start of changing the debootstrap instance to
autotools. Right now it only installs the existing code into
$datadir/ganeti/os/debootstrap, even though we still install only etch.

Reviewed-by: imsnah

15 years agoModify os scripts to mount file disks correctly
Manuel Franceschini [Mon, 30 Jun 2008 14:58:51 +0000]
Modify os scripts to mount file disks correctly

This patch adds a conditional statement before mounting the with -b
given device to detect if it is a block device or a regular file. In the
former case it mounts it regularly, in the latter it tries to mount it
via loopback device.

Reviewed-by: iustinp

15 years agoRename the debian-etch-debootstrap OS definition
Iustin Pop [Fri, 27 Jun 2008 15:32:21 +0000]
Rename the debian-etch-debootstrap OS definition

The current arrangement of the subversion tree is not good - the OS
definitions are treated differently from the ganeti core code, and
automatic operations against the tree are not as easy to do as if the
model would be the same.

This patch moves the trunk/os-scripts/debian-etch-debootstrap directory
to trunk/instance-debootstrap; the prefix 'instance' denotes this as an
OS definition, and we intend to make this OS more flexible so we drop
the debian and etch parts.

Reviewed-by: ultrotter, imsnah

16 years agoRemove .debs from the instance filesystem
Iustin Pop [Wed, 20 Feb 2008 10:29:32 +0000]
Remove .debs from the instance filesystem

This patch removes the .debs which were used in the debootstrap process
via a find and xargs invocation (as opposed to chroot $TMPDIR apt-get
clean).

The main reason for this is that:
  - we don't want the created cache to contain the debs (it's
    unreasonably larger than needed)
  - but we want an instance created with the cache to be the same as
    without cache

The patch also adds ‘-f’ to the rm and mv invocations which didn't have
it.

Reviewed-by: imsnah

16 years agoMake a new 0.4 release for debian-etch-debootstrap
Iustin Pop [Wed, 16 Jan 2008 12:40:37 +0000]
Make a new 0.4 release for debian-etch-debootstrap

This patch makes a new release of the debian-etch instance OS that adds
the instance renaming on import issue.

It also adds a NEWS file (which steals content from the README).

Reviewed-by: imsnah

16 years agoRemove generated network rules on instance import
Guido Trotter [Fri, 11 Jan 2008 12:07:52 +0000]
Remove generated network rules on instance import

udev generates rules to maintain the order of the network interfaces stable.
When importing an instance, though, its mac address may change, and networking
be broken. This patch removes the generated network rules file, making udev
create a new one after the first boot of an imported instance. This issue was
first spotted by Gunnar Wagenknecht.

Reviewed-by: iustinp

16 years agoImprove performance of the debian-etch-debootstrap OS
Iustin Pop [Wed, 28 Nov 2007 07:48:24 +0000]
Improve performance of the debian-etch-debootstrap OS

This patch enables the debian-etch-debootstrap instance to generate (and
subsequently use) a cache file on the first install. Because, even with
a very fast mirror, debootstrap itself is slow, saving the installed
image and afterwards just untar-ing that over the filesystem is much
faster.

The patch also adds a 'version' file so that users can see what they
have installed (maybe in the future we could use require this file so we
know what versions of the OS we have installed).

Reviewed-by: ultrotter

16 years agoUpdate debian-etch-debootstrap API version to 5
Iustin Pop [Tue, 18 Sep 2007 12:02:34 +0000]
Update debian-etch-debootstrap API version to 5

This updates this OS the API v5 by adding a rename operation.

Reviewed-by: imsnah

16 years agoCheckin the debian-etch-debootstrap os scripts
Iustin Pop [Thu, 30 Aug 2007 12:58:29 +0000]
Checkin the debian-etch-debootstrap os scripts

Reviewed-by: roman.marxer