tridge/autocluster.git
13 years agoAbstract out qemu-nbd/NBD/loopback mount of disk image.
Martin Schwenke [Wed, 9 Feb 2011 04:04:21 +0000 (15:04 +1100)]
Abstract out qemu-nbd/NBD/loopback mount of disk image.

In preparation for adding an alternate method.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoExplicitly set disk image type to $BASE_FORMAT in install.xml.
Martin Schwenke [Thu, 10 Feb 2011 01:26:30 +0000 (12:26 +1100)]
Explicitly set disk image type to $BASE_FORMAT in install.xml.

If you don't specify a type then RHEL6's KVM default it to 'raw'.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoExplicitly set disk image type to $SYSTEM_DISK_FORMAT in node.xml.
Martin Schwenke [Thu, 10 Feb 2011 01:12:17 +0000 (12:12 +1100)]
Explicitly set disk image type to $SYSTEM_DISK_FORMAT in node.xml.

If you don't specify a type then RHEL6's KVM default it to 'raw'.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoAdd initial "no desktop" package listing for RHEL6.
Martin Schwenke [Tue, 8 Feb 2011 04:30:44 +0000 (15:30 +1100)]
Add initial "no desktop" package listing for RHEL6.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoSYSTEM_DISK_PREFIX is now set from SYSTEM_DISK_TYPE and RHEL_VERSION.
Martin Schwenke [Tue, 8 Feb 2011 03:14:36 +0000 (14:14 +1100)]
SYSTEM_DISK_PREFIX is now set from SYSTEM_DISK_TYPE and RHEL_VERSION.

RHEL6 guests need "sd" for "ide" disks, so automating this seems
sensible.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoSupport new SYSTEM_DISK_FORMAT=reflink.
Martin Schwenke [Tue, 25 Jan 2011 02:19:07 +0000 (13:19 +1100)]
Support new SYSTEM_DISK_FORMAT=reflink.

This is like raw but it copied using --reflink=always.  This probably
requires disk images to be on btrfs, so this is experimental.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoMake waitfor set LANG=C before running expect.
Martin Schwenke [Tue, 25 Jan 2011 01:36:46 +0000 (12:36 +1100)]
Make waitfor set LANG=C before running expect.

For some reason when creating a base image on RHEL6.0, expect exits
before it finds the designated pattern.  Using strace or expect -d
makes things mysteriously work, so debugging is very difficult.

On a whim, I wondered if expect is getting confused about multibyte
characters, so tried setting LANG=C.  This either fixes or works
around the problem.  It will do for now...

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoMake setting of MEM happen in post_config_hooks() by default.
Martin Schwenke [Tue, 18 Jan 2011 02:43:11 +0000 (13:43 +1100)]
Make setting of MEM happen in post_config_hooks() by default.

The previous default of 262144KB is not enough for RHEL6.  We use the
old default for RHEL5 and set an intial default of 512000KB for RHEL6.

A smaller limit may be possible for RHEL6... but this works.  :-)

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years ago$ISO and $SYSTEM_DISK_MOUNTS now automatically set via post_config_hooks.
Martin Schwenke [Tue, 18 Jan 2011 01:54:06 +0000 (12:54 +1100)]
$ISO and $SYSTEM_DISK_MOUNTS now automatically set via post_config_hooks.

New function system_disk_mounts() returns a default value for
SYSTEM_DISK_MOUNTS that depend on $RHEL_VERSION.

New function rhel_post_config_hook() resets SYSTEM_DISK_MOUNTS and ISO
if they are equal to the magic value "@uto".  This is now the default
value for both of these variables.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNew hook post_config_hooks.
Martin Schwenke [Tue, 18 Jan 2011 01:46:32 +0000 (12:46 +1100)]
New hook post_config_hooks.

This is run after all configuration has been processed.  That is,
after command-line options processing.

It is also run before other exits where you can reasonably expect
configuration to be complete (--dump, -e <expr>).

