ganeti-local
13 years agoRemove references to acquired_locks
Guido Trotter [Wed, 11 May 2011 14:51:54 +0000 (16:51 +0200)]
Remove references to acquired_locks

These sneaked in from 2.4 during the merge, but this attribute is
actually gone in the master branch.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMerge branch 'devel-2.4'
Guido Trotter [Wed, 11 May 2011 12:58:12 +0000 (14:58 +0200)]
Merge branch 'devel-2.4'

* devel-2.4:
  Use floppy disk and a second CDROM on KVM
  Document the selection of instance kernels
  Make root_path an optional hypervisor parameter
  Some man page updates
  Add 2 new variables to the OS scripts environment
  Add --no-wait-for-sync when converting to drbd
  Recreate instance disks: allow changing nodes
  Rename instance: only show new name when different
  Fix race condition in LUGroupAssignNodes
  Re-wrap and fix formatting issues in gnt-instance.rst
  Documentation for the new parameters for KVM
  cmdlib: Fix typo, s/nick/NIC/
  A small optimisation in cluster verify
  A few docstring fixes
  luxi: do not handle KeyboardInterrupt
  Handle EPIPE errors while writing to the terminal
  Cluster verify: check for missing bridges

Conflicts:
lib/cmdlib.py
          - manually merge the 2.4 fix
lib/opcodes.py
          - add new field from 2.4, but also describe it
man/gnt-cluster.rst
man/gnt-instance.rst
man/gnt-node.rst
          - merge new attributes with general 2.4 manpage fixes

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoiallocator: Specify result of “multi-relocate” request
Michael Hanselmann [Tue, 10 May 2011 16:24:53 +0000 (18:24 +0200)]
iallocator: Specify result of “multi-relocate” request

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse floppy disk and a second CDROM on KVM
Marco Casavecchia [Mon, 2 May 2011 08:39:50 +0000 (01:39 -0700)]
Use floppy disk and a second CDROM on KVM

Hi all,
this patch will add 3 new KVM parameters and a new option.

New Parameters:
 - floppy_image_path = "" -> Specify the floppy image to load as
floppy disk.
 - cdrom2_image_path = "" -> Specify a second cdrom image to load on
the system (note: this in not intended to be used as a boot device. To
boot the system from cdrom you must use the "cdrom_image_path"
parameter as always).
 - cdrom_disk_type = "" -> it can be one of the kvm supported types as
"ide,scsi,paravirtual,ecc". I introduced this optional parameter to
make possible to specify a different virtual device for cdroms. It is
useful if you want to install a windows system

New option for "boot_device" parameter:
 -  "floppy": with this value you should be able to boot a KVM
instance from floppy image.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit cc130cc7a60fd5377c032116b0c036ae44639913)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoDocument the selection of instance kernels
Iustin Pop [Tue, 10 May 2011 15:54:31 +0000 (17:54 +0200)]
Document the selection of instance kernels

A simple doc patch to document how to configure the kernels for the
instances.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agojqueue: Update worker thread name to include opcode summary
Michael Hanselmann [Mon, 9 May 2011 15:14:20 +0000 (17:14 +0200)]
jqueue: Update worker thread name to include opcode summary

With this patch, the worker thread name is updated to include a short
summary of the opcode (basically its OP_ID). The base name of job queue
threads is shortened from “JobQueue” to “Jq”. Logs and the lock monitor
will show a job verifying the cluster as e.g. “Jq2/Job1742/C_VERIFY”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse the new dry-run mode in cmdlib
Iustin Pop [Mon, 9 May 2011 15:06:34 +0000 (17:06 +0200)]
Use the new dry-run mode in cmdlib

This will hopefully detect potential LVM (or any other storage, when
they implement it) issues before committing changes just on some
nodes.

Unfortunately due to the dry_run opcode handling, we can't integrate
this into the usual handling (as we need to activate the disks before
doing any tests, which belongs in Exec not in CheckPrereq).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoImplement grow dry-run at RPC level
Iustin Pop [Mon, 9 May 2011 15:01:23 +0000 (17:01 +0200)]
Implement grow dry-run at RPC level

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoImplement dryrun mode for BlockDev.Grow()
Iustin Pop [Mon, 9 May 2011 14:50:23 +0000 (16:50 +0200)]
Implement dryrun mode for BlockDev.Grow()

This is always called with False from backend for now.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agocmdlib: Sort nodes for OOB commands
Michael Hanselmann [Tue, 10 May 2011 12:19:21 +0000 (14:19 +0200)]
cmdlib: Sort nodes for OOB commands

