ganeti-local
13 years agoclient.gnt_node: Remove unnecessary lambda
Michael Hanselmann [Tue, 14 Dec 2010 15:07:28 +0000 (16:07 +0100)]
client.gnt_node: Remove unnecessary lambda

Pylint complained that the “lambda may not be necessary”. Turns out it
was right.

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

13 years agoQA: Extend unittests for query operations, add tests for list-fields
Michael Hanselmann [Fri, 10 Dec 2010 15:45:20 +0000 (16:45 +0100)]
QA: Extend unittests for query operations, add tests for list-fields

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

13 years agoUpdate NEWS for new query infrastructure
Michael Hanselmann [Wed, 8 Dec 2010 18:55:08 +0000 (19:55 +0100)]
Update NEWS for new query infrastructure

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

13 years agoConvert “gnt-instance list” to query2
Michael Hanselmann [Wed, 8 Dec 2010 19:41:43 +0000 (20:41 +0100)]
Convert “gnt-instance list” to query2

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

13 years agoConvert “gnt-node list” to query2
Michael Hanselmann [Wed, 8 Dec 2010 17:54:50 +0000 (18:54 +0100)]
Convert “gnt-node list” to query2

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

13 years agocli: Add infrastructure for query2
Michael Hanselmann [Wed, 8 Dec 2010 17:55:50 +0000 (18:55 +0100)]
cli: Add infrastructure for query2

A new function for formatting the query results is added,
``FormatTable``. This was determined to be easier and safer than
modifying the existing ``GenerateTable`` function while keeping
backwards compatibility for code not yet converted. The new code makes
use of the enhanced information provided by query2.

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

13 years agoiallocator: Export node group allocation policy
Balazs Lecz [Mon, 13 Dec 2010 19:30:03 +0000 (19:30 +0000)]
iallocator: Export node group allocation policy

Signed-off-by: Balazs Lecz <leczb@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAdding --node-powered command line flag
René Nussbaumer [Mon, 13 Dec 2010 14:13:53 +0000 (15:13 +0100)]
Adding --node-powered command line flag

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

13 years agoSet powered to True for added nodes
René Nussbaumer [Mon, 13 Dec 2010 14:55:11 +0000 (15:55 +0100)]
Set powered to True for added nodes

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

13 years agoSet recorded powered state for OOB calls
René Nussbaumer [Mon, 13 Dec 2010 14:07:39 +0000 (15:07 +0100)]
Set recorded powered state for OOB calls

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

13 years agoAdd new Node attribute powered
René Nussbaumer [Mon, 13 Dec 2010 13:52:46 +0000 (14:52 +0100)]
Add new Node attribute powered

This is just a state of record field and does not necessary
reflect the reality.

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

13 years agoAdd ganeti-kvm-poweroff.initd to .gitignore
Adeodato Simo [Mon, 13 Dec 2010 19:16:20 +0000 (19:16 +0000)]
Add ganeti-kvm-poweroff.initd to .gitignore

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

13 years agoMore QA tests for group operations
Adeodato Simo [Thu, 9 Dec 2010 16:15:58 +0000 (16:15 +0000)]
More QA tests for group operations

This adds QA tests for the SetGroupParams operation, both for CLI and
RAPI. Additionally, it adds tests for add/rename/remove groups via RAPI,
which had not been included in a previous patch series. Finally, it also
tests setting "alloc_policy" (and, for the CLI, "ndparams") at group
creation time.

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

13 years agoAdd some unit tests for ConfigWriter.AddNodeGroup()
Adeodato Simo [Thu, 9 Dec 2010 16:45:55 +0000 (16:45 +0000)]
Add some unit tests for ConfigWriter.AddNodeGroup()

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

13 years agoExpose OpSetGroupParams in RAPI and RAPI client
Adeodato Simo [Thu, 9 Dec 2010 15:43:54 +0000 (15:43 +0000)]
Expose OpSetGroupParams in RAPI and RAPI client

This creates the /2/groups/<name>/modify resource; at the moment, only the
"alloc_policy" attribute can be modified.

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

13 years agoAdd the "alloc_policy" attribute to node groups
Adeodato Simo [Thu, 9 Dec 2010 15:16:23 +0000 (15:16 +0000)]
Add the "alloc_policy" attribute to node groups