It is not run before -E.  If you want to run in combination with -E
then add "run_hooks post_config_hooks" to the expression (or to a
previous -E option).  However, bear in mind that this may preempt any
magic the hooks might otherwise do after subsequent configuration
option processing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoChange handling of packages in kickstart with new variable RHEL_PACKAGES.
Martin Schwenke [Tue, 18 Jan 2011 00:00:10 +0000 (11:00 +1100)]
Change handling of packages in kickstart with new variable RHEL_PACKAGES.

$RHEL_PACKAGES points to a file containing the standard package list,
which is inserted into the kickstart packages section along with
$_EXTRA_RHEL_PACKAGES and $EXTRA_PACKAGES.  The old packages list is
in RHEL5.packages, with an initial list of RHEL6 in RHEL6.packages.
The RHEL5 list has been slightly updated in the area of compat
packages.  The default value of $RHEL_PACKAGES invokes new function
rhel_package_list(), which prints the contents of the packages file
corresponding to the current $RHEL_VERSION.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoAdd RHEL6-compatible option to default value of KS_DONE_MESSAGE.
Martin Schwenke [Mon, 17 Jan 2011 01:11:31 +0000 (12:11 +1100)]
Add RHEL6-compatible option to default value of KS_DONE_MESSAGE.

RHEL6 does not say "you may safely reboot your system" so we match
"System halted." to know when to halt the kickstart guest.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoRemove persisent NIC naming in basic-postinstall.sh.
Martin Schwenke [Mon, 17 Jan 2011 01:07:49 +0000 (12:07 +1100)]
Remove persisent NIC naming in basic-postinstall.sh.

Different MAC addresses are used in guests for base creation than for
actual clusters.  We don't want the cluster nodes to remember any
NIC/MAC associations from the kickstart run.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoAdd RHEL5.6 ISO details.
Martin Schwenke [Sun, 16 Jan 2011 23:53:51 +0000 (10:53 +1100)]
Add RHEL5.6 ISO details.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoSupport for RHEL_VERSION=6.0 in rhel_print_iso.
Martin Schwenke [Thu, 13 Jan 2011 03:42:17 +0000 (14:42 +1100)]
Support for RHEL_VERSION=6.0 in rhel_print_iso.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoOptimise newline subsitution during template expansion.
Martin Schwenke [Tue, 11 Jan 2011 03:25:22 +0000 (14:25 +1100)]
Optimise newline subsitution during template expansion.