Also reorder the methods to match all other LUs.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Use helper for expanding nodes for OOB commands
Michael Hanselmann [Tue, 10 May 2011 12:15:24 +0000 (14:15 +0200)]
cmdlib: Use helper for expanding nodes for OOB commands

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Expand instances using helper for repairing disks
Michael Hanselmann [Tue, 10 May 2011 12:07:48 +0000 (14:07 +0200)]
cmdlib: Expand instances using helper for repairing disks

Also change the way “share_locks” is filled.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix bug introduced in commit 0d5a0b96
Michael Hanselmann [Tue, 10 May 2011 12:02:15 +0000 (14:02 +0200)]
Fix bug introduced in commit 0d5a0b96

When removing “acquired_locks” in commit 0d5a0b96, I didn't remember
that it does not contain the Big Ganeti Lock.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix lock release in TLMigrateInstance
Apollon Oikonomopoulos [Tue, 10 May 2011 11:10:13 +0000 (14:10 +0300)]
Fix lock release in TLMigrateInstance

Commit 52f33103 introduced lock release factorization, replacing manual
lock release using utility functions. However, it broke
TLMigrateInstance due to a typo (passing the Tasklet to ReleaseLocks
instead of the parent LU). We fix this by passing the LU to
ReleaseLocks.

Thanks to Dan Eriksson for reporting this.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRe-indent test/mocks.py using two spaces
Michael Hanselmann [Tue, 10 May 2011 09:55:42 +0000 (11:55 +0200)]
Re-indent test/mocks.py using two spaces

No idea where those four spaces came from, but they must've been there
for a while.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Remove acquired_locks attribute from LUs
Michael Hanselmann [Tue, 10 May 2011 09:41:14 +0000 (11:41 +0200)]
cmdlib: Remove acquired_locks attribute from LUs

The “acquired_locks” attribute in LUs is used to keep a list of acquired
locks at each lock level. This information is already known in the lock
manager, which also happens to be the authoritative source. Removing the
attribute and directly talking to the lock manager saves us from having
to maintain the duplicate information when releasing locks.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Use local alias for lock manager
Michael Hanselmann [Mon, 9 May 2011 16:09:07 +0000 (18:09 +0200)]
cmdlib: Use local alias for lock manager

Saves some typing and we'll use it more often in the future.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMake root_path an optional hypervisor parameter
René Nussbaumer [Mon, 9 May 2011 13:49:10 +0000 (15:49 +0200)]
Make root_path an optional hypervisor parameter

This will allow us an easy migration to pv-grub, because a set root_path
confused pv-grub.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoopcodes: Add function for compact summary
Michael Hanselmann [Mon, 9 May 2011 14:46:29 +0000 (16:46 +0200)]
opcodes: Add function for compact summary

Depending on the opcode and its parameters, the existing “Summary”
function can give a rater long summary. For displaying the summary in
logs and in the lock monitor, it should be shorter. Hence this new
function is added to just use the opcode ID with common prefixes
replaced (e.g. “INSTANCE_” becomes “I_”). Opcode values are not used.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoShow locksets in lock monitor
Michael Hanselmann [Fri, 6 May 2011 15:37:08 +0000 (17:37 +0200)]
Show locksets in lock monitor

When all locks contained in a set are acquired, the lockset's internal
lock is acquired with the same mode. With this patch the internal lock
will show up on the lock monitor, named e.g. “instances/[lockset]”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agolocking: Make parameter to condition's wait() positional
Michael Hanselmann [Fri, 6 May 2011 12:46:29 +0000 (14:46 +0200)]
locking: Make parameter to condition's wait() positional

It is always used in the locking code. Unittests are updated.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoSharedLock: Avoid acquires from sneaking in while notifying
Michael Hanselmann [Fri, 6 May 2011 12:40:26 +0000 (14:40 +0200)]
SharedLock: Avoid acquires from sneaking in while notifying

In some rare cases new shared acquires could sneak in through the
condition cached in “__pending_shared” while the code was still
notifying acquires. This was only working because such a condition
would be on top of the queue.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoSome man page updates
Iustin Pop [Mon, 9 May 2011 12:09:03 +0000 (14:09 +0200)]
Some man page updates

This adds documentation for both the short and long form of many
options (which was inconsistent before: in some cases only the short
form was used, in others only the long form).

Note that the standard this patch adopts is to document both forms as
such:

  {-O|--os-parameters} …

This makes it a bit uglier in complex situations, but the alternatives
considered were not perfect either. Other suggestions (with patches)
welcome.

Additionally, it fixes two doc bugs:

- in gnt-cluster.rst, the --prealloc-wipe-disks section was in the
  middle of a paragraph
- in gnt-instance.rst, a list was not typed correctly, thus it was
  mangled as a single paragraph

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAdd 2 new variables to the OS scripts environment
Marco Casavecchia [Thu, 5 May 2011 09:17:09 +0000 (02:17 -0700)]
Add 2 new variables to the OS scripts environment