This can be set at group creation time and via OpSetGroupParams. The default
is "preferred", and existing node groups from previous Ganeti version will
get the attribute set to this value.

Signed-off-by: Adeodato Simo <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoAdd modification of node groups (OpCode/LU/CLI)
Adeodato Simo [Thu, 9 Dec 2010 12:55:17 +0000 (12:55 +0000)]
Add modification of node groups (OpCode/LU/CLI)

With this commit, only modification of the "ndparams" attribute is
supported.

Signed-off-by: Adeodato Simo <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoIntroduce OpAddGroup.ndparams and expose in CLI
Adeodato Simo [Wed, 8 Dec 2010 19:49:24 +0000 (19:49 +0000)]
Introduce OpAddGroup.ndparams and expose in CLI

Signed-off-by: Adeodato Simo <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoFix sorting bug in LUQueryGroups
Adeodato Simo [Thu, 9 Dec 2010 14:25:51 +0000 (14:25 +0000)]
Fix sorting bug in LUQueryGroups

In LUQueryGroups.Exec(), NiceSort was being applied to group UUIDs, and
not to group names. We use a temporary name to UUID map to sort the list
of UUIDs by group name instead.

Signed-off-by: Adeodato Simo <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agocmdlib: Sort list of fields for QueryFields
Michael Hanselmann [Wed, 8 Dec 2010 19:20:41 +0000 (20:20 +0100)]
cmdlib: Sort list of fields for QueryFields

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

13 years agoobjects: Add custom de-/serializing code for query responses
Michael Hanselmann [Wed, 8 Dec 2010 17:54:14 +0000 (18:54 +0100)]
objects: Add custom de-/serializing code for query responses

… and use them in cmdlib.

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

13 years agoLUXI: Add Query and QueryFields functions
Michael Hanselmann [Mon, 6 Dec 2010 21:21:14 +0000 (22:21 +0100)]
LUXI: Add Query and QueryFields functions

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

13 years agoobjects: Add definitions for query requests and responses
Michael Hanselmann [Mon, 6 Dec 2010 21:17:49 +0000 (22:17 +0100)]
objects: Add definitions for query requests and responses

Also update description of QueryFieldDefinition.name.

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

13 years agoqlang: Add function to build simple filter
Michael Hanselmann [Wed, 8 Dec 2010 17:53:07 +0000 (18:53 +0100)]
qlang: Add function to build simple filter

This will be used in clients to build the filters for query2.

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

13 years agoquery: Handle items missing timestamps
Michael Hanselmann [Fri, 10 Dec 2010 17:25:04 +0000 (18:25 +0100)]
query: Handle items missing timestamps

In upgraded configurations, some items might miss the “ctime” and/or
“mtime” values and need to be handled specially.

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

13 years agoAdd gnt-cluster modify --master-netdev
Guido Trotter [Wed, 8 Dec 2010 15:24:46 +0000 (16:24 +0100)]
Add gnt-cluster modify --master-netdev

Although this might be a dangerous operation, it's still better to allow
it rather than requiring a hand-edit of the config file, should it be
necessary.

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

13 years agoRename “kind” to “what” for calls in query2 design
Michael Hanselmann [Mon, 6 Dec 2010 21:17:06 +0000 (22:17 +0100)]
Rename “kind” to “what” for calls in query2 design

“kind” is already used in the field definition. “what” seems to
be a better fit for the calls (“what should be queried?”).

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

13 years agoQA: Improve tests for instance/node list
Michael Hanselmann [Mon, 6 Dec 2010 18:54:16 +0000 (19:54 +0100)]
QA: Improve tests for instance/node list

- Query all known fields
- Random combinations (using a PRNG with a fixed seed) of fields
- Order of result names

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

13 years agocmdlib: Convert instance query to new infrastructure
Michael Hanselmann [Thu, 2 Dec 2010 21:49:28 +0000 (22:49 +0100)]
cmdlib: Convert instance query to new infrastructure

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

13 years agoquery: Add definition for instance queries
Michael Hanselmann [Tue, 30 Nov 2010 13:56:32 +0000 (14:56 +0100)]
query: Add definition for instance queries

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

13 years agoScript to gracefully power off KVM instances
Miguel Di Ciurcio Filho [Thu, 9 Dec 2010 16:00:20 +0000 (14:00 -0200)]
Script to gracefully power off KVM instances

