Helga Velroyen [Fri, 26 Apr 2013 13:59:33 +0000 (15:59 +0200)]
Make DEFAULT_ENABLED_DISK_TEMPLATES a list
This patch makes the constant DEFAULT_ENABLED_DISK_TEMPLATES
a list instead of a set, because the order of the elements actually matters
as the first one is planned to be the default disk template for instance
creation. Also, this constant is always used like a list and thus providing it
as a set complicates the code that uses it.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Fri, 12 Apr 2013 20:21:08 +0000 (22:21 +0200)]
Document the --drbd-usermode-helper in man gnt-cluster
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Helga Velroyen [Fri, 12 Apr 2013 20:24:05 +0000 (22:24 +0200)]
NEWS: removal of --no-lvm-storage
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Helga Velroyen [Fri, 12 Apr 2013 20:15:35 +0000 (22:15 +0200)]
Remove '--no-lvm-storage' from 'gnt-cluster' man page
This updates the man page of 'gnt-cluster' regarding the
removal of the '--no-lvm-storage'.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Helga Velroyen [Fri, 26 Apr 2013 14:07:09 +0000 (16:07 +0200)]
Fix lint error in cmdlib
Was accidentally introduced by commit
912737ba.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Tue, 2 Apr 2013 11:16:46 +0000 (13:16 +0200)]
gnt-cluster modify/init: deprecate --no-lvm-storage
This patch does three things:
1. It deprecates the option '--no-lvm-storage' of 'gnt-cluster modify'
and 'gnt-cluster init'. Technically, it is not fully removed, but kept in order
to warn the user that it is no longer supported and that she should use
--enabled-disk-templates instead.
2. The consistency check between '--no-lvm-storage' and '--vg-name' is replaced
by checks between '--enabled-disk-templates' and '--vg-name'. There are these
cases:
- vg name, lvm disk template enabled = ok
- no vg name, lvm disk template enabled = error
- vg name, no lvm enabled = warning
- no vg name, no lvm enabled = ok
I added quite a lot of tests for all these and the transitions from each case
to another to the QA.
3. The check whether or not the volume group is available on all nodes is now
done only in these cases:
- the volume group name gets set and lvm is already enabled
- lvm is getting enabled and the volume group was set before
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Tue, 2 Apr 2013 13:20:47 +0000 (15:20 +0200)]
Utility functions for storage
This patch add a couple of utility functions dealing with
storage types and disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 23 Apr 2013 12:04:23 +0000 (14:04 +0200)]
Extract DRBD-related classes into block/drbd.py
This is in preparation to introducing support for DRBD8.4.
base.py had to be extracted as well in order to avoid cylic imports
between bdev.py and drbd.py. It now contains the BlockDev class and
utility functions needed by bdev.py and drbd.py.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 23 Apr 2013 12:04:22 +0000 (14:04 +0200)]
Move lib/bdev.py to lib/block/bdev.py
That's in preparation of extracting DRBD related code from bdev.py. As
bdev.py is already rather long, new features will require to split it
into more manageable pieces. That's why it's moved in an own directory.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Michele Tartara [Tue, 23 Apr 2013 08:42:03 +0000 (08:42 +0000)]
Make burnin compatible with the reason trail
The burnin uses its own option list, different from the one of all other
command line programs, and uses it as a parameter to a function that now
requires the "--reason" option to be present.
This commit updates the burnin option list to be compatible with the reason
trail implementation.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Mon, 22 Apr 2013 11:50:26 +0000 (13:50 +0200)]
Extend the simulation backend to also simulate a master node
In a simulated cluster as created by the simulation backend to
the htools, make the first node of the first node group the master
node. In this way, hools (like hroller) that require a master node
can also be used on simulated clusters, e.g., for testing.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Mon, 22 Apr 2013 11:09:06 +0000 (13:09 +0200)]
Add unit tests for hroller
Add a unit test for hroller in a situation where the order
is completely determined. There are 3 nodes where node 2 has,
for each of the other nodes, an instanced shared with it. So
node 2 has to be a reboot group of its own. There are no more
instances, hence, my minimality, the other two nodes have to
form a single group. Node 1 is the master, and hence has to
be rebooted last; this determines the order.
Also add a unit test verifying that hroller rejects configurations
with multiple master nodes, even if the option --force is given.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Fri, 19 Apr 2013 12:58:43 +0000 (14:58 +0200)]
Extend Text format by marking the master node
Sometimes, e.g., for hroller, it is necessary to know which node
is the master node. Therefore this information has to be included
in the text format as well. Since we never use an offline node as
master node, we can put this information can be put in the "is
offline" field; as old versions only check this field for equality
to "Y", using "M" to indicate the master is compatible in both
directions. This also leaves room to add more roles in the future,
should we need them.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Sebastian Gebhard [Mon, 22 Apr 2013 15:28:57 +0000 (17:28 +0200)]
Minor changes / bugfixes in documentation
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Michele Tartara [Fri, 22 Mar 2013 18:31:56 +0000 (19:31 +0100)]
Reason trail implementation for instance reboot
This commits allows ganeti to correctly forward the reason trail information
regarding instance reboot.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Tue, 26 Mar 2013 09:27:37 +0000 (10:27 +0100)]
Add "reason" as a common parameter for all the RAPI calls
Also, this add an infrastructure for having parameters common to all the
RAPI calls.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Tue, 26 Mar 2013 09:33:21 +0000 (10:33 +0100)]
Add infrastructure for adding common RAPI parameters
Some parameters can be common to all the RAPI calls: this commit
adds the possibility of specifying them just once, instead of
manually adding them to the classes describing each call.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Tue, 26 Mar 2013 08:54:03 +0000 (09:54 +0100)]
Add job_id and index to the reason trail
The reason trail will contain an item indicating the job_id and the
index number of the current opcode inside the job queue.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Tue, 26 Mar 2013 12:58:53 +0000 (13:58 +0100)]
Add the reason trail to the opcodes
The reason trail is available for all the opcodes, and as such it is
initialized as a generic option.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 17:24:51 +0000 (18:24 +0100)]
Add a field to store the reason trail in OpCodes
The reason trail will be available for all the OpCodes, so the field that
is to contain it has to be added to the OpCode base class.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 17:19:38 +0000 (18:19 +0100)]
Provide "--reason" as a parameter for all commands
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 15:51:07 +0000 (16:51 +0100)]
Add function for extending the reason trail
Noded functions will have to extend the reason trail specifying what
operation is being executed.
This commit adds a function for doing that (will be used by future commits).
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 15:14:41 +0000 (16:14 +0100)]
Add an opcode name conversion function
Add a function to convert an opcode class name to a source string for the
reason trail, factoring out the code in common with the existing _NameToId
function.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 15:00:25 +0000 (16:00 +0100)]
Add function for storing the reason trail of an instance
We are interested in storing the reason trail for operations that changed
the state of instances. This commit adds a function to do this.
Also, the GetInstReasonFilename() function name is prepended with an
underscore because it is only used in this file.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 14:21:06 +0000 (15:21 +0100)]
Add function for getting the timestamp in nanoseconds
The timestamp is returned as an integer number of nanoseconds since the Unix
epoch.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 14:15:26 +0000 (15:15 +0100)]
Add TMaybeList as a new type for parameters
This will be used as the type for the reason trail parameter.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 14:11:31 +0000 (15:11 +0100)]
Add constants for the reason trail implementation
A few constants are required, describing the source reason of the opcode.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 25 Mar 2013 13:55:31 +0000 (13:55 +0000)]
Remove old "reason" implementation
Remove the useless parts of the old, partial, implementation of the support for
tracking the reason of instances state change, before implementing the new
reason trail support, as per the design document.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Fri, 22 Mar 2013 18:26:34 +0000 (19:26 +0100)]
More specifics on the implementation of the reason trail
Adding the reason trail as a parameter instead of as a new class attribute fits
better with the current structure of the system.
Also, the description of what part of the implementation will be OpCode
specific and which will be shared is added.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Mon, 22 Apr 2013 09:22:25 +0000 (09:22 +0000)]
Add monitoring daemon user to user creation script
The script was added to Ganeti before the monitoring daemon, so it
did not include that user yet.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Klaus Aehlig [Mon, 22 Apr 2013 09:08:29 +0000 (11:08 +0200)]
devel/review: fix addition of reviewer from environment
In commit 3dd990, the possibility of taking a default reviewer
from the environment was introduced. Fix two deficits here
- perl does not inherit the environment
- add at all places.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Fri, 19 Apr 2013 12:39:28 +0000 (14:39 +0200)]
QA: Skip RAPI setup when RAPI is disabled
This is similar to
405692ef, reverted in
aeefb4cd.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Thu, 18 Apr 2013 12:53:45 +0000 (14:53 +0200)]
Make hroller insist on finding precisely one master node
As people rely on the master node being the last node of the last
group, make hroller fail, if no master node could be found in the
cluster. This happens, e.g., if a backend format is used that does not
contain information about the master node. The error can be turned
into a warning by using the --force option.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Wed, 17 Apr 2013 11:13:17 +0000 (13:13 +0200)]
Update hroller man page: master node is last
Where the information is available, hroller now schedules the
master node as the last node in the last group. Update the man
page to reflect this change.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Wed, 17 Apr 2013 09:22:02 +0000 (11:22 +0200)]
In Rapi, set master correctly
The cluster data contains the information about the master
node. Use this information to set the isMaster bit correctly.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 16 Apr 2013 12:19:36 +0000 (14:19 +0200)]
In Luxi, set the master correctly
The cluster data contains the information about the master
node. Use this information to set the isMaster bit correctly.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Wed, 17 Apr 2013 09:42:28 +0000 (11:42 +0200)]
Utility function to set the master node in a node list
The information about which node is the master node is a cluster-wide
setting, in most formats provided independently of the node information.
Most backends therefore have to set the isMaster bit indepently in the
obtained node list. This patch provides a utility function for this.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 16 Apr 2013 08:57:39 +0000 (10:57 +0200)]
Make Hroller present master node last
If in the list of nodes to be scheduled for maintaince,
one is marked as being the master node, schedule it
as the last node in the last group.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Mon, 15 Apr 2013 12:54:23 +0000 (14:54 +0200)]
Extend the node description by isMaster
Extend the description of the node by the property
of being the master node; also provide and appropriate
setter function. This property will be used, e.g., by
hroller to schedule reboot of the master last.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Wed, 17 Apr 2013 11:23:37 +0000 (13:23 +0200)]
update hroller man page: node group filtering is implemented
Filtering of nodes by node group was already implemented in
2fce67b; fix the man page to reflect this change.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Fri, 19 Apr 2013 10:22:36 +0000 (12:22 +0200)]
Use correct name for design-storagespace.rst
This was renamed in b284f50 but the old name was still in use in the
makefile and draft designs list.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Helga Velroyen [Wed, 17 Apr 2013 17:56:47 +0000 (19:56 +0200)]
Storage type design doc: ipolicy vs. enabled disk templates
Adding the design decision regarding the consistency of the enabled disk
templates in the ipolicy and in the cluster config.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Helga Velroyen [Wed, 17 Apr 2013 17:50:30 +0000 (19:50 +0200)]
Rename design doc from space reporting to storage types
Since the design doc for storage space reporting ended up being mostly
about disk templates and storage types, and the space reporting being
just a small part of it, I am renaming the design doc.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Helga Velroyen [Wed, 17 Apr 2013 18:55:47 +0000 (20:55 +0200)]
QA: Fix error regarding missing names of disk configs
This fixes an error in case there are no disk names in the QA config
(which was the case till recently). Right now, QA tries to use 'None'
as disk name and that makes instance creation fail.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Helga Velroyen [Wed, 17 Apr 2013 22:15:41 +0000 (00:15 +0200)]
Revert "Make invocation of rapi test configurable ..."
This reverts commit
405692eff3d6f8400834f2df93d597bc7e4dd89f, because it
breaks QA.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Fri, 12 Apr 2013 09:34:55 +0000 (11:34 +0200)]
devel/review: take default reviewer from environment
When adding a 'Reviewed-by'-line, also add the reviewer
passed through the REVIEWER environment variable. In that
way, adding the reviewer for patch series all reviewed
by the same person gets easier.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Wed, 17 Apr 2013 19:54:11 +0000 (21:54 +0200)]
Make invocation of rapi test configurable by QA config
This does not solve the underlying problem of the rapi test not
being runnable locally, but it makes it at least configurable
to avoid having to patch in/out all the time.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 17 Apr 2013 13:21:32 +0000 (15:21 +0200)]
Fix warnings hlint 1.8.43 complained about
These lines are ok according to previous versions of hlint but trigger
an error with version 1.8.43.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Fri, 12 Apr 2013 09:40:25 +0000 (12:40 +0300)]
Preserve device names during instance move
Fix 'move-instance' tool to preserve the instance disk and NIC names
when moving instances from one cluster to another. Also, fix value error
since an instance NIC is an 8-tuple, containing also name and UUID.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:17 +0000 (11:51 +0300)]
Update manpages wrt new device refering
This patch updates gnt-instance man page to include refering to devices
by their name and UUID.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:16 +0000 (11:51 +0300)]
Update QA tests to check disk and NIC names
Modify existing tests to use the name option for instance disks. The
configuration options 'disk' and 'disk-growth' are merged into a single
'disks' option, which is a list of dictionaries with 'size', 'growth' and
'name' items.
Also, add 'instance-device-names' QA test, which tests addition, renaming
and removal of named devices.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:15 +0000 (11:51 +0300)]
Add name to INicParams and IDiskParams
This commits adds name to NIC and Disk modification definition.
Signed-off-by: Chris Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:14 +0000 (11:51 +0300)]
Add nic/disk name and UUID fields in Haskell code
Add name and uuid fields to Disk and nic Haskell objects. Also,
since they now have an UUID, make them instances of UuidObject.
Signed-off-by: Christor Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:13 +0000 (11:51 +0300)]
Add Disks and NICs to _AllUUIDObjects
Since disks and NICs have UUIDs, they must be considered
to _AllUUIDObjects.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:12 +0000 (11:51 +0300)]
Display UUIDs and names in gnt-instance info
Modify gnt-instance client to display the UUID and name
fields of instances disks and NICs.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:11 +0000 (11:51 +0300)]
Support quering for devices names and UUIDs
Extend instance queries to list 'uuid' and 'name' fields of instance's
Disks and NICs.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:10 +0000 (11:51 +0300)]
Check that device names are unique and valid
Extend the CheckArguments phase of LUInstanceCreate and CheckPrereq
phase of LUInstanceSetParams to also check if the name parameters of
disks and NICs are unique and valid.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:09 +0000 (11:51 +0300)]
Implement renaming Disks and NICs
Implement renaming Disks and NICs in LUInstanceSetParams. Remove code
that checked that changing disk mode was the only disk modification
supported. Also, handle case of 'None' value for 'name' parameter.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:08 +0000 (11:51 +0300)]
Support UUIDs and names when refering to a device
Modify _ApplyContainerMods function to lookup NICs/Disks not only by their
index inside the container, but also by their UUID or name. Abstract the
lookup code in new GetItemFromContainer function.
Make type of identifier in "opcode._TestInstSetParamsModList" to be
TInt or TString.
Modify gnt-instance client to not check if identifier is an integer.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:07 +0000 (11:51 +0300)]
Support UUIDs and names when handling NICs/Disks
Handle UUID and name fields when creating/managing NICs and Disks. Also,
export NICs and Disks names to instance hooks environment.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:06 +0000 (11:51 +0300)]
Add IDISK_NAME and INIC_NAME constants
Declare IDISK_NAME and INIC_NAME constants and add them to the
IDISK_PARAMS_TYPE and INIC_PARAMS_TYPE.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:05 +0000 (11:51 +0300)]
Add uuid and name slots to Disk/NIC ConfigObjects
This patch adds "uuid" and "name" slots to Disk and NIC ConfigObjects.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Christos Stavrakakis [Thu, 4 Apr 2013 08:51:04 +0000 (11:51 +0300)]
Add design doc for device UUIDs and names
This commit adds the design document for adding UUID and name slots to NIC and
Disk objects and the ability to refer to them by these slots.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Bernardo Dal Seno [Sun, 14 Apr 2013 14:31:35 +0000 (16:31 +0200)]
QA: Test enabled disk templates with known configuration
The test failed because it was executed also in a configuration that wasn't
expected, i.e., with exclusive storage enabled.
Also the docstring is shortened, as it was being truncated in the QA output.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Sun, 14 Apr 2013 14:25:45 +0000 (16:25 +0200)]
QA: Decision about disk templates to use is more modular
qa_config.IsTemplateSupported() is already used to decide which disk
templates are supported by QA. Enabled templates now are part of that
decision.
Unit tests are updated.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 9 Apr 2013 14:58:31 +0000 (16:58 +0200)]
Fix typo in documentation string
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Fri, 12 Apr 2013 07:57:49 +0000 (09:57 +0200)]
Adapt test data to changed ipolicy format
The test data for hail allocating a multi-disk instance was
originally added in the 2.7 branch. On master the format
of the ipolicy had changed; "min" and "max" are no longer
top-level of the ipolicy, but instead below the "minmax"
key. Hence change the test data accordingly after the merge
to master.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Guido Trotter [Thu, 11 Apr 2013 21:32:31 +0000 (17:32 -0400)]
Remove mistaken merge conflict line from NEWS
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Guido Trotter [Thu, 11 Apr 2013 21:03:32 +0000 (17:03 -0400)]
Merge branch 'devel-2.7'
* devel-2.7: (26 commits)
Fix burnin install path
Fix format of the NEWS file
NEWS: Add news entry for the hail disk policy fix
Add shelltests verifying hail applies disk ipolicy per disk
Make the disks parameter available to the constructor
Verify individual disks in Instance
Compatibility fix for GHC 7
Properly update iv_name of disks while changing templates
Limit the size of networks to /16
Check minimum size of networks on creation
Fix job queue directory permission problems
The disk size of a diskless instance is 0, not None
Postpone non-urgent TODO from 2.7 to 2.9
Add tool for creating users and groups
Backwards compatibility fix for Lucid
Properly export errors while reading job list
Fix typo and improve comment
Fix a bug in the Runtime tests
Restrict instance move to templates based on local files
Introduce a constant for the copyable disk templates
...
Conflicts:
NEWS: trivial
lib/network.py: trivial
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Helga Velroyen [Thu, 28 Mar 2013 12:45:32 +0000 (13:45 +0100)]
Update man page 'gnt-cluster' regarding disk templates
This documents the new 'gnt-cluster init/modify' option
'--enabled-disk-templates' in the man page.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Thu, 28 Mar 2013 10:34:42 +0000 (11:34 +0100)]
Removes the 'sharedfile' storage type
Since storage type are supposed to represent the underlying technology
of disk templates, the storage type 'sharedfile' is superfluous, because
technically both disk templates 'file' and 'sharedfile' use the file system.
This will be of use when implementing the storage space reporting for
all disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Tue, 26 Mar 2013 16:34:41 +0000 (17:34 +0100)]
Update NEWS file regarding disk types
This patch extends the NEWS file describing the essential user-facing
changes in this patch series.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Wed, 27 Mar 2013 15:02:47 +0000 (16:02 +0100)]
Consistency checks for config wrt disk templates
This patch adds consistency checks for the configuration regarding
disk templates. In particular, it checks that the list of enabled
disk templates is not empty, does not contain any bogus templates,
and that all instances use actually enabled disk templates.
Additionally, it fixes a small formatting issue regarding the list
of enabled hypervisors.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Wed, 27 Mar 2013 12:59:06 +0000 (13:59 +0100)]
QA: creating instances of dis/enabled disk templates
This patch makes sure that instance creation is only possible
for instances that use enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Wed, 27 Mar 2013 09:27:14 +0000 (10:27 +0100)]
QA: dis/enabling of used disk templates
This extends the QA for 'gnt-cluster modify'. It ensures
that disabling of a disk template is only possible if the
cluster does not have any instances using the template.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Tue, 26 Mar 2013 17:10:18 +0000 (18:10 +0100)]
gnt-instance: no instance creation with disabled templates
This patch makes sure that no instances can be created which use
disk templates which are not enabled on the cluster.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Thu, 21 Mar 2013 16:11:24 +0000 (17:11 +0100)]
qa_instance: refactoring wrt disk templates
This patch is a preparation for later patches in QA in this series
it refactors the instance QA to make it more flexible regarding
creation of instances with different disk templates. Right now we
only support creation of instances with disk templates 'drbd', 'plain',
and 'diskless'. With our current plans to improve storage handling,
we should make QA more flexible to also create instances of other
templates. This patch restructures the code in a way that instances
can be created more easily to be used in other QA scripts.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Tue, 26 Mar 2013 12:35:40 +0000 (13:35 +0100)]
Removes obsolete 'enabled storage types'
Since managing of different storage units is now done using
disk templates and not storage types, we remove the obsolete
enabled storage types.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Tue, 26 Mar 2013 12:32:58 +0000 (13:32 +0100)]
QA: Test cluster init/modify wrt enabled disk templates
Fixes the QA of 'gnt-cluster init' and 'gnt-cluster modify' with respect
to enabling disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Tue, 26 Mar 2013 12:23:39 +0000 (13:23 +0100)]
gnt-cluster init: enabling of disk templates
This patch enhances 'gnt-cluster init' to accept a list of disk templates
to be enabled. It removes the list of enabled storage types.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Tue, 26 Mar 2013 12:11:07 +0000 (13:11 +0100)]
gnt-cluster modify: verify instance's disk template usage
Adds a verification step to 'gnt-cluster modify' to make sure that no
disk template is disabled that is currently in use by at least one instance.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Tue, 26 Mar 2013 10:01:58 +0000 (11:01 +0100)]
gnt-cluster modify: modify enabled disk templates
Adds setting of the list of enabled disk templates to 'gnt-cluster modify'.
Note that this does not yet include any verification regarding disk templates
currently used by instances.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Mon, 25 Mar 2013 16:48:34 +0000 (17:48 +0100)]
gnt-cluster info: report enabled disk templates
Add reporting of the currently enabled disk templates to
'gnt-cluster info'.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Helga Velroyen [Mon, 25 Mar 2013 15:56:48 +0000 (16:56 +0100)]
Add enabled disk templates to cluster cfg
This patch adds constants for enabling disk templates to the constants,
and the cluster configuration in haskell and python. It removes the
obsolete preference list for enabled storage types.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtarara@google.com>
Guido Trotter [Thu, 11 Apr 2013 20:23:36 +0000 (16:23 -0400)]
Fix burnin install path
Due to a bug in
8e55e20f burnin's installation path got changed.
Moving tools/burnin to the right makefile target reverts this (while
preserving the value of the original commit).
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Klaus Aehlig [Thu, 11 Apr 2013 16:29:55 +0000 (18:29 +0200)]
Fix format of the NEWS file
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michele Tartara [Thu, 11 Apr 2013 16:11:09 +0000 (16:11 +0000)]
Add "less" to the chroot
Less is not part of the base debian system, so it has to be added
explicitly.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Thu, 11 Apr 2013 11:37:48 +0000 (13:37 +0200)]
NEWS: Add news entry for the hail disk policy fix
hail now correctly applies the instance disk policies, which
leads to differnt allocations.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 9 Apr 2013 09:24:09 +0000 (11:24 +0200)]
Add shelltests verifying hail applies disk ipolicy per disk
We test on two minimal examples, a positive and a negative one, where
the possibility to allocate a node depends on whether the disk policy
is checked on a per-disk level or on the total amount of disk space
requested.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 9 Apr 2013 13:52:09 +0000 (15:52 +0200)]
Make the disks parameter available to the constructor
In that way, tools building on Instance will benefit from the corrected
verification semantics of the instance policy on disk space.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 9 Apr 2013 12:29:59 +0000 (14:29 +0200)]
Verify individual disks in Instance
Instance policy on disks is specified on a per-disk basis. So extend
the instance description by the sizes of the individual disks and modify
the instance policy verification to correctly check individual disks.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michele Tartara [Thu, 11 Apr 2013 11:33:52 +0000 (13:33 +0200)]
Compatibility fix for GHC 7
Importing an instance, like JSON, automatically allows the names of all
its functions to be used.
If one of this functions (namely showJSON) is imported separately, GHC 6
is fine with that, but GHC 7 emits a warning (therefore, the compilation of
Ganeti fails because it requires no warnings).
This patch fixes the build for GHC 7 and has no impact on GHC 6.
Note that the same does not apply to the import of readJSON, because that
function is actually used in the same file, so it must be imported separately.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Wed, 10 Apr 2013 14:36:44 +0000 (14:36 +0000)]
Properly update iv_name of disks while changing templates
Trasforming the disk of an instance from DRBD to plain did not properly
update the iv_name of disks, leaving it to None.
This commit modifies _ConvertDrbdToPlain to properly set the iv_name
variables.
An analogous fix is not required in the opposite function,
_ConvertPlainToDrbd, because it uses _GenerateDiskTemplate, that already
takes care of doing that.
Fixes Issue 403.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Wed, 10 Apr 2013 18:23:17 +0000 (14:23 -0400)]
qa: fix TestInstanceModifyPrimaryAndBack flakiness
The test tries to scp the instance disks from the primary node to the
new destination, but connects to the master node instead. Thus it works
only when the primary node is the master node. Fixing by correcting to
the right node.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Helga Velroyen [Wed, 10 Apr 2013 12:06:19 +0000 (14:06 +0200)]
Limit the size of networks to /16
This patch introduces an upper limit to the size of the networks that can
be created.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Mon, 21 Jan 2013 15:20:34 +0000 (16:20 +0100)]
Check minimum size of networks on creation
When creating a network, so far no size constraints were checked.
We now limit the size of a network to a /30 or bigger, although
tecnically, the ipaddr library supports even /32 networks.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michele Tartara [Mon, 8 Apr 2013 12:33:37 +0000 (12:33 +0000)]
Fix job queue directory permission problems
If split users are used, the queue directory could only be accessed
by masterd, but also confd needs to be able to read it, e.g. when it
is queried as part of "gnt-job list"
This commit fixes the permissions in such a way to allow proper access rights.
Fixes Issue 406.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michele Tartara [Wed, 10 Apr 2013 08:48:41 +0000 (08:48 +0000)]
Set the default editor inside the chroot
Allows the chroot builder to set the default editor to be used in the
chroot.
Vim is used as the default choice.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Klaus Aehlig [Mon, 8 Apr 2013 14:35:09 +0000 (16:35 +0200)]
The disk size of a diskless instance is 0, not None
For diskless instances it is still reasonable to sum up the disk usage
of all the (zero) disks, resulting in the empty sum. This uniformity
also has the advantage that iallocators (like hail) do not have to do
any special considerations for diskless instances.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michele Tartara [Tue, 9 Apr 2013 13:56:13 +0000 (15:56 +0200)]
Postpone non-urgent TODO from 2.7 to 2.9
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>