Add INSTANCE_PRIMARY_NODE and INSTANCE_SECONDARY_NODES. These new
values are useful for OS scripts that needs to know the nodes where
the instance lives.. or has lived.

Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: fixed small issue with SECONDARY_NODES]
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd --no-wait-for-sync when converting to drbd
Iustin Pop [Mon, 9 May 2011 09:42:25 +0000 (11:42 +0200)]
Add --no-wait-for-sync when converting to drbd

Currently, when converting an instance from plain to DRBD, the
instance is blocked during the entire resync period. This patch adds
the --no-wait-for-sync so that the operation finishes as soon as the
DRBD sync has started, without waiting for the entire sync. This makes
the instance available much faster.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRecreate instance disks: allow changing nodes
Iustin Pop [Sat, 7 May 2011 10:25:18 +0000 (12:25 +0200)]
Recreate instance disks: allow changing nodes

This patch introduces the option of changing an instance's nodes when
doing the disk recreation. The rationale is that currently if an
instance lives on a node that has gone down and is marked offline,
it's not possible to re-create the disks and reinstall the instance on
a different node without hacking the config file.

Additionally, the LU now locks the instance's nodes (which was not
done before), as we most likely allocate new resources on them.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoFix instance failover/migration w.r.t TLMigrateInstance
Iustin Pop [Fri, 6 May 2011 09:07:32 +0000 (11:07 +0200)]
Fix instance failover/migration w.r.t TLMigrateInstance

Commit 1c6e5787 removed the iallocator and target_node keyword
parameters from TLMigrateInstance, but I didn't update their use in
LUInstanceFailover and (not fully) in LUInstanceMigrate.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRename instance: only show new name when different
Iustin Pop [Fri, 6 May 2011 09:03:30 +0000 (11:03 +0200)]
Rename instance: only show new name when different

It makes not sense to show messages like:
Fri May  6 02:04:01 2011  - INFO: Resolved given name 'instance18' to
'instance18'

So we'll skip the message if the resolved name is identical to the
requested one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix race condition in LUGroupAssignNodes
Michael Hanselmann [Thu, 5 May 2011 13:38:43 +0000 (15:38 +0200)]
Fix race condition in LUGroupAssignNodes

The original code would get all node information and their groups
without before acquiring the necessary locks. With this patch the node
information is only retrieved once all locks have been acquired. Groups
are locked optimistically and verified after acquiring the node locks.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix DTS_EXT_MIRROR migration
Apollon Oikonomopoulos [Tue, 22 Mar 2011 16:17:53 +0000 (18:17 +0200)]
Fix DTS_EXT_MIRROR migration

Commit faaabe3c fixed failover behaviour for DTS_INT_MIRROR instances, however
it broke migration for DTS_EXT_MIRROR instances, by moving iallocator and node
checks from LUInstanceMigrate to TLMigrateInstance. This has the side-effect
that the LU called the TL with None for both, node and iallocator when the
default iallocator was being used.

This patch maintains the iallocator checks in TLMigrateInstance and fixes the
LU-TL integration.

Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: rebased patch on current HEAD]
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse node group locking for replacing disks
Michael Hanselmann [Mon, 2 May 2011 14:33:40 +0000 (16:33 +0200)]
Use node group locking for replacing disks

This is one of the first opcodes to make use of node group locking. To
get an instance's node groups, the instance's nodes need to be looked
at. Due to a previous design decision nodes are locked after the group,
hence there's no clean locking order. This patch works around that by
first getting the instance's groups without locks, and then verifying
them after actually getting all locks. Rough overview:

- Lock instance
- Get groups of instance's nodes
- Lock groups
- Lock all nodes in groups
- Verify node groups
- Run iallocator
- Release group and unused nodes
- Replace disks, etc.

There are probably too many assertions in the code, but it's locking and
we've been bitten in the past.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoconfig: Add function to determine instance's groups
Michael Hanselmann [Mon, 2 May 2011 14:22:57 +0000 (16:22 +0200)]
config: Add function to determine instance's groups

This will be used for locking only the necessary node group(s)
for per-instance operations.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoTLMigrateInstance: Fix live migration breakage
Apollon Oikonomopoulos [Thu, 5 May 2011 08:26:27 +0000 (11:26 +0300)]
TLMigrateInstance: Fix live migration breakage