When a node is running KVM instances and that node is rebooted or
shutdown, the gnt-noded daemon is finished and leaves the KVM instances
running. Latter on in the shutdown process, all remaining processes
receive SIGTERM as usual, meaning that the KVM instances are all
terminated, without running a proper shutdown procedure inside the
guests.

When using Xen, the xendomains script will take care of gracefully
powering down the instances, but for KVM there is nothing like that.

This patch adds an script that sends the "system_powerdown" command to
all running instances, and it could be useful for people using KVM.

This patch is a response for issue #126

Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMerge branch 'devel-2.3'
Guido Trotter [Thu, 9 Dec 2010 15:14:31 +0000 (16:14 +0100)]
Merge branch 'devel-2.3'

* devel-2.3:
  Fix rename for file-backed instances

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

13 years agoMerge branch 'devel-2.2' into devel-2.3
Guido Trotter [Thu, 9 Dec 2010 15:13:00 +0000 (16:13 +0100)]
Merge branch 'devel-2.2' into devel-2.3

* devel-2.2:
  Fix rename for file-backed instances

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

13 years agoMerge branch 'stable-2.2' into devel-2.2
Guido Trotter [Thu, 9 Dec 2010 15:12:18 +0000 (16:12 +0100)]
Merge branch 'stable-2.2' into devel-2.2

* stable-2.2:
  Fix rename for file-backed instances

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

13 years agoFix rename for file-backed instances
Guido Trotter [Wed, 8 Dec 2010 14:53:48 +0000 (15:53 +0100)]
Fix rename for file-backed instances

Currently the code wrongly changes the disk logical/physical id
component representing the path from "$storage_dir/$iname/disk$seq" to
"$storage_dir/$iname/disk/$seq" (note the additional slash) breaking the
rename.

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

13 years agoCheck payload of OOB execution
René Nussbaumer [Tue, 7 Dec 2010 15:22:29 +0000 (16:22 +0100)]
Check payload of OOB execution

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

13 years agoReplace GetOobProgram by GetNdParams
René Nussbaumer [Thu, 9 Dec 2010 13:07:37 +0000 (14:07 +0100)]
Replace GetOobProgram by GetNdParams

This was due to a older review which used GetOobProgram but then
changed to GetNdParams. Forgot to adjust this in the LU before.

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

13 years agoEnsure we just serialize JSON if there is data
René Nussbaumer [Tue, 7 Dec 2010 15:03:40 +0000 (16:03 +0100)]
Ensure we just serialize JSON if there is data

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

13 years agoAdding missing timeout parameter to rpc interface
René Nussbaumer [Thu, 9 Dec 2010 13:05:20 +0000 (14:05 +0100)]
Adding missing timeout parameter to rpc interface

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

13 years agoqa: test same-name instance rename
Guido Trotter [Thu, 9 Dec 2010 10:45:22 +0000 (11:45 +0100)]
qa: test same-name instance rename

Use the simplified command and rapi version to perform an instance
rename to the same name. This is performed anytime the rename test is
enabled, while the "other-name" rename is performed when also an
alternative name is provided.

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

13 years agoSimplify instance rename qa test
Guido Trotter [Thu, 9 Dec 2010 10:38:50 +0000 (11:38 +0100)]
Simplify instance rename qa test

The current instance rename qa testing function can only perform
back-and-forth renames, both for command line and rapi. In order to be
able to perform same-name rename tests we change it to be able to
perform simple renames, and then we change qa to call it to perform both
sides of the renaming.

The same change is applied both to the local and the rapi test.

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

13 years agoAllow rename of instance to same name
Guido Trotter [Wed, 8 Dec 2010 15:01:02 +0000 (16:01 +0100)]
Allow rename of instance to same name

This basically is a no-op in ganeti, but forces the execution of the
os-specific rename scripts.

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

13 years agoIntroduce constant for the name of the initial node group
Adeodato Simo [Wed, 8 Dec 2010 16:06:21 +0000 (16:06 +0000)]
Introduce constant for the name of the initial node group

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

13 years agodesign-2.3.rst: fix whitespace
Adeodato Simo [Wed, 8 Dec 2010 16:14:07 +0000 (16:14 +0000)]
design-2.3.rst: fix whitespace

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

13 years agoconstants.py: fix tiny grammar issue in comment
Adeodato Simo [Wed, 8 Dec 2010 16:05:53 +0000 (16:05 +0000)]
constants.py: fix tiny grammar issue in comment

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

