ganeti-local
10 years agoMerge branch 'stable-2.9' into stable-2.10
Thomas Thrainer [Mon, 16 Dec 2013 09:49:55 +0000 (10:49 +0100)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Bump revision for 2.9.2
  Update NEWS for 2.9.2 release
  Pass hvparams to GetInstanceInfo
  Adapt parameters that moved to instance variables
  Avoid lines longer than 80 chars
  SingleNotifyPipeCondition: don't share pollers
  KVM: use custom KVM path if set for version checking
* stable-2.8
  Version bump for 2.8.3
  Update NEWS for 2.8.3 release
  Support reseting arbitrary params of ext disks
  Allow modification of arbitrary params for ext
  Do not clear disk.params in UpgradeConfig()
  SetDiskID() before accepting an instance
  Lock group(s) when creating instances
  Fix job error message after unclean master shutdown
  Add default file_driver if missing
  Update tests
  Xen handle domain shutdown
  Fix evacuation out of drained node
  Refactor reading live data in htools
  master-up-setup: Ping multiple times with a shorter interval
  Add a packet number limit to "fping" in master-ip-setup
  Fix a bug in InstanceSetParams concerning names
  build_chroot: hard-code the version of blaze-builder
  Fix error printing
  Allow link local IPv6 gateways
  Fix NODE/NODE_RES locking in LUInstanceCreate
  eta-reduce isIpV6
  Ganeti.Rpc: use brackets for ipv6 addresses
  Update NEWS file with socket permission fix info
  Fix socket permissions after master-failover

Conflicts:
NEWS
configure.ac
devel/build_chroot
lib/constants.py
src/Ganeti/Rpc.hs

Resolution:
    NEWS: take both additions
    configure.ac: ignore version bump
    constants.py: move constants to Constants.hs
    instance_migration.py: Remove call to SetDiskID(...), it has been removed in 2.10
    instance_unittest.py: Adapt test to new logic in LU
    Rest: trivial

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoBump revision for 2.9.2
Klaus Aehlig [Fri, 13 Dec 2013 12:03:41 +0000 (13:03 +0100)]
Bump revision for 2.9.2

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoUpdate NEWS for 2.9.2 release
Klaus Aehlig [Fri, 13 Dec 2013 12:03:19 +0000 (13:03 +0100)]
Update NEWS for 2.9.2 release

Besides a few local fixes, the main improvement are the changes
inherited from stable 2.8.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoDocument format of the file-storage-paths file
Thomas Thrainer [Thu, 12 Dec 2013 10:47:04 +0000 (11:47 +0100)]
Document format of the file-storage-paths file

The format of the /etc/ganeti/file-storage-paths file was not documented
in the man page. This patch adds a short note about the format there.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoPass hvparams to GetInstanceInfo
Klaus Aehlig [Thu, 12 Dec 2013 13:59:23 +0000 (14:59 +0100)]
Pass hvparams to GetInstanceInfo

...so that the xen command to be called can be determined. This
fixes another semantical conflict of the last merge.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoAdapt parameters that moved to instance variables
Klaus Aehlig [Thu, 12 Dec 2013 12:40:57 +0000 (13:40 +0100)]
Adapt parameters that moved to instance variables

Due to a change in the code organization in stable-2.9, some
method variables became instance variables, causing a semantic
merge conflict. Fix this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoAvoid lines longer than 80 chars
Klaus Aehlig [Thu, 12 Dec 2013 09:05:20 +0000 (10:05 +0100)]
Avoid lines longer than 80 chars

...as they're a lint error.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Klaus Aehlig [Wed, 11 Dec 2013 13:35:02 +0000 (14:35 +0100)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Version bump for 2.8.3
  Update NEWS for 2.8.3 release
  Support reseting arbitrary params of ext disks
  Allow modification of arbitrary params for ext
  Do not clear disk.params in UpgradeConfig()
  SetDiskID() before accepting an instance
  Lock group(s) when creating instances
  Fix job error message after unclean master shutdown
  Add default file_driver if missing
  Update tests
  Xen handle domain shutdown
  Fix evacuation out of drained node
  Refactor reading live data in htools
  master-up-setup: Ping multiple times with a shorter interval
  Add a packet number limit to "fping" in master-ip-setup
  Fix a bug in InstanceSetParams concerning names
  build_chroot: hard-code the version of blaze-builder
  Fix error printing
  Allow link local IPv6 gateways
  Fix NODE/NODE_RES locking in LUInstanceCreate
  eta-reduce isIpV6
  Ganeti.Rpc: use brackets for ipv6 addresses
  Update NEWS file with socket permission fix info
  Fix socket permissions after master-failover

Conflicts:
NEWS
configure.ac
lib/cmdlib/instance.py
lib/cmdlib/instance_migration.py
lib/hypervisor/hv_xen.py
lib/masterd/iallocator.py
lib/objects.py
src/Ganeti/HTools/Backend/IAlloc.hs
src/Ganeti/HTools/Backend/Luxi.hs
src/Ganeti/HTools/Backend/Rapi.hs
Resolution:
NEWS: take both additions
configure.ac: ignore revision bump on stable-2.8
Rest: manually apply the stable-2.8 changes on stable-2.9 code;
              for lib/hypervisor/hv_xen.py this also includes passing
              the additonal hvparams around, and adapting tests.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoVersion bump for 2.8.3
Michele Tartara [Mon, 9 Dec 2013 13:21:12 +0000 (14:21 +0100)]
Version bump for 2.8.3

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoUpdate NEWS for 2.8.3 release
Michele Tartara [Mon, 9 Dec 2013 13:20:28 +0000 (14:20 +0100)]
Update NEWS for 2.8.3 release

List all the changes that happened between 2.8.2 and 2.8.3.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoSupport reseting arbitrary params of ext disks
Dimitris Aragiorgis [Tue, 10 Dec 2013 09:14:54 +0000 (11:14 +0200)]
Support reseting arbitrary params of ext disks

If param=default and the param already exists then we remove
it from params dict. This is stolen by GetUpdatedParams() which
is used for hvparams modification/inheritance.

This means that 'default' value is not accepted for an arbitrary
param of an ext disk.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAllow modification of arbitrary params for ext
Dimitris Aragiorgis [Tue, 10 Dec 2013 16:00:55 +0000 (18:00 +0200)]
Allow modification of arbitrary params for ext

Disks of ext template are allowed to have arbitrary parameters
stored in the Disk object's params slot. Those parameters can be
passed during creation of a new disk, either in LUInstanceCreate()
or in LUInsanceSetParams(). Still those parameters can not be
changed afterwards. With this patch we override this limitation.

Currently, for the other disk templates we allow modifying only
'name' and 'mode'. Therefore, we introduce new constants
MODIFIABLE_IDISK_PARAM* to include those params. If any other
parameter is passed, _VerifyDiskModification() will raise an
exception.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoDo not clear disk.params in UpgradeConfig()
Dimitris Aragiorgis [Tue, 10 Dec 2013 09:14:52 +0000 (11:14 +0200)]
Do not clear disk.params in UpgradeConfig()

Commits 5dbee5e and cce4616 fix disk upgrades concerning params
slot. Since 2.7 params slot should be empty and gets filled
any time needed.

Still ext template allows passing arbitrary params per disk.
These params should be saved in config file for future use.
For instance if we have the shared-filer provider and we
specify shared_dir param during instance create, this param
is needed when we want to attach the disk e.g., during
retrieving instance info. If it gets overridden during a daemon
restart or a config reload we fail to get the instance's info.

To avoid such a failure, we set params slot to an empty dict
only if params not found in the first place.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoSetDiskID() before accepting an instance
Dimitris Aragiorgis [Mon, 9 Dec 2013 12:00:27 +0000 (14:00 +0200)]
SetDiskID() before accepting an instance

SetDiskID() fills physical_id slot of a Disk object.

LUInstanceSetParams() does not invoke SetDiskID() upon creation of a
new disk. As a result the physical_id slot of the Disk object in
config data is missing.

In case of ext disk template, in AcceptInstance() we invoke
_GatherAndLinkBlockDevices(). This takes `instance` as an argument
which includes current disks info. So, after adding a disk,
migration of ext instances will fail because FindDevice() expects
the physical_id slot.

With this patch we invoke SetDiskID() for every disk of the instance
before accept_instance() RPC.

Fixes Issue 633.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoLock group(s) when creating instances
Petr Pudlak [Thu, 28 Nov 2013 14:38:57 +0000 (15:38 +0100)]
Lock group(s) when creating instances

This is required to prevent race conditions such as removing a network
from a group and adding an instance at the same time. (See issue 621#2.)

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix job error message after unclean master shutdown
Hrvoje Ribicic [Thu, 5 Dec 2013 09:49:01 +0000 (10:49 +0100)]
Fix job error message after unclean master shutdown

According to commit 599ee321eb, any job-related error messages should
be encoded within a Ganeti-specific error and not passed on as a
string, to allow for easier parsing.

For jobs suffering from an undesirable status after an unclean master
daemon shutdown, the message was not encoded, as reported in issue 618.
This patch fixes the problem.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoAdd default file_driver if missing
Michele Tartara [Wed, 4 Dec 2013 17:49:50 +0000 (18:49 +0100)]
Add default file_driver if missing

If the file driver of an instance with file based storage is not specified, the
default one is automatically added by the UpgradeConfig function.

Fixes Issue 571.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoUpdate tests
Jose A. Lopes [Mon, 2 Dec 2013 12:07:39 +0000 (13:07 +0100)]
Update tests

Update hypervisor unit tests.

Partial cherry-pick from d2e4e099e4248832fef8ed7b0755d01bd4178e3a

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoXen handle domain shutdown
Jose A. Lopes [Mon, 2 Dec 2013 11:41:33 +0000 (12:41 +0100)]
Xen handle domain shutdown

Update Xen backend to properly recognize when a domain has been
shutdown by the user and to properly cleanup a shutdown domain when
Ganeti requests Xen to stop this domain.

Partial cherry-pick from 9d22cc90609e3ee8f0f2b34b793a3daced3c0e61

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix evacuation out of drained node
Jose A. Lopes [Thu, 28 Nov 2013 10:04:25 +0000 (11:04 +0100)]
Fix evacuation out of drained node

* fix node daemon not to skip data, such as, memory and disk size,
  when building the node list to send to HBal, given that these data
  are important for HBal to determine whether an evacuation is
  possible
* fix iallocator to properly load drained nodes from the list passed
  by the node daemon, instead of zeroing all the data, such as, the
  memory and disk size
* this fixes issue 615

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoRefactor reading live data in htools
Bernardo Dal Seno [Tue, 4 Jun 2013 16:38:11 +0000 (18:38 +0200)]
Refactor reading live data in htools

This simplifies different handling of individual items.

Cherry-picked from 8c72f7119f50a11661aacba2a1abffdfdc6f7cfa.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agomaster-up-setup: Ping multiple times with a shorter interval
Petr Pudlak [Tue, 3 Dec 2013 08:03:28 +0000 (09:03 +0100)]
master-up-setup: Ping multiple times with a shorter interval

In the case of network problems, one ping packet can possibly get lost.
Sending multiple packets is safer. The interval between packets is set
to 200ms so that the check finishes faster.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd a packet number limit to "fping" in master-ip-setup
Petr Pudlak [Mon, 2 Dec 2013 10:04:54 +0000 (11:04 +0100)]
Add a packet number limit to "fping" in master-ip-setup

This fixes issue #630. Apparently there is a bug in fping 3.5 where it
loops forever without "-c" given an unreachable host, even though
"-c 1" should be the default according to the man page.

The "-c" flag works on Squeeze. Checking the man pages on the Internet,
fping supported "-c" at least since 2007. So there should be no backward
compatibility problems.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoIntroduce _UpgradeSerializedRuntime() method
Dimitris Aragiorgis [Fri, 29 Nov 2013 19:14:19 +0000 (21:14 +0200)]
Introduce _UpgradeSerializedRuntime() method

This method is invoked during _AnalizeSerializedRuntime() and is
meant to modify runtime files in the way cfgupgrade does for
config.data.  This could remove deprecated fields, change the
format of the file, add/remove sections, etc.

There is a possibility data included inside runtime
files to cause migration failures after a Ganeti upgrade.
Use this method to avoid such cases.

Commit cc6fd3d exports NICs' UUIDs to configuration scripts.
It assumes UUIDs as an non optional slot in NIC object.
This is true for latest Ganeti versions. Still there might
be instances created back in Ganeti 2.7 missing that slot.

Ganeti 2.10 supports hot-plugging of devices. A prerequisite
for this feature was to change the format of runtime files and
add another entry containing block devices. This was done in
_AnalizeSerializedRuntime(). Move this logic in the new method.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoFix a bug in InstanceSetParams concerning names
Dimitris Aragiorgis [Thu, 28 Nov 2013 08:19:19 +0000 (10:19 +0200)]
Fix a bug in InstanceSetParams concerning names

In case no name is passed in disk modifications we should
keep the old one. If name=none then set disk name to None.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoSingleNotifyPipeCondition: don't share pollers
Guido Trotter [Fri, 29 Nov 2013 10:09:07 +0000 (11:09 +0100)]
SingleNotifyPipeCondition: don't share pollers

As widely known Ganeti uses a better[1] lock condition notification
library based on operating system pipes.

Inside this library we were using a shared poller for all threads
waiting for a condition. While poller is not thread safe, since (1)
we're holding the condition lock while calling poll and while parsing
results, and (2) we don't reuse the poller between different conditions,
or with newer fds our usage *is* actually safe. Unfortunately newer
versions of python take a hand-holding approach and don't trust us to do
the right thing. As such we are forced to create a new poller each time
we call wait.

This costs one system call more per wait, but practical measurements
have shown no significant impact on Ganeti. This is also a temporary
measures as newer versions will get away with the threading altogether
and move job schedulers to luxid.

The patch is losely based on a patch submitted by Daniel NĂ©ri, but has
been modified to reduce even further the scope of the poller variable to
just the waiter class.

[1] because I say so.
[1 bis] also because it produces fairer results, avoids possible
starvation and eliminates busy-wait polling.
[2] http://bugs.python.org/issue8865

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agobuild_chroot: hard-code the version of blaze-builder
Petr Pudlak [Thu, 28 Nov 2013 10:46:38 +0000 (11:46 +0100)]
build_chroot: hard-code the version of blaze-builder

The newest version does not build on Debian squeeze, so avoid
it being pulled in as a dependency.

This is the same issue that has been fixed in [1e078ef3] on master.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix error printing
Jose A. Lopes [Fri, 22 Nov 2013 13:44:02 +0000 (14:44 +0100)]
Fix error printing

Fixes issue 616.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agobuild_chroot: install pyinotify inside the chroot
Santi Raffa [Tue, 26 Nov 2013 15:52:32 +0000 (16:52 +0100)]
build_chroot: install pyinotify inside the chroot

Commit 0e3f65d2 erroneously installed pyinotify on the host system.
This commit fixes that and adds a comment on why we have to install
this dependency separately in the first place.

Signed-off-by: Santi Raffa <rsanti@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAllow link local IPv6 gateways
Thomas Thrainer [Mon, 25 Nov 2013 14:48:41 +0000 (15:48 +0100)]
Allow link local IPv6 gateways

Each host using IPv6 always has a link local address in fe80::/10. It is
common to use fe80::1 as default gateway to ease client configuration.
Ganeti prevented this usage, because it made sure that the IPv6 gateway
is in the IPv6 network the instance is connected to.

This patch also allows to specify a IPv6 gateway in the link local
network in addition to the network the instance is connected to.

This fixes issue 624.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix NODE/NODE_RES locking in LUInstanceCreate
Thomas Thrainer [Mon, 25 Nov 2013 10:37:06 +0000 (11:37 +0100)]
Fix NODE/NODE_RES locking in LUInstanceCreate

Both NODE and NODE_RES locks were acquired opportunistically if so
requested by the user. LUInstanceCreate requires, however, that the
actually locked elements on NODE and NODE_RES level are the same.

This patch changes the locking of NODE_RES such that those locks are not
acquired opportunistically any more. Instead, the mandatory locks are
set to the acquired NODE locks once they are actually granted.

This fixes issue 622.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoeta-reduce isIpV6
Klaus Aehlig [Tue, 26 Nov 2013 19:45:39 +0000 (20:45 +0100)]
eta-reduce isIpV6

This is not only better style, but also fixes a lint error.
Also use the infix form of `elem` to increase readability.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoGaneti.Rpc: use brackets for ipv6 addresses
Guido Trotter [Tue, 26 Nov 2013 15:27:17 +0000 (16:27 +0100)]
Ganeti.Rpc: use brackets for ipv6 addresses

We detect an IPv6 vs V4 address based on columns, rather than passing
the family from the cluster object to be more future proof (in case
we'll ever support mixed clusters).

Unfortunately quite a bit more code is required to test this: we need an
arbitrary node that does the right thing w.r.t. ip addresses and also
test-only exports. As such we'll do this out of the stable branch.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoKVM: use custom KVM path if set for version checking
Santi Raffa [Tue, 26 Nov 2013 11:19:26 +0000 (12:19 +0100)]
KVM: use custom KVM path if set for version checking

This commit fixes two TODOs from 2008 about using the hardcoded
"default" path for KVM where a custom one could've been set through
`gnt-cluster modify`.

As a result, `gnt-cluster verify` will no longer fail if a custom
path was set in such a manner.

Signed-off-by: Santi Raffa <rsanti@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoVersion bump for 2.10~beta1
Thomas Thrainer [Mon, 18 Nov 2013 09:42:28 +0000 (10:42 +0100)]
Version bump for 2.10~beta1

Bump version for the upcoming 2.10~beta1 release.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoSchedule 2.10~beta1 release in NEWS file
Thomas Thrainer [Mon, 18 Nov 2013 09:41:43 +0000 (10:41 +0100)]
Schedule 2.10~beta1 release in NEWS file

Schedule the 2.10~beta1 release for November 27th.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoExport NIC's UUID and name to network scripts
Dimitris Aragiorgis [Fri, 22 Nov 2013 19:59:45 +0000 (21:59 +0200)]
Export NIC's UUID and name to network scripts

In case of kvm None values are not allowed in env dict
so we have to add name only if not None.

In case of Xen since we are writing on a file that
is going to be sourced we should not add INTERFACE_NAME=None.

Fix IP=None case.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoUse HooksDict() to export network options in Xen
Dimitris Aragiorgis [Fri, 22 Nov 2013 19:59:44 +0000 (21:59 +0200)]
Use HooksDict() to export network options in Xen

Remove duplicate code that exports network options to environment
variables.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoExport tags via GetTags() to network scripts
Dimitris Aragiorgis [Fri, 22 Nov 2013 19:59:43 +0000 (21:59 +0200)]
Export tags via GetTags() to network scripts

Use GetTags() instance method in order to export instance tags
to NIC configuration scripts and files of kvm and xen hypervisors.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoFix net-common script in case of routed mode
Dimitris Aragiorgis [Fri, 22 Nov 2013 19:59:42 +0000 (21:59 +0200)]
Fix net-common script in case of routed mode

setup_route should run in case or routed mode and not
openvswitch.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoIntroduce --hotplug-if-possible option
Dimitris Aragiorgis [Thu, 21 Nov 2013 12:27:10 +0000 (14:27 +0200)]
Introduce --hotplug-if-possible option

This will be useful for an external entity using RAPI that
wants to modify devices of instances.

The common use case for that is:
"I want to add a NIC/disk to an instance. If it is running
then try to hotplug the device. If not, then just add it to config."

Another use case is that if we are unaware of the instance's
hypervisor: "I want do add a NIC/disk to an instance and if
its hypervisor is KVM try to hotplug it."

For all those cases just print a warning in CheckPrereq() and
disable any further hotplug related actions (and let
modifications take place after reboot).

Add NoHoplugSupport and HotplugIfPossible unittests an modify
existing by explicitly creating successful RPC results for
call_hotplug_supported.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd an aggregate NIC VLAN field to Python queries
Hrvoje Ribicic [Mon, 18 Nov 2013 12:52:28 +0000 (12:52 +0000)]
Add an aggregate NIC VLAN field to Python queries

As all other NIC fields have an aggregate retrieval field, add one for
the VLANs as well.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoRAPI: Make use of request_body in Reboot/Remove
Dimitris Aragiorgis [Thu, 14 Nov 2013 12:10:53 +0000 (14:10 +0200)]
RAPI: Make use of request_body in Reboot/Remove

Until now, the shutdown_timeout parameter could only be passed to
ShutdownInstance() inside kwargs, causing it to be included in the
request body. Based on that, extend RebootInstance() and
RemoveInstance() so that they can take extra arguments (e.g.
shutdown_timeout) and pass them eventually to the corresponding opcode.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoRAPI: Pass depends body arg (if any) to opcode
Dimitris Aragiorgis [Thu, 14 Nov 2013 12:10:52 +0000 (14:10 +0200)]
RAPI: Pass depends body arg (if any) to opcode

Most rlib2 classes override the default _GetDefaultData() method with
custom methods that parse a request's body and query args and return a
(body, specific_static) tuple eventually passed to FillOpCode().
Job dependencies are defined in the `depends` body argument that might
get lost because most of those methods return {} as the body. In order
not to modify every custom method we update the returned body with
the `depends` argument of the original request body for all RAPI calls
inside OpcodeResource._GenericHandler(). It's up to the client to
include the `depends` argument with the job dependencies if desired.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoAllow instances to obtain externally reserved IPs
Dimitris Aragiorgis [Fri, 1 Nov 2013 14:24:38 +0000 (16:24 +0200)]
Allow instances to obtain externally reserved IPs

The administrator should be able to assign an externally reserved IP
to a Ganeti instance manually, if desired. Currently this is not
supported. External reservations should act as holes in the pool and
not just as IPs already used by someone outside of Ganeti.
Automatic allocation with ip=pool will continue to exclude those IPs
as happens now.

To allow such functionality the administrator needs to pass explicitly
the desired IP along with the ``--no-conflicts-check`` option, or else
an error will be produced as happens now.

The aforementioned require the following changes:

 - Make IsReserved() to look either in reservations or external ones.
 - Make Reserve() and Release() to use IsReserved() with external
   argument True or False.
 - Pass extra option to ReserveIp() to bypass checking of external reservations
 - Update man pages and design doc for this change.

Furthermore, a side effect of this patch is that it fixes the
following problem:
Currently, one could not mark an IP as external if it was already
reserved (i.e. belonged to an instance). The code would produce a warning
and fail silently.

Fix config_mock.py so that if network and ip is given then reserve it in
the pool.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMark cluster's IPs as externally reserved
Dimitris Aragiorgis [Fri, 1 Nov 2013 14:24:37 +0000 (16:24 +0200)]
Mark cluster's IPs as externally reserved

Currently, upon network creation, nodes' and master's IPs
are reserved in the pool.

This leads to pool reservations ('X' in map) that cannot be changed
afterwards, although they may need to (e.g. in case of node
removal/modification). Also, these IPs are not actually handled by
Ganeti in the sense that they are not assigned to the cluster's VMs.

Thus, we should mark the as externally reserved and not just reserved.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoBe paranoid about existing keys in cfgupgrade
Thomas Thrainer [Mon, 18 Nov 2013 10:40:09 +0000 (11:40 +0100)]
Be paranoid about existing keys in cfgupgrade

The cfgupgrade test assumes a very minimal configuration for some of its
tests. This configuration does not contain some of the fields which were
assumed to be present in cfgupgrade. This patch tests for the existence
of those fields before trying to access them.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoDowngrade from 2.10 to 2.9 correctly
Thomas Thrainer [Mon, 18 Nov 2013 08:42:12 +0000 (09:42 +0100)]
Downgrade from 2.10 to 2.9 correctly

Add handling for Open vSwitch related configuration parameters as well
as for the "cpuid" and "soundhw" hypervisor parameters.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoUpdate NEWS file with socket permission fix info
Hrvoje Ribicic [Fri, 15 Nov 2013 16:39:56 +0000 (16:39 +0000)]
Update NEWS file with socket permission fix info

The NEWS file now contains a 2.8.3 entry, describing the fix of the
previous patch.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix socket permissions after master-failover
Hrvoje Ribicic [Fri, 15 Nov 2013 10:44:04 +0000 (10:44 +0000)]
Fix socket permissions after master-failover

When using gnt-cluster master-failover, on the soon-to-be-master the
luxi daemon is started by the node daemon. This makes the luxi
daemon inherit the node daemon's umask 077, making the communication
socket unreadable to group members. When using Ganeti with non-root
users, this causes problems, as reported in issue 477.

To fix this, the socket permissions are set explicitly.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Thomas Thrainer [Fri, 15 Nov 2013 10:36:23 +0000 (11:36 +0100)]
Merge branch 'stable-2.9' into stable-2.10

Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Bump revision for 2.9.1
  Update NEWS and schedule release for 2.9.1
  Fix retrieval of xen command in class method
  Fix docstring for ganeti.storage.filestorage_unittest.py
  Undo revision bump
  Postpone release of 2.9.1
  Revision bump for 2.9.1
  Update NEWS for 2.9.1 release
  Readd nodes as online
  When verifying BRBD version, ignore missing values

* stable-2.8
  Version bump for 2.8.2
  Update NEWS file for 2.8.2 release
  DRBD: ensure peers are UpToDate for dual-primary

Conflicts:
    NEWS: trivial
configure.ac: ignore version bump

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoDon't allow optional node parameters
Thomas Thrainer [Wed, 6 Nov 2013 09:36:37 +0000 (10:36 +0100)]
Don't allow optional node parameters

Ganeti does not support optional fields in parameters
(hypervisor-params, disk-params, etc.). OpenVSwitch related node
parameters were the exception to this rule, which caused numerous
problems related to import/export and (de-)serialization.

The reason for making those parameters optional in the first place was to
disallow them when OpenVSwitch is not used. This was not consistent with
other parts of Ganeti, where we allow parameters to be set even though they
are not actively used.

This patch makes all node parameters mandatory and provides sensible
defaults for them. Checks which make sure that certain parameters are
not set in some cases were removed, and the tests adapted. Also, the
inheritance logic from cluster -> node group -> node was implemented, as
it was missing previously.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoMove OVS node parameters to the right place
Thomas Thrainer [Wed, 6 Nov 2013 09:20:59 +0000 (10:20 +0100)]
Move OVS node parameters to the right place

OpenVSwitch node parameters were passed as separate command line flags.
This was not only inconsistent with all other parameters
(hypervisor-params, disk-params, ...), but also with the documented
behavior in the man pages.
Additionally, the special handling of the OVS related parameters
disabled logic in LUNodeAdd, as ndparams was never None any more.

This patch fixes those problems and treats OVS related parameters like
all other node parameters.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoMake NIC VLAN queryable
Thomas Thrainer [Wed, 6 Nov 2013 09:12:06 +0000 (10:12 +0100)]
Make NIC VLAN queryable

Add an additional query field which makes it possible to query for
VLANs of instance NICs.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoPass VLAN parameter correctly in moves
Thomas Thrainer [Wed, 6 Nov 2013 09:09:07 +0000 (10:09 +0100)]
Pass VLAN parameter correctly in moves

Fix the assignment of a wrong value to the VLAN and name parameters of
NICs during instance moves.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoUse constant instead of raw string
Thomas Thrainer [Wed, 6 Nov 2013 09:07:17 +0000 (10:07 +0100)]
Use constant instead of raw string

Use the appropriate constant instead of a raw string.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoMerge 'hs2py-constants' into 'hs2py'
Jose A. Lopes [Thu, 14 Nov 2013 08:32:06 +0000 (09:32 +0100)]
Merge 'hs2py-constants' into 'hs2py'

Merge code of 'hs2py-constants' into 'hs2py', which requires adding
flag '--constants', and merge target 'src/hs2py-constants' into
'src/hs2py' in 'Makefile.am', also updating dependencies and
variables.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd flag '--opcodes' to 'hs2py'
Jose A. Lopes [Thu, 14 Nov 2013 08:34:26 +0000 (09:34 +0100)]
Add flag '--opcodes' to 'hs2py'

This is a transitional step before merging 'hs2py-constants' and
'hs2py'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoSort design docs alphabetically
Jose A. Lopes [Tue, 12 Nov 2013 16:10:56 +0000 (17:10 +0100)]
Sort design docs alphabetically

Sort design docs alphabetically in Makefile.am and fix whitespace.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoMissing design docs from distribution
Jose A. Lopes [Tue, 12 Nov 2013 16:10:02 +0000 (17:10 +0100)]
Missing design docs from distribution

Fixes issue 609.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoBump revision for 2.9.1 v2.9.1
Klaus Aehlig [Tue, 12 Nov 2013 15:44:22 +0000 (16:44 +0100)]
Bump revision for 2.9.1

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoUpdate NEWS and schedule release for 2.9.1
Klaus Aehlig [Tue, 12 Nov 2013 15:43:46 +0000 (16:43 +0100)]
Update NEWS and schedule release for 2.9.1

Now that issue 608 fixed, schedule a new release date
for 2.9.1.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFixing rapi documentation wrt to storage types
Helga Velroyen [Tue, 12 Nov 2013 14:36:42 +0000 (15:36 +0100)]
Fixing rapi documentation wrt to storage types

This fixes a FIXME in the rapi documentation. The list of
storage types that can be queries for space information was
checked against the complete storage type set and not
against the set of storage types that actually support
storage reporting.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoFix retrieval of xen command in class method
Helga Velroyen [Tue, 12 Nov 2013 13:45:53 +0000 (14:45 +0100)]
Fix retrieval of xen command in class method

This patch fixes issue 608. When introducing the
configurability of the xen toolstack in commit
8ef418bb92, the hypervisor api was accidentally changed
in a way that let to this error in KVM.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix docstring for ganeti.storage.filestorage_unittest.py
Santi Raffa [Mon, 11 Nov 2013 17:44:29 +0000 (18:44 +0100)]
Fix docstring for ganeti.storage.filestorage_unittest.py

Signed-off-by: Santi Raffa <rsanti@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMove Haskell constants to proper module
Jose A. Lopes [Fri, 8 Nov 2013 09:07:04 +0000 (10:07 +0100)]
Move Haskell constants to proper module

Move Haskell constants from module 'Ganeti.HsConstants', which was a
transitional module part of the Haskell to Python constant generation
infrastructure, to module 'Ganeti.Constants'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoTear down Py2Hs constant infrastructure
Jose A. Lopes [Thu, 7 Nov 2013 10:02:42 +0000 (11:02 +0100)]
Tear down Py2Hs constant infrastructure

Tear down Python to Haskell constant conversion infrastructure, which
includes eliminating the autotool 'convert-constants' and the Haskell
module, namely 'Ganeti.PyConstants', which held the converted
contants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: additional module jstore
Jose A. Lopes [Thu, 7 Nov 2013 09:53:15 +0000 (10:53 +0100)]
Hs2Py constants: additional module jstore

Add constants from additional modules ('ganeti.jstore') to the Haskell
to Python constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: additional module errors
Jose A. Lopes [Thu, 7 Nov 2013 09:50:50 +0000 (10:50 +0100)]
Hs2Py constants: additional module errors

Add constants from module 'ganeti.errors' to the Haskell to Python
constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: additional module qlang
Jose A. Lopes [Thu, 7 Nov 2013 09:48:12 +0000 (10:48 +0100)]
Hs2Py constants: additional module qlang

Add constants from additional modules ('ganeti.qlang') to the Haskell
to Python constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: additional module luxi
Jose A. Lopes [Wed, 6 Nov 2013 10:34:44 +0000 (11:34 +0100)]
Hs2Py constants: additional module luxi

Add constants from additional modules ('ganeti.luxi') to the Haskell
to Python constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRemove module 'ganeti.constants' from 'convert-constants'
Jose A. Lopes [Wed, 6 Nov 2013 10:31:06 +0000 (11:31 +0100)]
Remove module 'ganeti.constants' from 'convert-constants'

Given that there are no more constants in 'ganeti.constants' to
convert to Haskell, this module import and conversion logic can be
removed from the autotool 'convert-constants'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix reference to vcs version in query server
Jose A. Lopes [Thu, 7 Nov 2013 08:56:34 +0000 (09:56 +0100)]
Fix reference to vcs version in query server

Fix reference to vcs version in query server to take its value from
the Haskell constant in 'Ganeti.Version' instead of using the constant
generated from Python.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoEliminate unused constants
Jose A. Lopes [Tue, 5 Nov 2013 19:33:45 +0000 (20:33 +0100)]
Eliminate unused constants

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUse configure constants instead of generated
Jose A. Lopes [Tue, 5 Nov 2013 19:32:28 +0000 (20:32 +0100)]
Use configure constants instead of generated

Replace uses of the generated 'AF_INET*' constants with the constants
in Haskell's 'AutoConf'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHs2Py constants: add 'UUID_REGEX'
Jose A. Lopes [Fri, 8 Nov 2013 09:04:26 +0000 (10:04 +0100)]
Hs2Py constants: add 'UUID_REGEX'

Add constant 'UUID_REGEX' to the Haskell to Python constant
generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd 'AF_INET*' constants to Haskell's 'AutoConf'
Jose A. Lopes [Tue, 5 Nov 2013 19:30:26 +0000 (20:30 +0100)]
Add 'AF_INET*' constants to Haskell's 'AutoConf'

Add 'AF_INET*' constants to the Haskell 'AutoConf' module, which
requires extending the 'm4' invocation with additional substitutions,
in the 'Makefile' target for 'src/AutoConf.hs'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoPython autotool to print socket constants
Jose A. Lopes [Tue, 5 Nov 2013 19:28:08 +0000 (20:28 +0100)]
Python autotool to print socket constants

Add Python script to autotools which prints socket related constants.
These constants are a transitional solution for eliminating the Python
to Haskell constant generation given that the final solution will
require a change in the configuration and, therefore, postponed to
2.11.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUndo revision bump
Klaus Aehlig [Fri, 8 Nov 2013 16:06:09 +0000 (17:06 +0100)]
Undo revision bump

Before releasing 2.9.2, we still have issue 608 to fix; if
no release date is set, we still have to be at the lower
version.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoPostpone release of 2.9.1
Klaus Aehlig [Fri, 8 Nov 2013 15:08:55 +0000 (16:08 +0100)]
Postpone release of 2.9.1

...until issue 608 is fixed.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoRevision bump for 2.9.1
Klaus Aehlig [Thu, 7 Nov 2013 15:21:46 +0000 (16:21 +0100)]
Revision bump for 2.9.1

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoUpdate NEWS for 2.9.1 release
Klaus Aehlig [Thu, 7 Nov 2013 15:20:23 +0000 (16:20 +0100)]
Update NEWS for 2.9.1 release

Add a section in the file for the new upcoming release. Besides
the fix of the DRBD race condition inherited from 2.8.2, this
also fixes handling and readding of offline nodes.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoReadd nodes as online
Klaus Aehlig [Thu, 7 Nov 2013 14:19:22 +0000 (15:19 +0100)]
Readd nodes as online

Patch d0d7d7cf accidentally removed the offline-flag reset
when readding a node. Readd it.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoWhen verifying BRBD version, ignore missing values
Klaus Aehlig [Thu, 7 Nov 2013 13:42:10 +0000 (14:42 +0100)]
When verifying BRBD version, ignore missing values

When comparing for consistency of the DRBD versions, some
versions might not be available via RPC, typically, if the
node is offline. In this case, leave these nodes out of the
test, instead of failing with an internal python error.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Klaus Aehlig [Thu, 7 Nov 2013 12:37:08 +0000 (13:37 +0100)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Version bump for 2.8.2
  Update NEWS file for 2.8.2 release
  DRBD: ensure peers are UpToDate for dual-primary

Conflicts:
NEWS: trivial
configure.ac: ignore version bump on stable-2.8
lib/bdev.py: manually apply the part of commit
            73e15b5e that applies to lib/bdev.py to
            lib/storage/drbd_info.py, and keep lib/bdev.py
            removed

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoVersion bump for 2.8.2 v2.8.2
Michele Tartara [Wed, 6 Nov 2013 12:26:24 +0000 (12:26 +0000)]
Version bump for 2.8.2

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoUpdate NEWS file for 2.8.2 release
Michele Tartara [Wed, 6 Nov 2013 12:25:16 +0000 (12:25 +0000)]
Update NEWS file for 2.8.2 release

Add a section in the file for the new upcoming release.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoWhen loading configuration fails, include the reason
Petr Pudlak [Tue, 5 Nov 2013 14:32:20 +0000 (15:32 +0100)]
When loading configuration fails, include the reason

Before the message why a failure happened (like a parsing error) was lost.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoDRBD: ensure peers are UpToDate for dual-primary
Apollon Oikonomopoulos [Tue, 5 Nov 2013 14:30:45 +0000 (16:30 +0200)]
DRBD: ensure peers are UpToDate for dual-primary

DrbdAttachNet supports both, normal primary/secondary node operation, and
(during live migration) dual-primary operation. When resources are newly
attached, we poll until we find all of them in connected or syncing operation.

Although aggressive, this is enough for primary/secondary operation, because
the primary/secondary role is not changed from within DrbdAttachNet. However,
in the dual-primary ("multimaster") case, both peers are subsequently upgraded
to the primary role.  If - for unspecified reasons - both disks are not
UpToDate, then a resync may be triggered after both peers have switched to
primary, causing the resource to disconnect:

  kernel: [1465514.164009] block drbd2: I shall become SyncTarget, but I am
    primary!
  kernel: [1465514.171562] block drbd2: ASSERT( os.conn == C_WF_REPORT_PARAMS )
    in /build/linux-rrsxby/linux-3.2.51/drivers/block/drbd/drbd_receiver.c:3245

This seems to be extremely racey and is possibly triggered by some underlying
network issues (e.g. high latency), but it has been observed in the wild. By
logging the DRBD resource state in the old secondary, we managed to see a
resource getting promoted to primary while it was:

  WFSyncUUID Secondary/Primary Outdated/UpToDate

We fix this by explicitly waiting for "Connected" cstate and
"UpToDate/UpToDate" disks, as advised in [1]:

  "For this purpose and scenario,
   you only want to promote once you are Connected UpToDate/UpToDate."

[1] http://lists.linbit.com/pipermail/drbd-user/2013-July/020173.html

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Klaus Aehlig [Tue, 5 Nov 2013 12:47:30 +0000 (13:47 +0100)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Revision bump for 2.9.0
  Schedule release of 2.9.0

* stable-2.8
  Improve error message for replace-disks

Conflicts:
NEWS: trivial
configure.ac: drop suffix bump of stable-2.9

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoRevision bump for 2.9.0 v2.9.0
Klaus Aehlig [Mon, 4 Nov 2013 09:40:13 +0000 (10:40 +0100)]
Revision bump for 2.9.0

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoSchedule release of 2.9.0
Klaus Aehlig [Mon, 4 Nov 2013 09:39:36 +0000 (10:39 +0100)]
Schedule release of 2.9.0

...and mention the last change pulled in from stable-2.8.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Klaus Aehlig [Mon, 4 Nov 2013 15:36:02 +0000 (16:36 +0100)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Improve error message for replace-disks

Conflicts:
lib/cmdlib/instance_storage.py
Resolved by manually applying the node name to uuid
transition on the version of stable-2.9.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoImprove error message for replace-disks
Michele Tartara [Mon, 4 Nov 2013 15:20:07 +0000 (15:20 +0000)]
Improve error message for replace-disks

In some conditions, replace-disks will fail if the disks are not properly
activated. Improve the error message suggesting to run activate-disks before
executing replace-disks.

Fixes Issue 606.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix documentation
Jose A. Lopes [Wed, 30 Oct 2013 09:25:42 +0000 (10:25 +0100)]
Fix documentation

Fix documentation in constants containing values in seconds.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoReplace all constant definitions with re-exports
Jose A. Lopes [Wed, 30 Oct 2013 09:15:57 +0000 (10:15 +0100)]
Replace all constant definitions with re-exports

Remove all constant definitions in 'lib/constants.py' and re-export
the module 'lib/_constants.py', which contains the generated
constants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoPrepare constants for automatic reexport
Jose A. Lopes [Mon, 28 Oct 2013 18:01:48 +0000 (19:01 +0100)]
Prepare constants for automatic reexport

* separate constants and non-constants in 'lib/constants.py' to make
  it simple to replace their re-export definitions with a single
  re-export statement at the begining of the module

* fix access 'CONFD_REQFIELD_*' related constants in
  'tools/confd-client' to convert them to 'String', rather then doing
  it in 'lib/constants.py' in order to allow the replacement of the
  re-export definitions with a single re-export statement

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoHs2Py constants: 'hvsParameterTypes' and 'hvsParameters'
Jose A. Lopes [Mon, 28 Oct 2013 13:45:40 +0000 (14:45 +0100)]
Hs2Py constants: 'hvsParameterTypes' and 'hvsParameters'

Add constants 'hvsParameters' and 'hvsParameterTypes' to the Haskell
to Python constant generation.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix indentation that triggers PEP8 error
Petr Pudlak [Thu, 31 Oct 2013 14:35:00 +0000 (15:35 +0100)]
Fix indentation that triggers PEP8 error

Signed-off-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoCheck if hotplug is supported in CheckPrereq
Dimitris Aragiorgis [Wed, 30 Oct 2013 16:56:01 +0000 (18:56 +0200)]
Check if hotplug is supported in CheckPrereq

Introduce new RPC hotplug_supported that invokes the corresponding
hypervisor's method which checks if hotplug is generally
supported. Call this RPC early in CheckPrereq() and abort if
hotplug is not supported. Currently only KVM hypervisor with
qemu versions > 1.0. Please note that this check is unaware of
target device and hotplug action. This latter check is still
done during hotplug_device() RPC.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>