Commit 77fcff4 unintentionally incorporated code from
TLMigrateInstance.CheckPrereq into TLMigrateInstance._RunAllocator, presumably
during a rebase from earlier versions of the patch to the 2.5 codebase. As a
result all migrations running without an iallocator were performed non-live :-(

This patch moves the affected code back to CheckPrereq.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Update error messages, remove some punctuation
Michael Hanselmann [Wed, 4 May 2011 14:15:53 +0000 (16:15 +0200)]
cmdlib: Update error messages, remove some punctuation

- Clarify some error messages
- Remove unnecessary punctuation
- Merge two if conditions in one place

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRe-wrap and fix formatting issues in gnt-instance.rst
Iustin Pop [Wed, 4 May 2011 11:06:12 +0000 (13:06 +0200)]
Re-wrap and fix formatting issues in gnt-instance.rst

This is mostly rewrapping plus fixing a few small issues in
gnt-instance.rst.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoDocumentation for the new parameters for KVM
Marco Casavecchia [Tue, 3 May 2011 10:16:45 +0000 (12:16 +0200)]
Documentation for the new parameters for KVM

Options added/updated are: cdrom2_image_path, floppy_image_path,
cdrom_disk_type and boot_order.

Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: small formatting update]
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Fix typo, s/nick/NIC/
Michael Hanselmann [Tue, 3 May 2011 15:37:37 +0000 (17:37 +0200)]
cmdlib: Fix typo, s/nick/NIC/

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoA small optimisation in cluster verify
Iustin Pop [Mon, 2 May 2011 13:20:43 +0000 (15:20 +0200)]
A small optimisation in cluster verify

This removes (count of instances + count of nodes) lock
acquires/releases.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoA few docstring fixes
Iustin Pop [Mon, 2 May 2011 13:00:26 +0000 (15:00 +0200)]
A few docstring fixes

At least one generates an epydoc error :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoluxi: do not handle KeyboardInterrupt
Iustin Pop [Mon, 2 May 2011 12:03:00 +0000 (14:03 +0200)]
luxi: do not handle KeyboardInterrupt

With the current code, it's possible to mistake a ^C for a protocol
error:

node1# gnt-job info 221691
[press ^C]
Unhandled protocol error while talking to the master daemon:
Error while deserializing response:

(and note empty error message).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoHandle EPIPE errors while writing to the terminal
Iustin Pop [Mon, 2 May 2011 11:55:21 +0000 (13:55 +0200)]
Handle EPIPE errors while writing to the terminal

This handles EPIPE errors in two places: ToStream (to catch logging
done in GenericMain itself) and in GenericMain (to cover also plain
print statements).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoCluster verify: check for missing bridges
Iustin Pop [Mon, 2 May 2011 09:56:44 +0000 (11:56 +0200)]
Cluster verify: check for missing bridges

Currently cluster verify doesn't check for bridge information; the
only checks are done at instance create and failover/migrate
time. This means a cluster that seems healthy will fail creation jobs.