13 years agoobjects.py: fix minor error in NodeGroup.SimpleFillND docstring
Adeodato Simo [Wed, 8 Dec 2010 19:27:06 +0000 (19:27 +0000)]
objects.py: fix minor error in NodeGroup.SimpleFillND docstring

The defaults are filled in from the node group defaults, not cluster
defaults (presumably copy & paste error).

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

13 years agoNode query: maintain order as requested
Michael Hanselmann [Wed, 8 Dec 2010 18:22:24 +0000 (19:22 +0100)]
Node query: maintain order as requested

If the client requests certain names, their order should be maintained.
This is already done for instance queries. Moving this part into a
separate function allows sharing code.

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

13 years agoquery: Improve error checking
Michael Hanselmann [Wed, 1 Dec 2010 19:41:05 +0000 (20:41 +0100)]
query: Improve error checking

- Show only field definition, not callback when a result row is
  inconsistent
- Show list of duplicate titles if there are any (module load time)

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

13 years agoconstants: Clarify comment for QRFS_NODATA
Michael Hanselmann [Tue, 30 Nov 2010 13:56:51 +0000 (14:56 +0100)]
constants: Clarify comment for QRFS_NODATA

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

13 years agocmdlib: Fix prototype for _QueryBase.DeclareLocks
Michael Hanselmann [Thu, 2 Dec 2010 21:48:48 +0000 (22:48 +0100)]
cmdlib: Fix prototype for _QueryBase.DeclareLocks

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

13 years agoGroup operations: add QA tests for add/remove/rename
Adeodato Simo [Mon, 6 Dec 2010 16:46:01 +0000 (16:46 +0000)]
Group operations: add QA tests for add/remove/rename

This is a single function that tests all of of the following:

  - creating groups
  - creating groups that exist fails
  - renaming an empty group
  - renaming a group with nodes
  - renaming to a name that already exists fails
  - removing an empty group works
  - removing a group with nodes fails

The "default" group is only used for the "rename group with nodes"
test.

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

13 years agoGroup operations: update ganeti.rapi.client with all node group operations
Adeodato Simo [Mon, 6 Dec 2010 15:30:27 +0000 (15:30 +0000)]
Group operations: update ganeti.rapi.client with all node group operations

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

13 years agoGroup operations: expose add/remove/rename in RAPI
Adeodato Simo [Mon, 6 Dec 2010 15:23:46 +0000 (15:23 +0000)]
Group operations: expose add/remove/rename in RAPI

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

13 years agoGroup operations: CLI code for add/remove/rename a group
Adeodato Simo [Fri, 3 Dec 2010 12:41:14 +0000 (12:41 +0000)]
Group operations: CLI code for add/remove/rename a group

Also, minor update to the 2.3 design doc, which was indicating the remove
operation would be `gnt-group del` and not `gnt-group remove` (the latter
being consistent with gnt-node and gnt-instance).

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

13 years agoGroup operations: OpCode and LU for renaming a group
Adeodato Simo [Thu, 2 Dec 2010 18:24:51 +0000 (18:24 +0000)]
Group operations: OpCode and LU for renaming a group

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

13 years agoGroup operations: OpCode and LU for removing a group
Adeodato Simo [Thu, 2 Dec 2010 18:24:40 +0000 (18:24 +0000)]
Group operations: OpCode and LU for removing a group

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

13 years agoGroup operations: OpCode and LU for adding a group
Adeodato Simo [Thu, 2 Dec 2010 18:23:37 +0000 (18:23 +0000)]
Group operations: OpCode and LU for adding a group

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

13 years agoExpose new node group attributes in CLI and RAPI
Adeodato Simo [Thu, 2 Dec 2010 16:56:36 +0000 (16:56 +0000)]
Expose new node group attributes in CLI and RAPI

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

13 years agoconfig.py, objects.py: more node group support
Adeodato Simo [Thu, 2 Dec 2010 16:34:53 +0000 (16:34 +0000)]
config.py, objects.py: more node group support

In particular:

  - add AddNodeGroup and RemoveNodeGroup in config.py

  - refactor _UpgradeConfig to make use of _UnlockedAddNodeGroup

  - add support for objects.NodeGroup in ConfigWriter.Update; add missing
    "serial_no" attribute to NodeGroup objects

  - update NodeGroup.UpgradeConfig to set mtime and serial_no if missing
    (the refactored code in _UpgradeConfig was not settting mtime nor ctime)

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

