Michael Hanselmann [Wed, 20 Feb 2013 13:05:22 +0000 (14:05 +0100)]
Merge branch 'devel-2.7'
* devel-2.7:
NEWS: Fix the fix in commit 82b6f9a
NEWS: Fix release date for 2.7.0 beta1
Minor fixes regarding nic.network change
Fix issue 378
NEWS: Mention multi-alloc and fix typo
Add cfgupgrade for changing nic.network to uuid
Remove useless code in backend for network hooks
Show network name and not uuid in instance info
Add IQ_NETWORKS in query tests
Implement network locking in Instance queries
Changes in query to support nic.network as uuid
Modify query LUs to supoprt nic.network as uuid
Add GetInstanceNetworks() config method
cmdlib changes to support nic.network as uuid
Make network config methods take uuid as argument
Document possible hypervisor bug in serial_console
Update man pages wrt ExtStorage
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 20 Feb 2013 12:41:59 +0000 (13:41 +0100)]
NEWS: Fix the fix in commit 82b6f9a
February 2, 2013 was a Wednesday, not a Thursday.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Wed, 20 Feb 2013 11:43:47 +0000 (12:43 +0100)]
NEWS: Fix release date for 2.7.0 beta1
Commit
b6ad806f used a wrong date.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Thu, 14 Feb 2013 15:20:06 +0000 (16:20 +0100)]
Build table with access permissions for RAPI resources
Sometimes it can be difficult to determine the access permissions needed
for a certain RAPI resource without looking at code. This table, added
at the end of “rapi.rst”, shows all resources and the permissions needed
for their methods.
Another nice side-effect of this change is that there's an automatic
cross-checking between implemented resources and methods and the
documentation.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Tue, 12 Feb 2013 12:38:53 +0000 (13:38 +0100)]
Allow generating different RAPI resource lookup tables
Until now the RAPI resource table returned by
“rapi.connector.GetHandlers” always uses fixed strings or compiled
regular expressions as dictionary keys. Now that a table of all RAPI
resources (and their access rights) should be written for the
documentation, a plain string version of the URIs must be available. The
compiled pattern might contain escape sequences and is not suitable.
This patch changes “GetHandlers” to accept a hook function which is used
to translate non-static resource URIs such as “/2/jobs/[job_id]/wait”.
The default implemention retains the original behaviour by translating
to compiled regular expressions.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Fri, 15 Feb 2013 16:44:28 +0000 (17:44 +0100)]
HRoller design updates
- Specify that there will be options for selecting nodes by at least
nodegroups and tags, rather than just individually.
- Specify a better handling for non-redundant instances (eg. plain or
file) which today are simply ignored
- Specify that the rolling maintenance behavior is triggered by
instances being up, but also overridable
- Remove execution of rolling maintenances altogether, as it is deemed
unsafe in the current version, and move it to future work, discuss the
requirements that were pointed out for it to be safe.
Cosmetic:
- Fix numbered list, which were rendered incorrectly in the HTML version
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Dimitris Aragiorgis [Tue, 19 Feb 2013 16:28:42 +0000 (18:28 +0200)]
Minor fixes regarding nic.network change
Make LookupNetwork() return None in case target is None. This fixes
Issue 380. Rapi passes network=None and the lookup should not fail.
Make network client aware of new nic.network.gnt-network info shows
the IPs of each instance inside the network. It parses nic.networks
field of QueryInstances() output, which now is a list of uuids an
not names.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Thu, 14 Feb 2013 16:44:25 +0000 (17:44 +0100)]
baserlib: Make "_OPCODE_ATTRS" public
"_OPCODE_ATTRS" will also be used in the Sphinx extension.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 14 Feb 2013 16:10:41 +0000 (17:10 +0100)]
Makefile: Add dependencies
The RAPI documentation now depends on “connector.py” (handler
registration) and “rlib2.py” (access permissions).
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 14 Feb 2013 15:19:45 +0000 (16:19 +0100)]
RAPI documentation: Add link targets
A newly added table of RAPI access permissions will link to all
resources and their supported methods. For this reason link targets need
to be added.
The GET method on “/2/nodes/[node_name]” was not separately mentioned.
This is also fixed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Dimitris Aragiorgis [Tue, 19 Feb 2013 14:45:30 +0000 (16:45 +0200)]
Fix issue 378
In case a NIC is not inside a network then netinfo None. Thus
netinfo["name"] fails.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Wed, 13 Feb 2013 12:43:33 +0000 (13:43 +0100)]
Helper to retrieve access permissions for RAPI resource
Merge similar code into a helper function.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 14 Feb 2013 15:17:52 +0000 (16:17 +0100)]
Sphinx extension: Module-level constant for tab width
Use a module-level constant for the tab width.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Michael Hanselmann [Thu, 14 Feb 2013 15:38:10 +0000 (16:38 +0100)]
RAPI documentation: Assertion for console fields
Assert that the documented fields are equal to those in the actual
object.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michele Tartara [Tue, 12 Feb 2013 09:21:03 +0000 (09:21 +0000)]
Status change reason support for Reboot
Add support to the Reboot command for specifying the reason for the last
status change.
Some features are implemented as functions, even if used only once, because
they will be used by the future patches introducing reason support for all
the others commands able to alter the state of instances.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michele Tartara [Tue, 12 Feb 2013 09:15:46 +0000 (09:15 +0000)]
Infrastructure for specifying instance status change reason
This patch introduces some infrastructural modifications that will be used by
the following commits to implement the support for specifying the reason for
the last status change of an instance.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 14 Feb 2013 15:55:07 +0000 (16:55 +0100)]
NEWS: Mention multi-alloc and fix typo
As far as I could see, the ability to allocate multiple instances via
RAPI was not mentioned at all. A superfluous word is also removed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Thu, 7 Feb 2013 17:30:04 +0000 (18:30 +0100)]
Unit tests for Query/Network.hs
This patch adds a couple of unit tests for Query/Network.hs.
Note that they'll need to be adapted, once issue 362 is addressed.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Tue, 5 Feb 2013 09:43:16 +0000 (09:43 +0000)]
Make Confd client usable for testing
Allow the Confd client to be able to connect to an arbitrary server
instead of just the real one running on a cluster.
This is meant to be used for testing.
If a data collector using the Confd client is tested with shelltest, it will
need to receive through the CLI the address and port of the server, and also the
FQDN for which information is being requested. In normal usage it will likely be
the name of the node the data collector is running on, but for testing we need a
way to explicitly specify it so that it corresponds to the one used inside the
configuration files that the test confd server is reading.
So, optConfdAddr and optConfdPort and optNode are provided by this patch, even
if not used, because they are an important part of the modifications for making
the Confd client testable.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Wed, 6 Feb 2013 08:24:49 +0000 (09:24 +0100)]
Add Haskell parser for "xm uptime"
In order to fetch precise information about the uptime of the VMs
running in Xen, we need to analyze the output of the "xm uptime" command.
This commit adds the parser to do that, and its tests.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Fri, 18 Jan 2013 10:10:47 +0000 (11:10 +0100)]
Add Haskell parser for "xm list --long"
In order to fetch precise information about the status of the VMs running in
Xen, we need to analyze the output of the "xm list --long" command.
This commit adds the parser to do that, and its tests.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Thu, 10 Jan 2013 08:22:57 +0000 (09:22 +0100)]
Add request type to Confd server for getting instance list
Add to Confd server a new request type (and its implementation) to ask for
the list of instances in a node.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Thu, 10 Jan 2013 13:19:34 +0000 (14:19 +0100)]
Update monitoring agent report format
This commit expands the monitoring agent design document improving the
description of the general report file format.
There can be two kinds of data collectors (performance and status collectors).
Every collector can now be part of a category of collectors (such as
storage, instance, daemon, hypervisor, etc.) that defines a minimum basic
structure that has to be common to all the collectors part of the same class.
Also, such basic structure is defined for all the currently envisioned class
of collectors.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:40 +0000 (15:19 +0200)]
Add cfgupgrade for changing nic.network to uuid
This gets all network info from config_data and parses
all instances and their NICs and makes the substitution.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:39 +0000 (15:19 +0200)]
Remove useless code in backend for network hooks
In backend NICs arrive with netinfo filled. If nic.network is not None
nic.netinfo is not too. Thus all the info is derived from HooksDict()
and nic.network must not be checked.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:38 +0000 (15:19 +0200)]
Show network name and not uuid in instance info
This was before the case too. Now is bit trickier because nic.network
is uuid. Info must derive from nic.netinfo.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:37 +0000 (15:19 +0200)]
Add IQ_NETWORKS in query tests
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:36 +0000 (15:19 +0200)]
Implement network locking in Instance queries
This is needed in case more info than each nic's network uuid is to
be returned. We need to lock networks to get valid data. For now
only the name is returned as an extra field. All other can be added
with trivial effort.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:35 +0000 (15:19 +0200)]
Changes in query to support nic.network as uuid
Queries now return the network uuid as well as it's name. Here we
only use info provided be LUInstanceQueryData context.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:34 +0000 (15:19 +0200)]
Modify query LUs to supoprt nic.network as uuid
Make _InstanceQuery gather all network info related to instance's
NICs and in case of NETQ_INST in _NetworkQuery get all network
uuids directly from nic.network
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:33 +0000 (15:19 +0200)]
Add GetInstanceNetworks() config method
This will be needed for Instance Queries. It walks through the
instance's NICs and returns a list network uuids that the NICs
are attached to.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:32 +0000 (15:19 +0200)]
cmdlib changes to support nic.network as uuid
Refactor Instance related LUs to support nic.network as
a uuid. This removes all the unnecessary invocations to
LookupNetwork().
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dimitris Aragiorgis [Sat, 16 Feb 2013 13:19:31 +0000 (15:19 +0200)]
Make network config methods take uuid as argument
This will be needed in the following patches where nic.network
will refer to network's uuid and not name.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Guido Trotter [Fri, 15 Feb 2013 14:39:06 +0000 (15:39 +0100)]
Document possible hypervisor bug in serial_console
This is described in Issue 83.
Update both the install guide and the gnt-instance manpage.
In the install guide move another KVM specific example inside a new KVM
admonition for the hypervisor parameters section.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Constantinos Venetsanopoulos [Thu, 14 Feb 2013 14:38:52 +0000 (16:38 +0200)]
Update man pages wrt ExtStorage
* ganeti-extstorage-interface: add examples
* gnt-instance: document the “ext” template
* remove a few double spaces
Also link to its design doc in the design-2.7 doc
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Wed, 15 Aug 2012 15:50:30 +0000 (16:50 +0100)]
Design correct reporting of storage free space
This is a long standing bug in Ganeti. Add a small design on how we plan
to fix this for Ganeti 2.7.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Iustin Pop [Fri, 15 Feb 2013 11:53:30 +0000 (12:53 +0100)]
Merge branch 'devel-2.7'
* devel-2.7:
Rename lib/objectutils to outils.py
Fix typo in gnt-group manpage
Fix wrong type in a docstring of the RAPI subsystem
Finish the remote→restricted commands rename
Enable use of the priority option in hbal
Add CLI-level option to override the priority
Add functions to parse CLI-level format of priorities
Add a function to change an OpCode's priority
Make hbal opcode annotation more generic
Add unit tests for RADOSBLockDevice
Fix rbd showmapped output parsing
Change default xen root path to /dev/xvda1
Removes check for conflicts from NetworkDisconnect
If _UnlockedLookupNetwork() fails raise error
Force conflicts check in LUNetworkDisconnect
Also updated objects.py with more outils renames.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 14 Feb 2013 12:39:18 +0000 (13:39 +0100)]
Revert "Disable live-RPC queries under split query"
This reverts commit
fb251c2c4c582ec0d6c00a6f6c5e134ed5196e03. On the
master branch we want to continue to have them enabled.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Iustin Pop [Fri, 15 Feb 2013 09:29:47 +0000 (10:29 +0100)]
Rename lib/objectutils to outils.py
Back when this was introduced, I mentioned that it breaks heavily tab
completion (ob<TAB> doesn't work anymore), but at that moment I didn't
have a suggestion what to name it. I think outils is good and short
enough, and doesn't conflict with anything else, so here it goes.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Guido Trotter [Fri, 15 Feb 2013 09:32:10 +0000 (10:32 +0100)]
Add hroller design to Makefile and design-drafts
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 8 Feb 2013 13:24:17 +0000 (14:24 +0100)]
Hroller design doc
Hroller in 2.7 was implemented (as an experiment) but never explicitly
designed. This design mentions the current functionality, and explains
the changes that will happen for the next release to support live
maintenance scheduling (rolling reboot).
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Ben Lipton [Wed, 13 Feb 2013 17:21:07 +0000 (12:21 -0500)]
Fix typo in gnt-group manpage
The --ipol-disk-templates parameter should actually be
--ipolicy-disk-templates.
Signed-off-by: Ben Lipton <ben.lipton@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michele Tartara [Tue, 12 Feb 2013 15:40:16 +0000 (15:40 +0000)]
Fix wrong type in a docstring of the RAPI subsystem
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 16:43:34 +0000 (17:43 +0100)]
QA: Set disk template directly via instance object
Use a method on the instance object instead of going through
“qa_config.GetInstanceTemplate”. This provides for better encapsulation.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 16:33:39 +0000 (17:33 +0100)]
Remove qa_config.GetInstanceNicMac
Call the wrapped instance method directly.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 16:31:12 +0000 (17:31 +0100)]
QA: Use constants for disk templates
Disk template names shouldn't be hardcoded.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Bernardo Dal Seno [Tue, 12 Feb 2013 13:53:44 +0000 (14:53 +0100)]
Fix a merge issue in
3c296f56
Lines removed in devel-2.7 (
250a9404) weren't removed in the merge with
master.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 8 Feb 2013 13:42:36 +0000 (14:42 +0100)]
Finish the remote→restricted commands rename
The documentation still points to /etc/ganeti/remote-commands,
although the code is already using restricted-command. Update the
documentation and a few docstrings accordingly.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 8 Feb 2013 12:43:01 +0000 (13:43 +0100)]
Enable use of the priority option in hbal
This patch adds the option to hbal, and uses it to tweak the submitted
jobs. There are also two small shelltests for testing the parsing.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 8 Feb 2013 12:23:50 +0000 (13:23 +0100)]
Add CLI-level option to override the priority
This just defined the new priority, with the same name as the Python one.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 8 Feb 2013 12:14:26 +0000 (13:14 +0100)]
Add functions to parse CLI-level format of priorities
The current serialisation format for submit priorities is
integer-based, same as the opcode json serialisation. But for CLI
level, we need to support a string-based format, so we add functions
to parse and format this representation.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 8 Feb 2013 11:22:24 +0000 (12:22 +0100)]
Add a function to change an OpCode's priority
This simply updates the metaopcode submit priority.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 8 Feb 2013 11:12:56 +0000 (12:12 +0100)]
Make hbal opcode annotation more generic
Currently, hbal code always uses annotateOpCode function, which means
we would have to pass the options data to all function in the call
chain if we wanted to make this more flexible.
By abstracting the type of the annotator and passing it as an argument
to the function, we can be more flexible.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Stratos Psomadakis [Tue, 12 Feb 2013 12:07:13 +0000 (14:07 +0200)]
Add unit tests for RADOSBLockDevice
Add unit tests for the RADOSBlockDevice JSON output parsing function,
and modify the unit tests for the plain output parsing function to
work with the new code.
Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Stratos Psomadakis [Fri, 8 Feb 2013 16:36:34 +0000 (18:36 +0200)]
Fix rbd showmapped output parsing
'rbd showmapped' output formatting differs between older and newer versions of
the ceph tools. Try to use json output formatting if available (currently
available only in the ceph master branch). For bobtail, argonaut and older
releases fallback to manually parsing the 'rbd showmapped' output, handling the
differences in the output format for each rbd version correctly.
Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Tue, 12 Feb 2013 09:39:16 +0000 (10:39 +0100)]
Change default xen root path to /dev/xvda1
All recent-enough versions of linux see the xen paravirtual device as
/dev/xvd*.
This doesn't break old installations, as the default is only used on new
clusters.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Helga Velroyen [Wed, 30 Jan 2013 16:56:20 +0000 (16:56 +0000)]
Removes check for conflicts from NetworkDisconnect
This removes the check for conflicts from the Haskell
version of the OpCode NetworkDisconnect. This alignes
the Haskell code with the patch
"Force conflicts check in LUNetworkDisconnect" (which
is currently under review). I will submit these patches
together then.
This is a cherry-pick of commit 0ae4b35.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Helga Velroyen [Wed, 30 Jan 2013 16:35:10 +0000 (17:35 +0100)]
If _UnlockedLookupNetwork() fails raise error
Make _UnlockedLookupNetwork() raise OpPrereqError (instead of returning
None) in case it does not find the requested network. Remove useless and
duplicate code such as:
if net_uuid is None:
raise...
This is a cherry-pick of commit 1cce2c4.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Helga Velroyen [Wed, 30 Jan 2013 16:12:26 +0000 (17:12 +0100)]
Force conflicts check in LUNetworkDisconnect
Until now if one disconnects a network with --no-conflicts-check
and then remove it, there is a possibility to leave instances with NICs
referencing non-existing networks. This causes network queries,
instance removal and modification to fail.
This patch allows a network to be disconnected from a nodegroup,
only if instances residing in the nodegroup do not have NICs attached
to the network. Otherwise OpPrereqError is raised. The
--no-conflicts-check option is removed from the gnt-network disconnect
command as well.
This is a cherry-pick of commit 6bb939a.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Michael Hanselmann [Tue, 12 Feb 2013 12:43:12 +0000 (13:43 +0100)]
Merge branch 'devel-2.7'
* devel-2.7: (23 commits)
QA: Support additional arguments for initialization
qa_utils: Fix order of arguments passed to _AssertRetCode
Improve reporting on errors.AddressPoolError exceptions
Add note about lv-tags rename
Make use of HooksDict() for networks
Remove family and size from network objects
Remove network_type slot (Issue 363)
Moved uniformity check for exclusive_storage flag
"exclusive_storage" cannot be changed on single nodes
Upgrades made on loading the configuration are always saved
Show correct daemon name on Luxi connect errors
Update the security document for Ganeti 2.7
OS environment: add network information
ConfigData: run UpgradeConfig on network objects
Make ParticalNic's network field of type String
Make gnt-os list work with no OSes
Fix OCF files installation in devel/upload
baserlib: Fix two mistakes in docstring
Workaround hlint behaviour with no warnings/errors
Remove use of 'head' and add hlint warning for it
...
Conflicts:
qa/qa_cluster.py: Trivial
qa/qa_node.py: Node attributes
src/Ganeti/Types.hs: Network cleanup
test/hs/Test/Ganeti/Objects.hs: Network cleanup
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Thu, 7 Feb 2013 13:15:36 +0000 (14:15 +0100)]
QA: Support additional arguments for initialization
In some scenarios it can be useful to add more arguments to “gnt-cluster
init”, such as “--no-drbd-storage”, if DRBD is not installed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 7 Feb 2013 12:09:42 +0000 (13:09 +0100)]
qa_utils: Fix order of arguments passed to _AssertRetCode
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Tue, 12 Feb 2013 11:17:21 +0000 (12:17 +0100)]
Improve reporting on errors.AddressPoolError exceptions
This patch improves the error messages given when a
“errors.AddressPoolError” exception is caught. Includes some small style
fixes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 12 Feb 2013 09:04:21 +0000 (10:04 +0100)]
Add note about lv-tags rename
This is not included on the 2.6 branch, so update the NEWS for 2.7.0 beta1.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Dimitris Aragiorgis [Mon, 11 Feb 2013 12:42:38 +0000 (14:42 +0200)]
Make use of HooksDict() for networks
This can be used in hypervisor code as well. For consistency
export *NETWORK_NAME and not *NETWORK throughout the code.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Dimitris Aragiorgis [Mon, 11 Feb 2013 12:42:36 +0000 (14:42 +0200)]
Remove family and size from network objects
This info is not used by Ganeti and therefore is removed.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Dimitris Aragiorgis [Mon, 11 Feb 2013 12:42:34 +0000 (14:42 +0200)]
Remove network_type slot (Issue 363)
This slot was not used by Ganeti so the same info can be
provided via tags. In order not to break configuration data
we add a FromDict() method in Network config object that
removes the deprecated network_type (if found) and then invoke
the parent's method (which does the validation).
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 15:42:09 +0000 (16:42 +0100)]
QA: Remove dictionary-like interface from config objects
These are no longer used.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 15:32:30 +0000 (16:32 +0100)]
QA: Drop dictionary support from qa_utils._GetName
This is no longer needed now that instance/node objects in QA have
attributes. Use a helper function instead to retrieve an entity's
identifying attribute.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 15:34:36 +0000 (16:34 +0100)]
QA: Convert instances from items to attributes
The new objects support attributes. Item access (like a dictionary) is
going away in a couple of patches.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 15:30:42 +0000 (16:30 +0100)]
QA: Convert nodes from items to attributes
The new objects support attributes, which are cleaner than
dictionary-style access. Item access (like a dictionary) is going away
in a couple of patches. Also, pylint is better at checking attributes
than dictionary entries.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 15:18:54 +0000 (16:18 +0100)]
QA: Release nodes through method
Instead of having a module-level function in “qa_config” to release a
node, a new method on node objects is used.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Bernardo Dal Seno [Fri, 1 Feb 2013 15:31:43 +0000 (16:31 +0100)]
Moved uniformity check for exclusive_storage flag
Cluster-verify used to check that the value of exclusive_storage is uniform
within node groups. Now, it's impossible to change the flag for a single
node, so that check has been removed and an equivalent one has been added
in ConfigWriter.VerifyConfig(). Unit test provided. The unit test covers
only the new check, not the whole VerifyConfig method.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Fri, 1 Feb 2013 14:46:54 +0000 (15:46 +0100)]
"exclusive_storage" cannot be changed on single nodes
There's never been support for a configuration where nodes in the same node
group have different values of the exclusive_storage flag. This patch
disables the possibility to change the flag for individual nodes.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Wed, 6 Feb 2013 13:52:30 +0000 (14:52 +0100)]
Upgrades made on loading the configuration are always saved
Before, only some upgrades were written back to the configuration file. A
little refactoring of _UpgradeConfig() has been done to write unit tests.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 14:20:16 +0000 (15:20 +0100)]
QA: Convert nodes to objects
Up until now nodes were stored as a dictionary. The keys were hardcoded
in a lot of places and entries modified directly.
This patch introduces a new class for nodes in QA named “_QaNode”. It
still supports accessing details via dictionary syntax, but that will be
removed after a couple of patches changing all users. Unit tests for
“qa_config.AcquireNode” are also included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Iustin Pop [Fri, 8 Feb 2013 15:51:25 +0000 (16:51 +0100)]
Show correct daemon name on Luxi connect errors
Since now confd also serves a Luxi endpoint, the current message in
cli.FormatError is misleading when actually failing to connect to
it. The patch adds a somewhat hackish way to show the right daemon
name.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 8 Feb 2013 14:47:07 +0000 (15:47 +0100)]
Update the security document for Ganeti 2.7
This should address 359, but I'm not sure if it covers all of 2.7…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 14:10:28 +0000 (15:10 +0100)]
QA: Release instances through method
Instead of having a module-level function in “qa_config” to release an
instance, a new method on instance objects is used.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 14:07:08 +0000 (15:07 +0100)]
QA: Convert instances to objects
Up until now instances were stored as a dictionary. The keys were
hardcoded in a lot of places and entries modified directly.
This patch introduces a new class for instances in QA named
“_QaInstance”. It still supports accessing details via dictionary
syntax, but that will be removed after a couple of patches changing all
users. Unit tests for “qa_config.AcquireInstance” are also included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Wed, 6 Feb 2013 10:51:38 +0000 (11:51 +0100)]
QA: Release instance in ganeti-qa
Release instances directly from “ganeti-qa” instead of doing so in the
three tests removing instances. This is in line with how nodes are
released and makes it easier to find and debug double-release issues.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 15:40:48 +0000 (16:40 +0100)]
QA: Stop using "in" operator for node
The new configuration object for nodes will not support it anymore.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 15:22:42 +0000 (16:22 +0100)]
QA: Support entity objects in qa_utils._GetName
This is a temporary solution until nodes and instances are converted to
objects with attributes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 12:51:30 +0000 (13:51 +0100)]
qa_config: Simplify IsTemplateSupported
The same code can be written in a single expression. The earlier patch
named “Refactor storage of runtime exclusive storage flag in QA”
provided the unit test.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Tue, 5 Feb 2013 12:48:25 +0000 (13:48 +0100)]
Refactor storage of runtime exclusive storage flag in QA
This is a follow-up for “qa_config: Remove exclusive storage flag from
config”. Instead of storing the flag in a module-level variable it is
now stored within the new QA configuration class and unit tests are
provided. Wrappers in “qa_config” maintain the existing interface.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Mon, 4 Feb 2013 15:06:23 +0000 (16:06 +0100)]
Refactor QA configuration code
Ever since its introduction (sometime before commit cec9845 in September
2007), the QA configuration was stored in a dictionary at module-level
in “qa/qa_config.py”. The configuration was loaded, verified and
evaluated using module-level functions. Since then the configuration has
become more complicated and more functionality has been added. This
patch refactors handling the configuration to use a class and provides
unittests.
- The configuration is loaded through a class method which also verifies
it for consistency
- Wrapper methods are provided in “qa_config” to not change the
interface
- Unit tests are provided for the new configuration class
- The configuration object is still stored in a module-level variable
and can be retrieved using “GetConfig” (direct access should be
avoided so an uninitialized configuration can be detected)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Mon, 4 Feb 2013 16:05:29 +0000 (17:05 +0100)]
qa_config: Remove exclusive storage flag from config
Commit 6a0f22e added the ability to track the status of the cluster-wide
flag for exclusive storage. It did so in a way which modifies the
in-memory configuration dictionary. This patch changes the code to use a
plain global variable as a temporary solution until a configuration
object is added.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Guido Trotter [Thu, 7 Feb 2013 13:30:38 +0000 (14:30 +0100)]
OS environment: add network information
1) Move the hooks environment dict generator inside the object. This
also adds missing values such as network family and uuid.
2) Use the same generator both for the os environment and for the
instance hooks.
3) Update manpage and hooks documentation.
Also update a forgotten docstring about a tuple's content.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 8 Feb 2013 07:44:48 +0000 (08:44 +0100)]
ConfigData: run UpgradeConfig on network objects
Although this does nothing for now, running it is safe, and consistent
with how other objects behave.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 7 Feb 2013 14:47:48 +0000 (15:47 +0100)]
Make ParticalNic's network field of type String
This was applied to "master" along with extra changes affecting the
master branch only. Cherry-picking just the Objects.hs change.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 8 Feb 2013 09:47:04 +0000 (10:47 +0100)]
Make gnt-os list work with no OSes
When absolutely no OSes are present on the cluster, the result of
OpOsDiagnose is an empty list. This is currently handled in gnt-os as
an error condition, probably due to how OpOsDiagnose used to return
errors in the past.
However, with the query backend, an empty list is a reasonable answer,
so I see no reason why gnt-os should treat that as an error,
especially as it doesn't give any hint of what is "wrong". Simply
removing that code block allows it to proceed normally, and list no
OSes.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 8 Feb 2013 09:34:45 +0000 (10:34 +0100)]
Fix OCF files installation in devel/upload
LIBDIR was not defined, so the files ended up directly under /, not
good. Now they're properly installed under /usr/lib/ocf, as per
http://linux-ha.org/wiki/OCF_Resource_Agents.
Also add "set -u" to prevent future occurrences of this kind of bug.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Fri, 8 Feb 2013 09:52:26 +0000 (10:52 +0100)]
baserlib: Fix two mistakes in docstring
The method names were wrong due to copy & paste.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 7 Feb 2013 12:12:53 +0000 (13:12 +0100)]
vcluster: Make _MakeNodeRoot public
The QA code will also have to generate virtual paths and this function
comes in handy.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Iustin Pop [Thu, 7 Feb 2013 13:32:49 +0000 (14:32 +0100)]
Workaround hlint behaviour with no warnings/errors
When hlint sees a perfectly nice code tree, it will skip generating
the reports (both stdout and html). This means that usually the old
report will remain in place, so it makes development harder, as the
html file is out of sync with the tree.
To workaround this, we generate an empty/minimal file in this case.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 7 Feb 2013 13:22:01 +0000 (14:22 +0100)]
Remove use of 'head' and add hlint warning for it
Since 'head' is unsafe to use in most cases, this patch removes its
use from most of the code, adds a lint warning for it (and for tail as
well), and adds override annotations in the few cases where it's
actually OK to use it (mainly when using head over the result of
functions which guarantee to return a non-empty list by documentation,
not type).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dato Simó [Wed, 6 Feb 2013 20:01:54 +0000 (20:01 +0000)]
Harep.hs: fix a couple typos in comments and docstrings
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 7 Feb 2013 11:01:22 +0000 (12:01 +0100)]
hv_kvm: Error messages, punctuation, other style fixes
- Capitalize acronyms such as “QMP” or “SPICE”
- Remove punctuation from error messages
- Improve error reporting when sending a monitor command failed
- Put “or” at end of line
- Fix indentation for a concatenated string
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 7 Feb 2013 10:44:57 +0000 (11:44 +0100)]
hv_kvm: Add TODO regarding monitor commands
Monitor calls should be replaced with QMP once KVM >= 0.14 is required.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Wed, 6 Feb 2013 13:11:35 +0000 (14:11 +0100)]
Add release date for 2.7.0 beta1
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>