This patch implements a simple verification that all nodes (in the
entire cluster, so doesn't work well for multi-group) have all the
required bridges: the default one plus any instance bridge.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoUse floppy disk and a second CDROM on KVM
Marco Casavecchia [Mon, 2 May 2011 08:39:50 +0000 (01:39 -0700)]
Use floppy disk and a second CDROM on KVM

Hi all,
this patch will add 3 new KVM parameters and a new option.

New Parameters:
 - floppy_image_path = "" -> Specify the floppy image to load as
floppy disk.
 - cdrom2_image_path = "" -> Specify a second cdrom image to load on
the system (note: this in not intended to be used as a boot device. To
boot the system from cdrom you must use the "cdrom_image_path"
parameter as always).
 - cdrom_disk_type = "" -> it can be one of the kvm supported types as
"ide,scsi,paravirtual,ecc". I introduced this optional parameter to
make possible to specify a different virtual device for cdroms. It is
useful if you want to install a windows system

New option for "boot_device" parameter:
 -  "floppy": with this value you should be able to boot a KVM
instance from floppy image.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Factorize lock releasing
Michael Hanselmann [Thu, 28 Apr 2011 14:24:20 +0000 (16:24 +0200)]
cmdlib: Factorize lock releasing

There will be more lock releasing with upcoming changes, so this will
centralize the logic behind it (what locks to keep, which variables to
update, etc.).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMerge branch 'devel-2.4'
Michael Hanselmann [Fri, 29 Apr 2011 12:56:50 +0000 (14:56 +0200)]
Merge branch 'devel-2.4'

* devel-2.4:
  TLReplaceDisks: Use implicit loop for dictionary
  Release unneeded locks while replacing disks
  locking: Export “list_owned” from lock manager
  gnt-instance: Fix typo in error message

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoTLReplaceDisks: Use implicit loop for dictionary
Michael Hanselmann [Fri, 29 Apr 2011 12:54:26 +0000 (14:54 +0200)]
TLReplaceDisks: Use implicit loop for dictionary

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRelease unneeded locks while replacing disks
Michael Hanselmann [Fri, 29 Apr 2011 12:43:02 +0000 (14:43 +0200)]
Release unneeded locks while replacing disks

If an iallocator is used, “gnt-instance replace-disks” would acquire the
locks of all nodes (only the allocator will decide which node to use).
Unfortunately the unneeded locks were not released during the operation,
causing unnecessary delays for other jobs.

This patch changes the LU to release unneeded locks and adds assertions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agolocking: Export “list_owned” from lock manager
Michael Hanselmann [Fri, 29 Apr 2011 10:45:47 +0000 (12:45 +0200)]
locking: Export “list_owned” from lock manager

This is analog to “is_owned” and will be used for assertions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-instance: Fix typo in error message
Michael Hanselmann [Fri, 29 Apr 2011 10:45:13 +0000 (12:45 +0200)]
gnt-instance: Fix typo in error message

The iallocator parameter is “-I”, not “-i”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMerge branch 'devel-2.4'
Michael Hanselmann [Fri, 29 Apr 2011 12:14:15 +0000 (14:14 +0200)]
Merge branch 'devel-2.4'

* devel-2.4: (24 commits)
  mlock: fail gracefully if libc.so.6 cannot be loaded
  Allow creating the DRBD metadev in a different VG
  Make _GenerateDRBD8Branch accept different VG names
  Fix WriteFile with unicode data
  Replace disks: keep the meta device in the same VG
  Fix for multiple VGs - PlainToDrbd and replace-disks
  Fix potential data-loss in utils.WriteFile
  Improve error messages in cluster verify/OS
  Prevent readding of the master node
  Fix punctuation in an error message
  cli: Fix wrong argument kind for groups
  Quote filename in gnt-instance.8
  Fix typo in LUGroupAssignNodes
  gnt-instance info: automatically request locking
  Document the dependency on OOB for gnt-node power
  Fix master IP activation in failover with no-voting
  disk wiping: fix bug in chunk size computation
  Fix bug in watcher
  Release locks before wiping disks during instance creation
  utils.WriteFile: Close file before renaming
  ...

Conflicts:
lib/cmdlib.py: Disk parameter constants
man/gnt-instance.rst: Trivial
man/gnt-node.rst: Trivial

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agomlock: fail gracefully if libc.so.6 cannot be loaded
Iustin Pop [Fri, 29 Apr 2011 10:24:32 +0000 (12:24 +0200)]
mlock: fail gracefully if libc.so.6 cannot be loaded

This allows noded to continue instead of blowing up if the libc major
number changes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agocmdlib: Drop SSH runner from LU base class
Michael Hanselmann [Wed, 27 Apr 2011 16:14:36 +0000 (18:14 +0200)]
cmdlib: Drop SSH runner from LU base class

It is no longer used.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib.py: fix indentation in _VerifyNode
Adeodato Simo [Thu, 28 Apr 2011 16:02:52 +0000 (17:02 +0100)]
cmdlib.py: fix indentation in _VerifyNode

Signed-off-by: Adeodato Simo <dato@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoTLMigrateInstance: Fix confusing text
Michael Hanselmann [Wed, 27 Apr 2011 15:15:47 +0000 (17:15 +0200)]
TLMigrateInstance: Fix confusing text

Commit d5cafd31 changed this error message, swapping the
text parts in the process.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoLUInstanceRename: Amend comment about lock
Michael Hanselmann [Wed, 27 Apr 2011 14:59:47 +0000 (16:59 +0200)]
LUInstanceRename: Amend comment about lock

Also add an assertion.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoiallocator: Relocation nodes must be in same group
Michael Hanselmann [Wed, 27 Apr 2011 14:42:56 +0000 (16:42 +0200)]
iallocator: Relocation nodes must be in same group

Quoting from iallocator.rst: “[…] ``relocate`` request is used when an
existing instance needs to be moved within its node group […]”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix 'unused import' lint error
Iustin Pop [Thu, 28 Apr 2011 11:01:13 +0000 (13:01 +0200)]
Fix 'unused import' lint error

Sorry!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoSetEtcHostsEntry: maintain existing ordering
Iustin Pop [Thu, 28 Apr 2011 08:26:53 +0000 (10:26 +0200)]
SetEtcHostsEntry: maintain existing ordering

Currently RemoveEtcHostsEntry keeps the ordering, but SetEtcHostsEntry
not, as it will always write the new entry at the end of file. I
personally dislike this as it "uglifies" my custom host files, so this
patch makes it update the record instead in-place so to say instead of
moving it.

The patch also simplifies the construction of the new line (we were
doing duplicate work for no gain).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoConvert utils.nodesetup to utils.WriteFile(data=…)
Iustin Pop [Wed, 27 Apr 2011 15:33:48 +0000 (17:33 +0200)]
Convert utils.nodesetup to utils.WriteFile(data=…)

It makes no sense to iteratively write the new etc/hosts file, as we
can pre-compute the desired contents (neither the old nor the new
versions are safe against concurrent changes anyway).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAllow creating the DRBD metadev in a different VG
Iustin Pop [Thu, 28 Apr 2011 08:52:37 +0000 (10:52 +0200)]
Allow creating the DRBD metadev in a different VG

This is a simple change to allow specifying a different VG for the
meta device during the creation of instances and addition of disks via
gnt-instance modify.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMake _GenerateDRBD8Branch accept different VG names
Iustin Pop [Thu, 28 Apr 2011 08:40:32 +0000 (10:40 +0200)]
Make _GenerateDRBD8Branch accept different VG names

This is a small change to make this function take a list of VG names,
instead of a single one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix WriteFile with unicode data
Iustin Pop [Thu, 28 Apr 2011 09:21:19 +0000 (11:21 +0200)]
Fix WriteFile with unicode data

Unicode is fun, indeed:

>>> len(buffer("abc"))
3
>>> len(buffer(u"abc"))
12

So we can't pass unicode data to buffer(), as the result will be to
write the in-memory (usually UTF-32) representation to disk.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoReplace disks: keep the meta device in the same VG
Iustin Pop [Wed, 27 Apr 2011 12:23:12 +0000 (14:23 +0200)]
Replace disks: keep the meta device in the same VG

This patch enhances the multi-VG support in replace disks, by keeping
the meta device in the same VG, as opposed to moving it to the data
device VG (note that we don't have a way to create the meta in a
different VG in the first place, but at least we correctly handle a
custom config).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix for multiple VGs - PlainToDrbd and replace-disks
Doug Dumitru [Wed, 27 Apr 2011 09:15:54 +0000 (11:15 +0200)]
Fix for multiple VGs - PlainToDrbd and replace-disks

Converting an instance from 'plain' to 'drbd'.  The old code would
create the drbd volumes in the default VG and then the renames would
fail.  This fix pulls the plain VG names from the existing volumes and
places it into the new disk template.

Running 'replace-disks' has a similar issue with the new disks going
into the wrong VG and then the rename failing.

Their might be a similar issue with 'recreate-disks', but I actually
have no idea what recreate-disks does, so did not look into it.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix potential data-loss in utils.WriteFile
Iustin Pop [Wed, 27 Apr 2011 11:45:57 +0000 (13:45 +0200)]
Fix potential data-loss in utils.WriteFile

os.write can do incomplete writes, as long as at least some bytes have
been written (like write(2)):

>>> os.write(fd, " " * 1300)
1300
>>> os.write(fd, " " * 1300)
1300
>>> os.write(fd, " " * 1300)
1300
>>> os.write(fd, " " * 1300)
980
>>> os.write(fd, " " * 1300)
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
OSError: [Errno 28] No space left on device

Note that incomplete write that only wrote 980 bytes, before the
exception.

To workaround this, we simply iterate until all data is
written. Unittests could be written by using a parameter instead of
hardcoding os.write and checking for incomplete writes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoImprove error messages in cluster verify/OS
Iustin Pop [Wed, 27 Apr 2011 10:19:19 +0000 (12:19 +0200)]
Improve error messages in cluster verify/OS

A few issues in the clarity of the error messages are fixed:

- "ERROR: node node3: OS API version lenny-image": no preposition
  between the parameter type and the OS name, changed to "for
  lenny-image"

- "API version lenny-image differs from reference node node1: 10, 5
  vs. 10, 20, 5, 15": parameters not sorted in display

- "OS variants list lenny-image differs from reference node node1:
  vs. default, i386": empty sets are not clearly delimited, changed to
  add [] around the sets: "node node1: [] vs. [default, i386]"

- "OS parameters lenny-image differs from reference node node1:
  vs. (u'dhcp', u'Whether to enable (yes) or disable (dhcp)')": ugly
  formatting in the OS parameters list, as we used to just "%s" the
  tuple; now it is "reference node node1: [] vs. [dhcp: Whether to
  enable (yes) or disable (dhcp)]"

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoPrevent readding of the master node
Iustin Pop [Wed, 27 Apr 2011 09:42:36 +0000 (11:42 +0200)]
Prevent readding of the master node