13 years agoAdding new OpCode for OOB
René Nussbaumer [Thu, 2 Dec 2010 13:50:57 +0000 (14:50 +0100)]
Adding new OpCode for OOB

Register OpCode and Logical Unit in mcpu.py

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

13 years agoAdding new Logical Unit for OOB
René Nussbaumer [Thu, 2 Dec 2010 13:51:12 +0000 (14:51 +0100)]
Adding new Logical Unit for OOB

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

13 years agocmdlib: Don't sort list of nodes if names are given
Michael Hanselmann [Mon, 6 Dec 2010 18:46:55 +0000 (19:46 +0100)]
cmdlib: Don't sort list of nodes if names are given

This makes _GetWantedNodes consistent wit _GetWantedInstances.

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

13 years agoutils: Add function to find duplicates in sequence
Michael Hanselmann [Wed, 1 Dec 2010 19:41:47 +0000 (20:41 +0100)]
utils: Add function to find duplicates in sequence

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

13 years agohv_kvm.py: fix some lint issues introduced in 4b784cf
Adeodato Simo [Mon, 6 Dec 2010 16:25:09 +0000 (16:25 +0000)]
hv_kvm.py: fix some lint issues introduced in 4b784cf

In particular:

  - break as couple lines that were longer than 80 characters
  - fix a couple "comma not followed by a space"
  - fix an unused variable warning

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

13 years agolocking: add nodegroup lock level
Guido Trotter [Wed, 27 Oct 2010 13:00:28 +0000 (14:00 +0100)]
locking: add nodegroup lock level

This also changes masterd to initialize the ganeti's manager with the
current list of nodegroup uuids, and updates unittests

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

13 years agoRemove bridge NIC slot
Guido Trotter [Mon, 6 Dec 2010 11:06:44 +0000 (12:06 +0100)]
Remove bridge NIC slot

This has been deprecated and unused since 2.1.

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

13 years agokvm: Improve network syntax and tests
Miguel Di Ciurcio Filho [Thu, 2 Dec 2010 16:00:10 +0000 (14:00 -0200)]
kvm: Improve network syntax and tests

The current syntax when defining a NIC uses a pair of arguments, like this:

-net tap,vlan=0 -net nic,vlan=0,model=virtio

When using this pair, internally KVM will create a VLANState structure to send
ethernet frames between the guest NIC and the host tap device. This is
suboptimal and is going to be removed in the future. Plus, this combination
breaks vhost-net support.

The new syntax does not need the vlan craziness anymore, creating a direct 1:1
relationship between the backend device and the frontend device.

-netdev tap,id=netdev0 -device virtio-net-pci,mac=52:54:00:56:6c:55,netdev=netdev0

The current code does not verify if vhost_net is available before starting an
instance. All this tests are done verifying the KVM version installed on the
node.

Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agokvm: Make _GetKVMVersion() return integers
Miguel Di Ciurcio Filho [Thu, 2 Dec 2010 16:00:09 +0000 (14:00 -0200)]
kvm: Make _GetKVMVersion() return integers

The current code returns the major, minor and rev portions of the version of
KVM as strings. Returning them as integers makes it easier to compare.

Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoMerge branch 'devel-2.3'
Michael Hanselmann [Thu, 2 Dec 2010 15:52:57 +0000 (16:52 +0100)]
Merge branch 'devel-2.3'

* devel-2.3:
  locking: Clarify message for removed locks
  Bump version for 2.3.1~rc1 release
  impexpd: Disable OpenSSL compression in socat if possible
  Bump version for 2.3.0

Conflicts:
NEWS: Trivial

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

13 years agoMerge branch 'stable-2.3' into devel-2.3
Michael Hanselmann [Thu, 2 Dec 2010 15:47:56 +0000 (16:47 +0100)]
Merge branch 'stable-2.3' into devel-2.3

* stable-2.3:
  Bump version for 2.3.1~rc1 release

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

13 years agoMake snapshots multi-vg aware
Iustin Pop [Thu, 2 Dec 2010 14:04:59 +0000 (14:04 +0000)]
Make snapshots multi-vg aware