The current code uses a bash variable pattern substitution.  This can
be horrendously slow on a large value.  On my laptop it takes bash
about 0.7s to do a single replacement of the 1st newline in a ~50KB
value.  Doing a template substitution during the generation of XML for
100 shared disks causes the creation of a 1000 line value that is
about 35KB...  so handling 100 shared disks can be very slow!  :-(

This changes newlines to character 0x01 using tr and then uses sed to
replace these by "\\n".

There are other subsitutions nearby in the code but they don't tend to
cause this type of problem because they escape characters that tend to
be used less frequently.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoAllow a lot more shared disks (about 700).
Martin Schwenke [Mon, 10 Jan 2011 23:55:58 +0000 (10:55 +1100)]
Allow a lot more shared disks (about 700).

This is now a trivial change due to the use of arrays.

Based on a patch from Eugen Anghel <eugen.anghel@ro.ibm.com>.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoChange shared disk device name code to use a bash array.
Martin Schwenke [Mon, 10 Jan 2011 23:49:39 +0000 (10:49 +1100)]
Change shared disk device name code to use a bash array.

Based on a patch for more shared disks from Eugen Anghel
<eugen.anghel@ro.ibm.com>.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoRevert "Allow a lot more shared disks (about 700)."
Martin Schwenke [Mon, 10 Jan 2011 23:44:07 +0000 (10:44 +1100)]
Revert "Allow a lot more shared disks (about 700)."

This can be done much better using arrays.

This reverts commit 5a5494821b51abfe2d6bf6f6dc9d960b8c3f0cde.

13 years agoAllow a lot more shared disks (about 700).
Martin Schwenke [Wed, 5 Jan 2011 00:01:49 +0000 (11:01 +1100)]
Allow a lot more shared disks (about 700).

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoAdded TODO file for cluster_configure.
Martin Schwenke [Mon, 6 Dec 2010 04:10:25 +0000 (15:10 +1100)]
Added TODO file for cluster_configure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoConfiguration file and wrapper script for simple GPFS-based NAS stack.
Martin Schwenke [Mon, 6 Dec 2010 03:44:38 +0000 (14:44 +1100)]
Configuration file and wrapper script for simple GPFS-based NAS stack.

Master configuration file for cluster_configure and a wrapper script
to hold it all together.  The script may eventually become part of
cluster_configure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agokickstart and post-install templated for simplified GPFS-based NAS cluster.
Martin Schwenke [Mon, 6 Dec 2010 03:43:32 +0000 (14:43 +1100)]
kickstart and post-install templated for simplified GPFS-based NAS cluster.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoInitial version of cluster_configure.
Martin Schwenke [Mon, 6 Dec 2010 03:41:51 +0000 (14:41 +1100)]
Initial version of cluster_configure.

See base/all/root/scripts/cluster_configure/README.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoChange the SCSI ID prefix in shared disk images from "SOFS" to "AUTO".
Martin Schwenke [Thu, 2 Dec 2010 06:19:02 +0000 (17:19 +1100)]
Change the SCSI ID prefix in shared disk images from "SOFS" to "AUTO".

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agomknsd.sh creates its own list of disks to use as NSDs.
Martin Schwenke [Thu, 2 Dec 2010 02:17:31 +0000 (13:17 +1100)]
mknsd.sh creates its own list of disks to use as NSDs.

This currently uses /var/mmfs/etc/nsddevices to list the disks but
this script isn't generally available.

Instead we implement some custom logic that asks multipath about
available devices and then filters on those created by KVM or via
autocluster's iSCSI code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agosetup_gpfs.sh no longer uses cnpushfile.
Martin Schwenke [Mon, 29 Nov 2010 05:27:41 +0000 (16:27 +1100)]
setup_gpfs.sh no longer uses cnpushfile.

Use a more generic combination of onnode and rsync.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNew configuration variable GPFS_DEFAULT_MOUNTPOINT, used by setup_gpfs.sh.
Martin Schwenke [Mon, 29 Nov 2010 05:26:14 +0000 (16:26 +1100)]
New configuration variable GPFS_DEFAULT_MOUNTPOINT, used by setup_gpfs.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoMove GPFS config variables from 50sofs.defconf to new file 40gpfs.defconf.
Martin Schwenke [Mon, 29 Nov 2010 05:24:56 +0000 (16:24 +1100)]
Move GPFS config variables from 50sofs.defconf to new file 40gpfs.defconf.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoMove public IP config variables from 50sofs.defconf to 00base.defconf.
Martin Schwenke [Mon, 29 Nov 2010 05:21:54 +0000 (16:21 +1100)]
Move public IP config variables from 50sofs.defconf to 00base.defconf.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoMake 3rd octet of IP addresses configurable.
Martin Schwenke [Thu, 23 Sep 2010 03:14:37 +0000 (13:14 +1000)]
Make 3rd octet of IP addresses configurable.

This introduces new variables IPNET0, IPNET1, IPNET2.  These default
to 0, 1, 2 respectively.  That is, this change is backward compatible.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNTP server should be GATEWAY, not a hand constructed IP address.
Martin Schwenke [Thu, 23 Sep 2010 03:14:05 +0000 (13:14 +1000)]
NTP server should be GATEWAY, not a hand constructed IP address.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNew -E options needs "shift 2" - oops!
Martin Schwenke [Wed, 25 Aug 2010 01:56:19 +0000 (11:56 +1000)]
New -E options needs "shift 2" - oops!

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoAdd new -E option like -e but doesn't exit.
Martin Schwenke [Wed, 25 Aug 2010 01:46:01 +0000 (11:46 +1000)]
Add new -E option like -e but doesn't exit.

In complex configurations it can be useful to add a function in a
configuration file and run it on the command-line.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoFix 2 bugs in iscsimultipath initscript.
Martin Schwenke [Thu, 12 Aug 2010 06:14:51 +0000 (16:14 +1000)]
Fix 2 bugs in iscsimultipath initscript.

* Incorrect reference to $c instead of $_c caused loop to never
  terminate.

* Need to flush multipath devices before trying again.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoFix think in iscsimultipath initscript.
Martin Schwenke [Tue, 10 Aug 2010 05:22:07 +0000 (15:22 +1000)]
Fix think in iscsimultipath initscript.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoSupport HOSTS_STATIC_ENTRIES on the rhel_base nodes too.
Martin Schwenke [Fri, 6 Aug 2010 03:46:39 +0000 (13:46 +1000)]
Support HOSTS_STATIC_ENTRIES on the rhel_base nodes too.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNew configuration variable HOSTS_STATIC_ENTRIES.
Martin Schwenke [Fri, 6 Aug 2010 03:26:54 +0000 (13:26 +1000)]
New configuration variable HOSTS_STATIC_ENTRIES.

This points to a file containing static entries that should be
inserted into /etc/hosts on each node.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoRework the code that finds the list of variables in a template.
Martin Schwenke [Tue, 29 Jun 2010 02:33:26 +0000 (12:33 +1000)]
Rework the code that finds the list of variables in a template.

This version seems cleaner and clearer than the previous version, so
is more likely to be correct.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoFix the template substitution in certain corner cases.
Martin Schwenke [Mon, 28 Jun 2010 10:29:36 +0000 (20:29 +1000)]
Fix the template substitution in certain corner cases.

When template variables are surround by valid variable characters the
substitutions can fail.  This makes it more robust.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoFix hardcoded 10.0.0.1 in one of the iSCSI templates.
Martin Schwenke [Tue, 22 Jun 2010 07:29:37 +0000 (17:29 +1000)]
Fix hardcoded 10.0.0.1 in one of the iSCSI templates.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoNew function shared_disk_iscsi_setup_base_get_ip() prints IP for iSCSI client.
Martin Schwenke [Tue, 22 Jun 2010 04:17:54 +0000 (14:17 +1000)]
New function shared_disk_iscsi_setup_base_get_ip() prints IP for iSCSI client.

This make the generation of IP addresses for iSCSI client
configurable.  If, for example, you're using an IP addressing scheme
that is out of autocluster's control, you can override this function
to try and provide an alternate solution.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoRegister shared_disk_iscsi_setup_base in shared_disk_setup.
Martin Schwenke [Tue, 22 Jun 2010 01:56:01 +0000 (11:56 +1000)]
Register shared_disk_iscsi_setup_base in shared_disk_setup.

Only register this is in setup_base_hooks if iSCSI shared disks are
being used.  It was registered globally.  This may, this hook is
registered even if you run clear_hooks on setup_base_hooks.

This obeys the "principal of least surprise" in the case where iSCSI
should work if you select iSCSI.  However, it might surprise people to
find a hook registered when they've clear the hook variable.  Can't
win 'em all.  If necessary, shared_disk_iscsi_setup_base() can be
overridden.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoMove the "cluster created" message back into create_cluster().
Martin Schwenke [Fri, 18 Jun 2010 06:57:14 +0000 (16:57 +1000)]
Move the "cluster created" message back into create_cluster().

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoPut /etc/hosts editing suggestion into cluster_created_hooks.
Martin Schwenke [Fri, 18 Jun 2010 06:18:02 +0000 (16:18 +1000)]
Put /etc/hosts editing suggestion into cluster_created_hooks.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoIn setup_gpfs.sh, getopt complains if it doesn't have a -o option.
Martin Schwenke [Fri, 18 Jun 2010 06:02:30 +0000 (16:02 +1000)]
In setup_gpfs.sh, getopt complains if it doesn't have a -o option.

Signed-off-by: Martin Schwenke <martin@meltin.net>
13 years agoKickstart: don't install xulrunner-devel - nothing needs it.
Martin Schwenke [Fri, 18 Jun 2010 05:33:09 +0000 (15:33 +1000)]
Kickstart: don't install xulrunner-devel - nothing needs it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agogrep sanity check in waitfor should now use extended regexps.
Martin Schwenke [Mon, 31 May 2010 00:12:50 +0000 (10:12 +1000)]
grep sanity check in waitfor should now use extended regexps.

i.e. Pass "-E" to grep.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMake waitfor look for a regular expression rather than just a string.
Martin Schwenke [Fri, 28 May 2010 10:31:02 +0000 (20:31 +1000)]
Make waitfor look for a regular expression rather than just a string.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoAdd $node_type to the UUID map.
Martin Schwenke [Fri, 28 May 2010 01:36:08 +0000 (11:36 +1000)]
Add $node_type to the UUID map.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoModify create_node_COMMON() to pull the UUID for this node out of the map.
Martin Schwenke [Fri, 28 May 2010 01:06:52 +0000 (11:06 +1000)]
Modify create_node_COMMON() to pull the UUID for this node out of the map.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoBuild a UUID map file in common_nodelist_hacking.
Martin Schwenke [Fri, 28 May 2010 00:30:31 +0000 (10:30 +1000)]
Build a UUID map file in common_nodelist_hacking.

This maps between $ip_offset and UUID.  This isn't used anywhere
yet... however, there will be some autocluster applications where a
node will need to know the UUIDs of other nodes.

Note: after testing that the UUID map looks right, we'll actually use
it in create_node_COMMON().

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoFix a typo causing as syntax error.
Martin Schwenke [Mon, 24 May 2010 04:37:30 +0000 (14:37 +1000)]
Fix a typo causing as syntax error.

Also clean up some of the progress messages.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoSupport SYSTEM_DISK_MOUNTS in unmount_disk().
Martin Schwenke [Mon, 24 May 2010 04:18:17 +0000 (14:18 +1000)]
Support SYSTEM_DISK_MOUNTS in unmount_disk().

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew configuration variable SYSTEM_DISK_MOUNTS.
Martin Schwenke [Mon, 24 May 2010 04:07:39 +0000 (14:07 +1000)]
New configuration variable SYSTEM_DISK_MOUNTS.

Allows multiple filesystems to be mounted by mount_disk() at cluster
creation time.  This is useful if, for example, the base image has
been created with separate partitions for / and /var, and you need to
copy configuration to both filesystems.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoFix typo "derconf".
Martin Schwenke [Fri, 21 May 2010 06:22:59 +0000 (16:22 +1000)]
Fix typo "derconf".

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew configuration variables BASE_PER_NODE_TYPE.
Martin Schwenke [Fri, 21 May 2010 06:21:14 +0000 (16:21 +1000)]
New configuration variables BASE_PER_NODE_TYPE.

If set to "yes", this adds the node type to the base image filename
when creating each node.  This means you can have different base
images for each node type.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoAdd a comment to explain the previous commit.
Martin Schwenke [Fri, 21 May 2010 05:44:17 +0000 (15:44 +1000)]
Add a comment to explain the previous commit.

Otherwise someone will wonder why...

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoFold setup_network() into setup_base().
Martin Schwenke [Fri, 21 May 2010 05:38:25 +0000 (15:38 +1000)]
Fold setup_network() into setup_base().

Actually add it to setup_base_hooks but ensure that if $hosts_file is
unset then the function returns without doing anything.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew config variable KS_DONE_MESSAGE, used to find end of kickstart install.
Martin Schwenke [Fri, 21 May 2010 01:53:54 +0000 (11:53 +1000)]
New config variable KS_DONE_MESSAGE, used to find end of kickstart install.

Currently we look for a fixed string to indicate that a kickstart
install is complete.  This changes that string to be parametrised, in
case we're using a non-standard installer.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoAdd new function clear_hooks() to clear the value of a hook variable.
Martin Schwenke [Fri, 21 May 2010 01:42:48 +0000 (11:42 +1000)]
Add new function clear_hooks() to clear the value of a hook variable.

Yes, this is overkill (we could just unset the hook variable)... but
it gives us a consistent API.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMove SSH key and grub config hacks to functions for use in setup_base_hooks.
Martin Schwenke [Fri, 21 May 2010 01:39:01 +0000 (11:39 +1000)]
Move SSH key and grub config hacks to functions for use in setup_base_hooks.

This creates new functions setup_base_ssh_keys() and
setup_base_grub_conf().  These are added to setup_base_hooks by
default.  There may be cases where these hacks aren't necessary.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew hook kickstart_floppy_create_hooks.
Martin Schwenke [Wed, 12 May 2010 04:24:58 +0000 (14:24 +1000)]
New hook kickstart_floppy_create_hooks.

Allows extra things to be done when creating kickstart floppy.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoOnly print message about creating a disk when actually creating a disk.
Martin Schwenke [Wed, 12 May 2010 02:46:02 +0000 (12:46 +1000)]
Only print message about creating a disk when actually creating a disk.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew value for SYSTEM_DISK_FORMAT: "none".
Martin Schwenke [Wed, 12 May 2010 02:36:35 +0000 (12:36 +1000)]
New value for SYSTEM_DISK_FORMAT: "none".

This skips disk image creation but still creates the libvirt XML files
for the nodes.  This can be used if you want to take advantage of some
of autocluster's features but don't actually want to create a cluster.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew function create_node_configure_image() to do the per-image configuration.
Martin Schwenke [Wed, 12 May 2010 02:22:38 +0000 (12:22 +1000)]
New function create_node_configure_image() to do the per-image configuration.

Move existing code to a function to make it easier to call
conditionally.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoTest SONAS releases after 1.1.0.x with RHEL5.5.
Martin Schwenke [Tue, 11 May 2010 23:13:35 +0000 (09:13 +1000)]
Test SONAS releases after 1.1.0.x with RHEL5.5.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agonbd-client is also optional if SYSTEM_DISK_FORMAT is not "raw".
Martin Schwenke [Fri, 30 Apr 2010 00:58:19 +0000 (10:58 +1000)]
nbd-client is also optional if SYSTEM_DISK_FORMAT is not "raw".

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoAlways set SONAS_VERSION, since it is no longer a configuration variable.
Martin Schwenke [Thu, 29 Apr 2010 03:13:36 +0000 (13:13 +1000)]
Always set SONAS_VERSION, since it is no longer a configuration variable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoRevert "New SOFS configuration variable SONAS_VERSION, default to null."
Martin Schwenke [Thu, 29 Apr 2010 03:09:32 +0000 (13:09 +1000)]
Revert "New SOFS configuration variable SONAS_VERSION, default to null."

This reverts commit 91a7e656612a3bd94cb7922b5918a73048743d5c.

Given 7cccfaa022972988ee262f4014037c62abdecdf4 we no longer need this
is a configuration variable, so let's not support too many ways of
doing things!

14 years agoAllow releases of the form <product>-<version> to use product.release.
Martin Schwenke [Thu, 29 Apr 2010 03:03:57 +0000 (13:03 +1000)]
Allow releases of the form <product>-<version> to use product.release.

Make releases more consistent with how they've always been.  If
there's no <product>-<version>.release file then look for
<product>.release and, if it exists, pass <version> to it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew release file for SONAS.
Martin Schwenke [Thu, 29 Apr 2010 01:44:52 +0000 (11:44 +1000)]
New release file for SONAS.

This is essentially the same as SoFS-2.0.release but respects either
$SONAS_VERSION or an argument to the release file.  It also sets a few
variables to more SONAS-specific values.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew SOFS configuration variable SONAS_VERSION, default to null.
Martin Schwenke [Thu, 29 Apr 2010 01:44:23 +0000 (11:44 +1000)]
New SOFS configuration variable SONAS_VERSION, default to null.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMake with_release() pass args $2.. to the release file when sourcing it.
Martin Schwenke [Thu, 29 Apr 2010 01:42:46 +0000 (11:42 +1000)]
Make with_release() pass args $2.. to the release file when sourcing it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoAdd support for RHEL5.5 cluster nodes.
Martin Schwenke [Wed, 28 Apr 2010 06:27:45 +0000 (16:27 +1000)]
Add support for RHEL5.5 cluster nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agosetup_gpfs.sh must source nsd_server_common.bash before processing args.
Martin Schwenke [Tue, 20 Apr 2010 04:35:56 +0000 (14:35 +1000)]
setup_gpfs.sh must source nsd_server_common.bash before processing args.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoAdd command-line options to setup_gpfs.sh.
Martin Schwenke [Tue, 20 Apr 2010 04:10:05 +0000 (14:10 +1000)]
Add command-line options to setup_gpfs.sh.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoUsage for SHARED_DISK_TYPE option should mention "iscsi".
Martin Schwenke [Wed, 31 Mar 2010 02:58:17 +0000 (13:58 +1100)]
Usage for SHARED_DISK_TYPE option should mention "iscsi".

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMakefile: Use time in the version string as well.
Martin Schwenke [Mon, 29 Mar 2010 01:35:55 +0000 (12:35 +1100)]
Makefile: Use time in the version string as well.

Otherwise the versions are less likely to be monotonic.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMakefile: Add rpm target and fix version.
Martin Schwenke [Mon, 29 Mar 2010 00:56:13 +0000 (11:56 +1100)]
Makefile: Add rpm target and fix version.

Version can't contain hyphens or rpmbuild gets upset.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMakefile: Make dist target and associated generated targets more robust.
Martin Schwenke [Mon, 29 Mar 2010 00:40:33 +0000 (11:40 +1100)]
Makefile: Make dist target and associated generated targets more robust.

In the version, use the date from the last git commit rather than the
current date.  This means that debian/changelog and autocluster.spec
can be more reliably generated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoDocument how to use autocluster with RHEL5 KVM package.
Martin Schwenke [Wed, 24 Mar 2010 02:43:21 +0000 (13:43 +1100)]
Document how to use autocluster with RHEL5 KVM package.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoParameterise the iSCSI target deletion with ISCSI_TID.
Martin Schwenke [Tue, 23 Mar 2010 07:38:46 +0000 (18:38 +1100)]
Parameterise the iSCSI target deletion with ISCSI_TID.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoUse tgt-admin --delete with --force to delete targets.
Martin Schwenke [Tue, 23 Mar 2010 07:29:44 +0000 (18:29 +1100)]
Use tgt-admin --delete with --force to delete targets.

This has 2 advantages:

* It disconnect any existing sessions to help force the deletion.

* It doesn't print an error message if the target doesn't exist.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoOnly check for QEMU_NBD command if SYSTEM_DISK_FORMAT is not "raw".
Martin Schwenke [Tue, 23 Mar 2010 03:59:26 +0000 (14:59 +1100)]
Only check for QEMU_NBD command if SYSTEM_DISK_FORMAT is not "raw".

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoImprove iSCSI host setup.
Martin Schwenke [Fri, 19 Mar 2010 04:11:51 +0000 (15:11 +1100)]
Improve iSCSI host setup.

This adds a command to delete the iSCSI target.  This also changes the
message printed after cluster creation: the script should always be
run since leaving LUNs between clusters may result in cached data
surviving even though the disks have been recreated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoRemove any old shared disks before creating new ones.
Martin Schwenke [Thu, 18 Mar 2010 10:22:51 +0000 (21:22 +1100)]
Remove any old shared disks before creating new ones.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoiscsimultipath initscript should identify itself when running.
Martin Schwenke [Thu, 18 Mar 2010 10:22:23 +0000 (21:22 +1100)]
iscsimultipath initscript should identify itself when running.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoAttempt to fix the iscsimultipath initscript.
Martin Schwenke [Thu, 18 Mar 2010 09:57:45 +0000 (20:57 +1100)]
Attempt to fix the iscsimultipath initscript.

Even if all of the devices are there, multipath doesn't necessarily do
what we expect.  This attempts to run multipath for up to 30 seconds
until the right number of slave devices appear.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoImprove iSCSI multipath handling.
Martin Schwenke [Thu, 18 Mar 2010 09:21:01 +0000 (20:21 +1100)]
Improve iSCSI multipath handling.

The current code uses a sleep to try to ensure that all the iSCSI
devices have appeared before running multipath.  Like any situation
involving a seemingly random sleep this is a bug.  When the host
machine is heavily loaded 5 seconds isn't enough.

This adds an extra initscript to handle this more properly.  The
initscript is always installed but is only enabled using chkconfig on
relevant nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoIf $SYSTEM_DISK_FORMAT is raw then just do a loopback mount.
Martin Schwenke [Wed, 17 Mar 2010 10:12:57 +0000 (21:12 +1100)]
If $SYSTEM_DISK_FORMAT is raw then just do a loopback mount.

In this case we don't need any qemu-nbd magic.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoIf SYSTEM_DISK_FORMAT is "raw" then BASE_FORMAT must also be "raw".
Martin Schwenke [Wed, 17 Mar 2010 09:27:48 +0000 (20:27 +1100)]
If SYSTEM_DISK_FORMAT is "raw" then BASE_FORMAT must also be "raw".

Add a check to ensure this and a corresponding error if it isn't true.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoBase image filename now ends in $BASE_FORMAT.
Martin Schwenke [Wed, 17 Mar 2010 09:20:19 +0000 (20:20 +1100)]
Base image filename now ends in $BASE_FORMAT.

Using $BASE_FORMAT in the base image filename will make error more
obvious.

For raw system disks we will just be copying the base image, so it
needs to be raw too.  Currently changing BASE_FORMAT doesn't change
the name of the base image so, unless we do complicated things
(perhaps involving the "file" command), we won't be able to tell if
we're copying an old qcow2 image or current raw image.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoNew configuration option SYSTEM_DISK_FORMAT.
Martin Schwenke [Wed, 17 Mar 2010 04:35:34 +0000 (15:35 +1100)]
New configuration option SYSTEM_DISK_FORMAT.

If this is:

* "qcow2" then use qemu-img create with a a base image.

* "raw" then use cp to copy base image.

* otherwise, error.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMerge branch 'iscsi'
Martin Schwenke [Tue, 16 Mar 2010 04:26:18 +0000 (15:26 +1100)]
Merge branch 'iscsi'

14 years agoFix RPM creation in autocluster
Ralph Wuerthner [Mon, 15 Mar 2010 16:10:01 +0000 (17:10 +0100)]
Fix RPM creation in autocluster

Martin,

while testing autocluster RPMs I had to make the following simple change to
autocluster:

commit bf7ded9fa88d11c219238499c2658fe68db0befb
Author: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Date:   Thu Mar 4 09:13:35 2010 +0100

    Added config.d directory to RPM package

14 years agoFix iSCSI host setup bug.
Martin Schwenke [Tue, 16 Mar 2010 00:06:54 +0000 (11:06 +1100)]
Fix iSCSI host setup bug.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoiscsi_out needs to be set in a function so it gets the value of CLUSTER.
Martin Schwenke [Tue, 16 Mar 2010 00:03:52 +0000 (11:03 +1100)]
iscsi_out needs to be set in a function so it gets the value of CLUSTER.

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoFix careless error in iSCSI host configuration.
Martin Schwenke [Mon, 15 Mar 2010 23:48:42 +0000 (10:48 +1100)]
Fix careless error in iSCSI host configuration.

The code to generate a LUN for each path was mostly missing and
otherwise broken.

This also reverts a stupid change in a recent commit that changed the
filename for the shared disk in the LUN specification.  We actually
use a variable that has the filename already in it...

Signed-off-by: Martin Schwenke <martin@meltin.net>
14 years agoMake iscsi_cluster_created() point to file containing the tgtadm commands.
Martin Schwenke [Mon, 15 Mar 2010 23:40:23 +0000 (10:40 +1100)]
Make iscsi_cluster_created() point to file containing the tgtadm commands.

The list of commands is too long, so we no longer print them out, we
just point to the file.

Signed-off-by: Martin Schwenke <martin@meltin.net>