This breaks Ganeti in multiple ways. If we don't make the check in
gnt-node itself, then bootstrap.SetupNodeDaemon will restart the
master daemon, making the operation fail:

  node1# gnt-node add --readd node1
  Cannot communicate with the master daemon.
  Is it running and listening for connections?

The check in cmdlib is more of a safety check, as we shouldn't reach
it. If we do (via a bad client), then it will prevent breakage in the
job queue/config handling.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix punctuation in an error message
Iustin Pop [Wed, 27 Apr 2011 09:23:33 +0000 (11:23 +0200)]
Fix punctuation in an error message

IIRC we don't use punctuation at the end of error messages.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoQA: Add tests for node group tags
Michael Hanselmann [Thu, 21 Apr 2011 10:58:53 +0000 (12:58 +0200)]
QA: Add tests for node group tags

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRAPI: Add support for tagging node groups
Michael Hanselmann [Thu, 21 Apr 2011 09:29:31 +0000 (11:29 +0200)]
RAPI: Add support for tagging node groups

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-group: Add commands for tagging groups
Michael Hanselmann [Thu, 21 Apr 2011 09:25:56 +0000 (11:25 +0200)]
gnt-group: Add commands for tagging groups

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agomasterd: Add support for tagging node groups
Michael Hanselmann [Thu, 21 Apr 2011 09:24:53 +0000 (11:24 +0200)]
masterd: Add support for tagging node groups

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocli: Fix wrong argument kind for groups
Michael Hanselmann [Thu, 21 Apr 2011 11:59:46 +0000 (13:59 +0200)]
cli: Fix wrong argument kind for groups

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoQuote filename in gnt-instance.8
Michael Hanselmann [Thu, 21 Apr 2011 12:00:36 +0000 (14:00 +0200)]
Quote filename in gnt-instance.8

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoQA: Adding a config option to disable cluster epo
René Nussbaumer [Thu, 21 Apr 2011 09:46:32 +0000 (11:46 +0200)]
QA: Adding a config option to disable cluster epo

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoTLMigrateInstance: remove 10s sleeps
Apollon Oikonomopoulos [Tue, 19 Apr 2011 16:23:14 +0000 (19:23 +0300)]
TLMigrateInstance: remove 10s sleeps