Currently, the Snapshot() function of LogicalVolume returns only the
logical volume path, with the assumption that we only have one VG. But
with the recent changes, it makes more sense to return the full data (vg
and lv) from it, so as to not require computing it in the master.

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

13 years agoconfig.py: add error code to OpPrereqError
Adeodato Simo [Thu, 2 Dec 2010 15:01:58 +0000 (15:01 +0000)]
config.py: add error code to OpPrereqError

This adds a errors.ECODE_NOENT for OpPrereqError in LookupNodeGroup.

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

13 years agoconfig.py: replace "node group" with "nodegroup"
Adeodato Simo [Thu, 2 Dec 2010 15:01:57 +0000 (15:01 +0000)]
config.py: replace "node group" with "nodegroup"

Though code uses "nodegroup" as data member name, strings that will be
read by the user should use "node group" (with a space), since "nodegroup"
is not a word.

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

13 years agoMake rpc.call_lv_list() VG-aware
Dmitry Chernyak [Fri, 26 Nov 2010 19:57:00 +0000 (22:57 +0300)]
Make rpc.call_lv_list() VG-aware

Changes to backend.GetVolumeList():
- now accepts a list of VGs instead of one VG
- returns LV names in the form "vg_name/lv_name"

Corresponding changes are done in: VerifyDisks, VerifyNode,
LUCreateInstance (for both disk creation and adoption cases)

Now the syntax
"gnt-instance add ... --disk N:adopt=LV_NAME,vg=VG_NAME"
as was described earlier in the man page works.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
[iustin@google.com: QA changes for reserved LVs, style fixes and a few
 extra error checks, reviewed by hansmi/rn]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: fix typos in the docstring for LogicalUnit
Adeodato Simo [Thu, 2 Dec 2010 12:47:19 +0000 (12:47 +0000)]
cmdlib: fix typos in the docstring for LogicalUnit

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

13 years agoopcodes: document OP_DSC_FIELD in OpCode and OpCode.Summary()
Adeodato Simo [Thu, 2 Dec 2010 13:03:47 +0000 (13:03 +0000)]
opcodes: document OP_DSC_FIELD in OpCode and OpCode.Summary()

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

13 years agolocking: Clarify message for removed locks
Michael Hanselmann [Wed, 1 Dec 2010 17:33:27 +0000 (18:33 +0100)]
locking: Clarify message for removed locks

Just being told that a lock doesn't exist can be confusing. One case
were this happens is when a job (e.g. instance modify) waits for a job
removing the instance (e.g. export with remove).

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

13 years agoBump version for 2.3.1~rc1 release v2.3.1rc1
Michael Hanselmann [Wed, 1 Dec 2010 19:45:06 +0000 (20:45 +0100)]
Bump version for 2.3.1~rc1 release

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

13 years agoQuerying node groups: add QA tests
Adeodato Simo [Wed, 1 Dec 2010 17:25:59 +0000 (17:25 +0000)]
Querying node groups: add QA tests

This adds QA tests for both CLI and RAPI.

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

13 years agoQuerying node groups: RAPI support
Adeodato Simo [Wed, 1 Dec 2010 17:25:39 +0000 (17:25 +0000)]
Querying node groups: RAPI support

This implements /groups and /groups/%s RAPI end points.

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

13 years agoQuerying node groups: add client/gnt_group.py
Adeodato Simo [Wed, 1 Dec 2010 17:25:22 +0000 (17:25 +0000)]
Querying node groups: add client/gnt_group.py

This implements `gnt-group list`.

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

13 years agoQuerying node groups: add luxi.REQ_QUERY_GROUPS
Adeodato Simo [Tue, 30 Nov 2010 19:48:03 +0000 (19:48 +0000)]
Querying node groups: add luxi.REQ_QUERY_GROUPS

This also updates masterd.py.

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

13 years agoQuerying node groups: LU/Opcode
Adeodato Simo [Wed, 1 Dec 2010 17:24:50 +0000 (17:24 +0000)]
Querying node groups: LU/Opcode

This adds opcodes.OpQueryGroups and cmdlib.LUQueryGroups.

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

13 years agoimpexpd: Disable OpenSSL compression in socat if possible
Michael Hanselmann [Wed, 10 Nov 2010 18:43:01 +0000 (19:43 +0100)]
impexpd: Disable OpenSSL compression in socat if possible

This uses an option only available in patched socat versions. More
information is available from the INSTALL update included in this
patch.

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

