hspace: Handle multiple ipolicy specs
With tiered allocation, hspace uses all the max specs in turn as theinitial instance spec.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
QA: Test multiple instance specs
The test of the interaction between policy and instances is extended.
QA: Handle multiple instance specs
Existing tests are updated to cope with the new instance specs format.
Unit test for cli.FormatPolicyInfo()
We try to parse the string obtained by formatting a policy, and see if weget the same policy.
Add command-line support for multiple specs in ipolicy
Command line options accept multiple min/max specifications in instancepolicies. The output of show-ispecs-cmd is updated accordingly.
Add multiple min/max specs in instance policy
Now instance policies can contain more than one min/max specs. This is themain element of the "Constrained instance sizes" section in the"Partitioned Ganeti" design doc.
This is a big patch, but changing the type of a configuration item requires...
Separate checks for std spec compliance
This is needed to be able to validate the std spec against multiple min/maxspec pairs (appearing in next patches).
QA: Transpose instance specs
The format used to store instance specs in QA is changed to better handlemultiple instance specs, a feature contained in the following patches.
Merge branch 'stable-2.7' into stable-2.8
This fixes the problem with the distcheck-release target failing needlessly.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Improve check for "unreleased" versions in NEWS
Currently this is checked only when distcheck-release is called.Check it in check-news instead, for all versions before the "current" one (as defined by configure.ac)
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Update documentation for text format
In commit 000ca91a the text format was extended to also includeinformation about the master node. This commit updates thehtools man page to reflect this change.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Conflicts: NEWS doc/rapi.rst
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add missing fields in htools text-backend documentation
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
cfgupgrade: Remove enabled_disk_templates on downgrade
Remove enabled_disk_templates instead of the deprecatedenabled_storage_types.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Reason trail implementation for "start"
Opcode-specific implementation of the reason trail for the instancestartup operation.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Reason trail implementation for "shutdown"
Opcode-specific implementation of the reason trail for the instance shutdownoperation.
Add unit tests for cfgupgrade with a real configuration
Test upgrade and downgrade from a realistic 2.7 configuration.
QA: Update tests for new ipolicy specs command-line options
The old command-line options weren't working any more. Utility functionsare updated, and broken tests are removed (new tests are coming in thefollowing patches).
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
QA: Split function to set and parse instance policies
The main parts, moved to qa_util, will be used for node groups too.
QA: More tests for instance policies in groups
Instance policies are changed and checked for changes.
Split functions in cfupgrade unit tests
This makes easier to test real configurations.
cfgupgrade: Limit specs in ipolicy are always complete
Partial specs are filled with cluster defaults.
Limit specs in ipolicy command lines are always complete
Command line options are brought in line with the specs change of previouspatch. Old options are still allowed in gnt-cluster init, where thesemantic will remain non-ambiguous even after introducing multiple specs....
QA for --ipolicy-xxx-specs and show-ispecs-cmd
The tests check the interactions between the two commands.
Also refactored group QA code to separate tests about ipolicy, as thosetests are going to grow in complexity.
Refactor tests in ipolicy validation
This makes the code more modular, in preparation for the following patches.
Limit specs in instance policies are always complete
Specs used to specify limits in instance policies are always complete, evenat group level (only the whole limit set can be overridden). This is inpreparation for introducing multiple limits.
Add --ipolicy-xxx-specs options
These options allow to specify whole instance policy specs. This is neededfor the upcoming changes that tend to threat specs as monolithic objects.
Add command to print ipolicy options
The output of this command can be used to create an exact copy of thecurrent instance policy specs. The command could be expanded to print allthe options used to create a group or the cluster.
New CLI input type: list of key/value pairs
This will be used for the new instance specs options.
Allow "default" as a value for ipolicy templates
Previously the string value was being corrupted.
Document all --ipolicy-... options
They were missing from the man pages.
Fix a few unclear sentences in gnt-cluster(8)
The renew-crypto entry had a few obscure sentences. Improve it byrephrasing it.
Make burnin compatible with the reason trail
The burnin uses its own option list, different from the one of all othercommand line programs, and uses it as a parameter to a function that nowrequires the "--reason" option to be present.
This commit updates the burnin option list to be compatible with the reason...
Extend the simulation backend to also simulate a master node
In a simulated cluster as created by the simulation backend tothe htools, make the first node of the first node group the masternode. In this way, hools (like hroller) that require a master node...
Add unit tests for hroller
Add a unit test for hroller in a situation where the orderis completely determined. There are 3 nodes where node 2 has,for each of the other nodes, an instanced shared with it. Sonode 2 has to be a reboot group of its own. There are no more...
Extend Text format by marking the master node
Sometimes, e.g., for hroller, it is necessary to know which nodeis the master node. Therefore this information has to be includedin the text format as well. Since we never use an offline node asmaster node, we can put this information can be put in the "is...
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>
Reason trail implementation for instance reboot
This commits allows ganeti to correctly forward the reason trail informationregarding instance reboot.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add "reason" as a common parameter for all the RAPI calls
Also, this add an infrastructure for having parameters common to all theRAPI calls.
Add infrastructure for adding common RAPI parameters
Some parameters can be common to all the RAPI calls: this commitadds the possibility of specifying them just once, instead ofmanually adding them to the classes describing each call.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Add job_id and index to the reason trail
The reason trail will contain an item indicating the job_id and theindex number of the current opcode inside the job queue.
Add the reason trail to the opcodes
The reason trail is available for all the opcodes, and as such it isinitialized as a generic option.
Add a field to store the reason trail in OpCodes
The reason trail will be available for all the OpCodes, so the field thatis to contain it has to be added to the OpCode base class.
Provide "--reason" as a parameter for all commands
Add function for extending the reason trail
Noded functions will have to extend the reason trail specifying whatoperation is being executed.
This commit adds a function for doing that (will be used by future commits).
Add an opcode name conversion function
Add a function to convert an opcode class name to a source string for thereason trail, factoring out the code in common with the existing _NameToIdfunction.
Add function for storing the reason trail of an instance
We are interested in storing the reason trail for operations that changedthe state of instances. This commit adds a function to do this.
Also, the GetInstReasonFilename() function name is prepended with an...
Add function for getting the timestamp in nanoseconds
The timestamp is returned as an integer number of nanoseconds since the Unixepoch.
Add TMaybeList as a new type for parameters
This will be used as the type for the reason trail parameter.
Add constants for the reason trail implementation
A few constants are required, describing the source reason of the opcode.
Remove old "reason" implementation
Remove the useless parts of the old, partial, implementation of the support fortracking the reason of instances state change, before implementing the newreason trail support, as per the design document.
More specifics on the implementation of the reason trail
Adding the reason trail as a parameter instead of as a new class attribute fitsbetter with the current structure of the system.
Also, the description of what part of the implementation will be OpCode...
Add monitoring daemon user to user creation script
The script was added to Ganeti before the monitoring daemon, so itdid not include that user yet.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
devel/review: fix addition of reviewer from environment
In commit 3dd990, the possibility of taking a default reviewerfrom 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>...
QA: Skip RAPI setup when RAPI is disabled
This is similar to 405692ef, reverted in aeefb4cd.
Bump up version for 2.7.0~beta3
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Update NEWS for 2.7.0~beta3
- Most entries for beta1 are moved to the top level- The beta1 to beta2 delta is left
Allow proper cleanup of partially created disks
During the creation of an instance, if the creation of disks fails, somepartially created disks might remain lying around. There is an alreadyimplemented cleanup procedure, but it requires the disks to be listed in the...
Make hroller insist on finding precisely one master node
As people rely on the master node being the last node of the lastgroup, make hroller fail, if no master node could be found in thecluster. This happens, e.g., if a backend format is used that does not...
Update hroller man page: master node is last
Where the information is available, hroller now schedules themaster node as the last node in the last group. Update the manpage to reflect this change.
In Rapi, set master correctly
The cluster data contains the information about the masternode. Use this information to set the isMaster bit correctly.
In Luxi, set the master correctly
Utility function to set the master node in a node list
The information about which node is the master node is a cluster-widesetting, in most formats provided independently of the node information.Most backends therefore have to set the isMaster bit indepently in the...
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 itas the last node in the last group.
Extend the node description by isMaster
Extend the description of the node by the propertyof being the master node; also provide and appropriatesetter function. This property will be used, e.g., byhroller to schedule reboot of the master last.
update hroller man page: node group filtering is implemented
Filtering of nodes by node group was already implemented in2fce67b; fix the man page to reflect this change.
Use correct name for design-storagespace.rst
This was renamed in b284f50 but the old name was still in use in themakefile and draft designs list.
Rename design doc from space reporting to storage types
Since the design doc for storage space reporting ended up being mostlyabout disk templates and storage types, and the space reporting beingjust a small part of it, I am renaming the design doc.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Storage type design doc: ipolicy vs. enabled disk templates
Adding the design decision regarding the consistency of the enabled disktemplates in the ipolicy and in the cluster config.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
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.
Revert "Make invocation of rapi test configurable ..."
This reverts commit 405692eff3d6f8400834f2df93d597bc7e4dd89f, because itbreaks QA.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
devel/review: take default reviewer from environment
When adding a 'Reviewed-by'-line, also add the reviewerpassed through the REVIEWER environment variable. In thatway, adding the reviewer for patch series all reviewedby the same person gets easier....
Better wording of a documentation sentence
Specify that the need to manually modify the metavg only applies toclusters with DRBD enabled, and is not always required.
Specify behaviour of vg-name change in gnt-cluster manual
The current behaviour of a volume group name change after the clusterhas been initialized can be somewhat unclear. This patch specifies itmore esplicitly in the man page.
Set the default metavg to be equal to the cluster name
The default metavg was always set to be the constant value "xenvg".This is OK for most cases, but if the cluster is initialized witha default name through the --vg-name option, the metavg should change...
Make invocation of rapi test configurable by QA config
This does not solve the underlying problem of the rapi test notbeing runnable locally, but it makes it at least configurableto avoid having to patch in/out all the time.
Fix warnings hlint 1.8.43 complained about
These lines are ok according to previous versions of hlint but triggeran error with version 1.8.43.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
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>
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>
Update QA tests to check disk and NIC names
Modify existing tests to use the name option for instance disks. Theconfiguration options 'disk' and 'disk-growth' are merged into a single'disks' option, which is a list of dictionaries with 'size', 'growth' and...
Update manpages wrt new device refering
This patch updates gnt-instance man page to include refering to devicesby their name and UUID.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Preserve device names during instance move
Fix 'move-instance' tool to preserve the instance disk and NIC nameswhen moving instances from one cluster to another. Also, fix value errorsince an instance NIC is an 8-tuple, containing also name and UUID.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>...
Display UUIDs and names in gnt-instance info
Modify gnt-instance client to display the UUID and namefields 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>
Add Disks and NICs to _AllUUIDObjects
Since disks and NICs have UUIDs, they must be consideredto _AllUUIDObjects.
Support quering for devices names and UUIDs
Extend instance queries to list 'uuid' and 'name' fields of instance'sDisks and NICs.
Check that device names are unique and valid
Extend the CheckArguments phase of LUInstanceCreate and CheckPrereqphase of LUInstanceSetParams to also check if the name parameters ofdisks and NICs are unique and valid.
Implement renaming Disks and NICs
Implement renaming Disks and NICs in LUInstanceSetParams. Remove codethat checked that changing disk mode was the only disk modificationsupported. Also, handle case of 'None' value for 'name' parameter.
Support UUIDs and names when refering to a device
Modify _ApplyContainerMods function to lookup NICs/Disks not only by theirindex inside the container, but also by their UUID or name. Abstract thelookup code in new GetItemFromContainer function.
Make type of identifier in "opcode._TestInstSetParamsModList" to be...
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>...
Add IDISK_NAME and INIC_NAME constants
Declare IDISK_NAME and INIC_NAME constants and add them to theIDISK_PARAMS_TYPE and INIC_PARAMS_TYPE.
Add uuid and name slots to Disk/NIC ConfigObjects
This patch adds "uuid" and "name" slots to Disk and NIC ConfigObjects.
Add design doc for device UUIDs and names
This commit adds the design document for adding UUID and name slots to NIC andDisk objects and the ability to refer to them by these slots.
Move HooksMaster out of the mcpu module
We need to do this, so that backend.py doesn't need to import mcpu, andthus indirectly cmdlib. This reduces the size of the node daemon byabout half, which is very important as it is pinned in memory.
This solves Issue 419....
users setup: add masterd to confd group
Without this masterd fails saving the config, because it can't changethe group on the file.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Use KB as the unit for LVM PE size
LogicalVolume.Attach in bdev.py is calling "lvs" and specifying a unit ofMegabytes that is then converted to an integer resulting in the value 0 forsmall sizes.
This patch makes Ganeti use KB for the unit instead of MB....
QA: Test enabled disk templates with known configuration
The test failed because it was executed also in a configuration that wasn'texpected, i.e., with exclusive storage enabled.
Also the docstring is shortened, as it was being truncated in the QA output....
QA: Decision about disk templates to use is more modular
qa_config.IsTemplateSupported() is already used to decide which disktemplates are supported by QA. Enabled templates now are part of thatdecision.
Unit tests are updated.
Improve RAPI documentation for command line usage
Provide some more insights about how to use the RAPI from the command linethrough the "curl" command.
More info on using the RAPI
Add some additional information about how to use/test the RAPI,including how to specify authentication credentials.
Cherry picked from 681f4f7bb95a2b467f917c84a68ccf9aa7665763 on master.
Fix typo in documentation string