TLMigrateInstance._ExecMigration contains two 10-second sleeps between
individual migration steps.

Apart from prolonging the migration duration by 20s, the second sleep
causes FinalizeMigration to be called 10 seconds after the real
migration completion; since FinalizeMigration is used for configuring
KVM network interfaces of “incoming” instances, this incurs a
10-to-12-second-long network downtime for migrated instances.

This patch removes both calls.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix typo in LUGroupAssignNodes
Michael Hanselmann [Wed, 20 Apr 2011 12:33:02 +0000 (14:33 +0200)]
Fix typo in LUGroupAssignNodes

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-instance info: automatically request locking
Iustin Pop [Wed, 20 Apr 2011 11:15:23 +0000 (13:15 +0200)]
gnt-instance info: automatically request locking

Commit dae661a4 added support for controlling the locking, but it
didn't modify the gnt-instance info code, which leads to this command
always showing:

Wed Apr 20 04:10:48 2011  - WARNING: Non-static data requested, locks
need to be acquired

We simply change gnt-instance to request locks whenever we don't use
the static mode.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoDocument the dependency on OOB for gnt-node power
Iustin Pop [Wed, 20 Apr 2011 09:29:09 +0000 (11:29 +0200)]
Document the dependency on OOB for gnt-node power

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix master IP activation in failover with no-voting
Iustin Pop [Tue, 19 Apr 2011 16:35:13 +0000 (18:35 +0200)]
Fix master IP activation in failover with no-voting

Thanks to net.for.hub@gmail.com for reporting this. The logic in
masterd.CheckMasterd did an early return in case of no_voting, hence
skipping the master IP activation. We just change the ifs to not
return but simply continue through the function.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agodisk wiping: fix bug in chunk size computation
Iustin Pop [Tue, 19 Apr 2011 15:31:09 +0000 (17:31 +0200)]
disk wiping: fix bug in chunk size computation

The current wipe_chunk_size computation is doing min(int_value,
float_value). For small disks (below 10GiB), the actual formula will
result into the float value being chosen. This results into very
interesting behaviour:

Wiping disk 0, offset 102.4, chunk 102.4
Wiping disk 0, offset 204.8, chunk 102.4

Wiping disk 0, offset 921.6, chunk 102.4
Wiping disk 0, offset 1024.0, chunk 1.13686837722e-13

Since these are passed to dd via %d, this will result into the call to
dd specifying offset 1024 and count 0, which will fail.

We just need to enforce conversion to int, in order to not get bitten
by floating point rounding errors.

The patch also reorders some logging messages in order to log the
chunk size.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoUpdate manpages and other documents with editor settings
Michael Hanselmann [Tue, 19 Apr 2011 13:08:10 +0000 (15:08 +0200)]
Update manpages and other documents with editor settings

No rewrapping is done in this patch, just updates to the settings.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agognt-group list: Query filter support
Michael Hanselmann [Fri, 8 Apr 2011 11:27:13 +0000 (13:27 +0200)]
gnt-group list: Query filter support

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-node list: Query filter support
Michael Hanselmann [Tue, 19 Apr 2011 12:56:04 +0000 (14:56 +0200)]
gnt-node list: Query filter support