13 years agoMerge branch 'stable-2.3' into devel-2.3
Michael Hanselmann [Wed, 1 Dec 2010 15:55:47 +0000 (16:55 +0100)]
Merge branch 'stable-2.3' into devel-2.3

* stable-2.3:
  Bump version for 2.3.0

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

13 years agoBump version for 2.3.0 v2.3.0
Michael Hanselmann [Wed, 1 Dec 2010 15:03:56 +0000 (16:03 +0100)]
Bump version for 2.3.0

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

13 years agoAdding RPC infrastructure to call oob
René Nussbaumer [Wed, 1 Dec 2010 10:16:14 +0000 (11:16 +0100)]
Adding RPC infrastructure to call oob

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

13 years agoAdding backend functionality to call oob helper
René Nussbaumer [Wed, 1 Dec 2010 10:08:47 +0000 (11:08 +0100)]
Adding backend functionality to call oob helper

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

13 years agoAdding ndparams to gnt-cluster init|modify and man page
René Nussbaumer [Tue, 30 Nov 2010 09:20:48 +0000 (10:20 +0100)]
Adding ndparams to gnt-cluster init|modify and man page

This is reverting the revert and adaption to fix the issue which caused
the revert

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

13 years agoMerge branch 'devel-2.3'
Michael Hanselmann [Wed, 1 Dec 2010 13:13:57 +0000 (14:13 +0100)]
Merge branch 'devel-2.3'

* devel-2.3:
  Correct version check for release candidates
  config.py: need explicit %-formatting in errors.OpPrereqError.
  Fix version check
  Add script to check version format

Conflicts:
Makefile.am

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

13 years agoMerge branch 'devel-2.2' into devel-2.3
Michael Hanselmann [Tue, 30 Nov 2010 18:26:46 +0000 (19:26 +0100)]
Merge branch 'devel-2.2' into devel-2.3

* devel-2.2:
  Correct version check for release candidates
  Fix version check
  Add script to check version format

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

13 years agoCorrect version check for release candidates
Michael Hanselmann [Tue, 30 Nov 2010 17:50:44 +0000 (18:50 +0100)]
Correct version check for release candidates

The tilde needs to be escaped and I forgot the space which should be
used instead.

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

13 years agoconfig.py: need explicit %-formatting in errors.OpPrereqError.
Adeodato Simo [Tue, 30 Nov 2010 16:05:47 +0000 (16:05 +0000)]
config.py: need explicit %-formatting in errors.OpPrereqError.

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

13 years agoTrivial style fixes
Adeodato Simo [Tue, 30 Nov 2010 15:01:25 +0000 (15:01 +0000)]
Trivial style fixes

Add missing closing brackets and fix a typo.

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

13 years agoFurther cleanups on QA
Iustin Pop [Mon, 29 Nov 2010 14:47:06 +0000 (14:47 +0000)]
Further cleanups on QA

This is more of an RFC. The patch attempts to address two issues:

- running conditional tests is ugly right now
- we don't know what tests we skipped

By using the new RunTestIf, we solve both. But a significant number of
test decisions are more complex than just “is test enabled”, so those
remain to be run via RunTest, which means we don't get logging of when
they're not run. Hence the logging is not complete… Sugesstions on how
to solve it are welcome.

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

13 years agoCheck for editor-specific settings at build time
Michael Hanselmann [Mon, 29 Nov 2010 18:54:29 +0000 (19:54 +0100)]
Check for editor-specific settings at build time

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

13 years agoRemove editor-specific settings from cfgupgrade*
Michael Hanselmann [Mon, 29 Nov 2010 18:55:14 +0000 (19:55 +0100)]
Remove editor-specific settings from cfgupgrade*

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

13 years agoAdd OpQuery opcode
Michael Hanselmann [Fri, 19 Nov 2010 20:32:19 +0000 (21:32 +0100)]
Add OpQuery opcode

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

13 years agoLUQueryNodes: Convert to new query model
Michael Hanselmann [Fri, 19 Nov 2010 20:25:51 +0000 (21:25 +0100)]
LUQueryNodes: Convert to new query model

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

13 years agocmdlib: Add base for query classes
Michael Hanselmann [Fri, 19 Nov 2010 20:26:04 +0000 (21:26 +0100)]
cmdlib: Add base for query classes

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