Update manpage, quote field names.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-instance list: Query filter support
Michael Hanselmann [Fri, 8 Apr 2011 11:07:13 +0000 (13:07 +0200)]
gnt-instance list: Query filter support

Update manpage, quote field names.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix bug in watcher
Michael Hanselmann [Tue, 19 Apr 2011 11:38:58 +0000 (13:38 +0200)]
Fix bug in watcher

If “utils.RunParts” were to raise an exception, a log message was
written and the code continued to run. Due to the exception the
“results” variable would not be defined.

Also change the code to log a backtrace (getting an exception is rather
unlikely and having a backtrace is useful) and update one comment.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agocli: Add support for parsing query filters
Michael Hanselmann [Thu, 7 Apr 2011 15:36:05 +0000 (17:36 +0200)]
cli: Add support for parsing query filters

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocli: Add option to force names to be treated as filter
Michael Hanselmann [Thu, 7 Apr 2011 15:35:44 +0000 (17:35 +0200)]
cli: Add option to force names to be treated as filter

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoopcodes: Change parameter type definition for query filter
Michael Hanselmann [Thu, 7 Apr 2011 15:33:42 +0000 (17:33 +0200)]
opcodes: Change parameter type definition for query filter

The old definition wouldn't accept integers.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocli: Error reporting for query filter parsing
Michael Hanselmann [Thu, 7 Apr 2011 15:33:08 +0000 (17:33 +0200)]
cli: Error reporting for query filter parsing

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoqlang: Add function to distinguish filters from names
Michael Hanselmann [Thu, 7 Apr 2011 15:31:34 +0000 (17:31 +0200)]
qlang: Add function to distinguish filters from names

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUpdate ganeti.7 manpage for query filter language
Michael Hanselmann [Fri, 1 Apr 2011 12:24:15 +0000 (14:24 +0200)]
Update ganeti.7 manpage for query filter language

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoqlang: Add parser for query filter language
Michael Hanselmann [Fri, 15 Apr 2011 10:18:08 +0000 (12:18 +0200)]
qlang: Add parser for query filter language

With this parser, command line utilities will be able to provide filters
through query2 in a simplistic language. Example filters:

  name == "node3.example.com"
  master or (name == "node4.example.com")
  be/memory == 128 and name =~ /^web/i
  "inst1.example.com" in sinst_list
  status != "up"
  not master

Parts of the syntax came from Python, others from Perl. Documentation
will be added in follow-up patches.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agohtools: make some error messages more explicit
Iustin Pop [Mon, 18 Apr 2011 09:55:24 +0000 (11:55 +0200)]
htools: make some error messages more explicit

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAdd instance query field for OS parameters
Michael Hanselmann [Fri, 15 Apr 2011 16:31:27 +0000 (18:31 +0200)]
Add instance query field for OS parameters

These were not available as a query field before. Update unittests
and description text for the other “..params” fields.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoQA: also run gnt-cluster repair-disk-sizes
Iustin Pop [Thu, 14 Apr 2011 14:15:09 +0000 (16:15 +0200)]
QA: also run gnt-cluster repair-disk-sizes

So that we don't happen again to break this forever without realising
it.

The patch also replaces one ' with ".

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRelease locks before wiping disks during instance creation
Michael Hanselmann [Wed, 13 Apr 2011 11:53:55 +0000 (13:53 +0200)]
Release locks before wiping disks during instance creation

Ganeti 2.3 introduced an optional feature to overwrite an instance's
disks on creation. Unfortunately the code kept all locks while doing the
wipe, slowing down the creation of multiple instances in parallel.

This patch changes the code to wipe the disks only after releasing the
locks.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix shared_file_storage_dir on upgrades
Iustin Pop [Tue, 12 Apr 2011 14:38:11 +0000 (16:38 +0200)]
Fix shared_file_storage_dir on upgrades

If the cluster was upgraded from 2.4 or earlier, this key won't exist
(it's only set to a correct value on cluster init), so we need to
properly set it to a null string (disabled).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoQA: run the redist-conf command
Iustin Pop [Tue, 12 Apr 2011 14:09:55 +0000 (16:09 +0200)]
QA: run the redist-conf command

This was (AFAICS) completely missing from the QA suite.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoPrevent ssconf values from having non-string values
Iustin Pop [Tue, 12 Apr 2011 14:04:43 +0000 (16:04 +0200)]
Prevent ssconf values from having non-string values

For whatever reason, my test cluster managed to acquire
shared_file_storage_dir with a None value, instead of empty
string. This is not flagged in masterd itself, but the node daemon
will fail in writing the value to disk, as it calls len() on the
received value.

Since this is a bad case, we should detect it as soon as possible (we
basically shouldn't be able to set it), but in the meantime we at
least prevent ssconf writes with such values.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>