Fix permission errors for split users
Correctly set ownership and permissions for daemon log files, correctthe name of the luxid logfile and set the ownership of the query socketcorrectly.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Fix permission problem related to Issue 477
Commit 91525dee856951ace940c78b6254a1c7344b4803 fixed Issue 477 but broke"gnt-cluster info".
This commit offers a solution to both problems, by changing the permissionof the socket instead of changing the permission the confd process is run...
Add hs function to easily change file ownership
The Haskell library functions only allow to change file ownership usinguid/gid. A function for doing that with explicit names is added by thiscommit.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Rename queryd to luxid
As queryd will, in the future, handle all LUXI request, queue jobs andmost likely perform various other tasks, it is renamed to luxid already.This will safe some headache when upgrading Ganeti installations, as wedon't have to deal with a daemon rename....
Add queryd daemon (split from confd)
queryd is added as a new daemon which handles configuration queries overLUXI. This functionality was removed from confd, which now only queriesover the network.
The queryd user is added to the master group such that it can access...
Extract ConfigReader from Confd/Server.hs
Confd's functionality to watch the Ganeti configuration file isextracted to the ConfigReader module. No functional changes areintroduced.
This extraction makes will enable us to split queryd from confd, asqueryd will have to use the same functionality....
Add timestamps to haskell network query fields
Add timestamp fields to the list of available network query fields inthe Haskell code.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Merge branch 'stable-2.7' into stable-2.8
Conflicts:...
Allow modify_etc_hosts to be changed
The modify_etc_hosts options, enabling the cluster to modify the /etc/hostsfiles of nodes, and to keep them in sync, could only be set at cluster inittime.
With this commit it can now be changed through modify_etc_hosts as well....
Add luxiReqQueryNetworks to LuxiOp
When the QueryNetwork was introduced as a method, apparentlyit was forgotten in the Haskell world. Add it here as well.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Log received message at debug level
At debug level, we can well afford to have a detailed entryfor each message received by a server.
Log RPC errors from inside executeRpcCall
executeRpcCall is the function to be used for executing RPCs, so it makes senseto use it as the single point for logging all thte RPC call errors.
Fixes Issue 293.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Factor out the logRpcErrors function
This function can be useful to multiple RPC calls, therefore it is movedto the file containing the common RPC functions.
Also, it is made more generic by changing its signature.
Add support for querying network timestamps
Add creation and modified timestamps when creating a new network, andextend the available query fields for networks with these fields,namely 'ctime' and 'mtime'.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>...
Prevent silent failure in case of connection problems
While running "gnt-node list", if a query to ConfD fails (especiallybecause of permission problems) it used to just fail silently, with gnt-nodeshowing question marks instead of data.
With this patch, ConfD records the error in its log file, together with a...
Clean up work around for host name filtering
These functions simply served as a work around to expresshost name matching by regular expressions, instead of usingcorrect equality filter on host names that providesthe correct matching already.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Do not handle host queries special
As, since 91c1a265, the equality used for host names alreadyis based on matching, there is no need to use a special functionfor this any more.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Support big-step shrinking in tiered allocation
In tiered allocation, if by shrinking only a single resource a validallocation can be found, shrinking is bound to shrink on this resource.Of course, after shrinking that resource a little bit without finding...
For node queries allow short forms of host names
For node queries use the host-name filter instead of the simpleequality-based one.
Provide a special filter for host names
For host names, usually short forms are used, e.g., node1 or node1.subinstead of the full qualified node1.sub.example.com. Therefore comparingnode names only by equality is too restrictive. This patch provides an...
In tiered allocation, cut non-promising shrinking tries
The heuristics for tiered allocation has been improved in that itchooses to shrink such a resource next where by shrinking only thisresource a valid allocation can be made, if such a resource exists....
Improve hspace shrinking strategy
In tired allocation, hspace shrinks that resource of the instancenext, that causes failure on most nodes. While, this is not a badstrategy in general, it can lead hspace into a dead end if for a largenumber of nodes a particular resource blocks any further allocation of...
Convenience function for iterating while the result is Ok
For a function f :: a -> GenericResult a, iterate it (in the sense of themonad), until the result is Bad; return the list of values occurred.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Provide witness for the sum-type structure of GenericResult
GenericResult, while rightfully a type of its own, is isomorphicto Either. So, also provide the case analysis function (i.e., theuniversal arrow out of the sum).
Conflicts: (trival, take union of added files/tests) Makefile.am test/hs/shelltests/htools-hspace.test...
Make shrinkByType aware of individual disks
When shrinking an instances, you can't just get smaller disk footprintwhile leaving the individual disks as they are. Make the shrinkheuristic aware of that fact, and decrease all individual disks aswell. Fixes issue 484....
Add missing parenthesis to description of --machine-readable
Add a force option to the ClusterSetParams Opcode
If set, the op code will, in particular, try to set the master IPon the new netdev, even if shutting down the master IP on the oldnetdev failed.
Add tests for network-aware allocation
hail-alloc-invalid-network defines a cluster with two nodegroups and anallocation request which does not fit on any of the groups. Group 1 hasinvalid disk-templates while Group 2 is not connected to the rightnetworks....
Honor network connections in hail
Before trying to allocate nodes in node groups, node groups are nowfiltered based on the networks they are connected to an the networkswhich are required by the new instance.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Parse NIC data from allocation request in hail
Add a NIC type and extend the Instance type by a list of NIC's. Parsethe NIC's in allocation requests and store them for now. Later patcheswill make use of this field in order to ensure that the requestedinstance is only placed in node groups wich are connected to those...
Support group networks in Text backend
The Text backend now parses network UUID (comma separated) andserializes them in the same form.The test data is adapted to the new format.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Parse node group networks
Extend the Group by the network ids it is connected to. Adaptthe IAlloc backend such that the networks are parsed correctly.This also required the adaption of test data.
Add disks_active to configuration
This flag tracks if the disks of an instace are supposed to be active.That's the case when an instance is running or when its disks gotactivated explicitly (and in a couple of other cases).It will be used by watcher to re-activate disks after a node reboot....
Merge stable-2.7 into stable-2.8
Conflicts: INSTALL NEWS configure.ac src/Ganeti/Query/Group.hs test/hs/Test/Ganeti/Objects.hs test/hs/Test/Ganeti/Query/Query.hs
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add reason trail to haskell opcode format
The haskell type definition of opcodes should remain aligned with the pythonone.
Add the reason trail type definition in Haskell
It will be added to the haskell definition of opcodes, to keep it aligned tothe python one, and it will be used for fetching the reason trail by theinstance status data collector.
Remove outdated TODO comment
Add proper error management to monitoring daemon
Produce a personalized 404 error when the requested resource is not available.
Produce a report for all the data collectors
Implement the API function of the monitoring daemon that provides the reportof all the data collectors.
Generate report for a single collector
Allow to ask the monitoring daemon for the report of one specific datacollector.
Export the full report from DRBD data collector
Export the full report instead of just the data from the DRBD data collector.
Update JSON serialization for "category"
Change the JSON serialization for the "category" field of data collectors,in accordance to the latest version of the design document.
Implement the "list collectors" API in monitoring
Implement the handler for outputting the list of collectors(name, category, kind) in JSON format.
Fix bug in group queries related to node/instance fields
Since we use the primitive string type for group UUIDs, the groupfields have a bug where we pass the group name as filter for nodetests, whereas the nodes themselves use the group UUID. This results...
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>
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...
Log at info level the success of a luxi query
So far, any successful query was only logged at debug level, thus leavingno traces in the logs, unless debugging was enabled. Therefore, we adda notes about successful completion at info level. Also, repeat a failed...
Fix typo in documentation string
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.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
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...
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...
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.
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...
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.
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>
Merge branch 'devel-2.7'
Removes the 'sharedfile' storage type
Since storage type are supposed to represent the underlying technologyof disk templates, the storage type 'sharedfile' is superfluous, becausetechnically both disk templates 'file' and 'sharedfile' use the file system....
Removes obsolete 'enabled storage types'
Since managing of different storage units is now done usingdisk templates and not storage types, we remove the obsoleteenabled storage types.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtarara@google.com>
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 templatescurrently used by instances.
Signed-off-by: Helga Velroyen <helgav@google.com>...
gnt-cluster info: report enabled disk templates
Add reporting of the currently enabled disk templates to'gnt-cluster info'.
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 theobsolete preference list for enabled storage types.
Make the disks parameter available to the constructor
In that way, tools building on Instance will benefit from the correctedverification semantics of the instance policy on disk space.
Verify individual disks in Instance
Instance policy on disks is specified on a per-disk basis. So extendthe instance description by the sizes of the individual disks and modifythe instance policy verification to correctly check individual disks.
Compatibility fix for GHC 7
Importing an instance, like JSON, automatically allows the names of allits functions to be used.
If one of this functions (namely showJSON) is imported separately, GHC 6is fine with that, but GHC 7 emits a warning (therefore, the compilation of...
Backwards compatibility fix for Lucid
The code introduced by the previous commit triggered a possible libraryconflict in Ubuntu Lucid.
This patch introduces an equivalent but more widely acceptable version ofthe same code.
Properly export errors while reading job list
In case of problems while reading the job list from disk (such as permissionerrors) confd would silently fail, writing a warning on the log file butsending an empty list and no error message to the client....
Fix typo and improve comment
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add parameter pnode to OpInstanceSetParams
This parameter will be used to set the new primary nodeof an instance, assuming that the disks have been movedby other means (outside ganeti's control).
Correct typos in comments
Correct four typos in the comments of the Drbd types file.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Add status information to the DRBD data collector report
Add status information as required by the design document.
Export the data collected by DRBD in JSON format
Write an intermediate function computing the JSON data before adding themto the DCReport.
Directly export the data computed by that function (with default parameters)allowing them to be used (in the future) by the monitoring agent....
Add DCStatus data type for the data collectors
Also adds the DCStatusCode, part of DCStatus, and the addStatusutility function for adding the "status" field to an already existingJSValue.
The design document is updated to have the status codes sorted by increasing...
Add Kind data type for data collectors
Also, add it to the DRBD data collector, and export it from there.
Add data type for data collector category
Also, update the DRBD data collector to use and export it.
Export the dcVersionInformation for the Drbd collector
Also, update the JSON output (and the design document) so that it is notin camelcase anymore. This is part of a bigger effort to remove camelcasefrom the exposed JSON.
Add data collector version data type
Define the new data type and update the DRBD data collector to use it.
Fix comment line position in DRBD data collector
Export dcName information of Drbd data collector
Refactor ispecs in ipolicy structures
Minimum and maximum instance specs are put together into a single elementof the instance policy. This is in preparation for introducing multiplemin/max specs.
gnt-cluster modify: dis/enabling storage types
This patch extends the 'gnt-cluster modify' command to manipulate the listof enabled storage types. Note that this currenlty does no validationwith respect to whether or not there are instances currently using a storage...
gnt-cluster info: show enabled storage types
This extends the 'gnt-cluster info' command to list the storage typesthat are enabled on the cluster. It also fixes the broken indentationin the 'handleCall' function.
Add 'enabled_storage_types' to the cluster config
This patch adds the cluster's new field 'enabled_storage_types'to the configuration objects in python and haskell.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add monitoring HTTP API structure
Add all the supported commands to the API.The actual response is still to be implemented.
Add basic HTTP server functionalities to Mond
Add a stub implementation of the Mond HTTP server to Mond using the Haskellsnap-server library.
Add the core of the monitoring daemon
This commit adds the core infrastructure of the monitoring daemon,and integrates it in the build and test systems.
The actual functionality of the monitoring daemon is still completelymissing.
Typo 'repot' in Server.hs
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add Mond to the list of possible daemons
Also, add its logfiles and extra log files.
Change node disk/hv_state query in confd
Currently, the Python code returns either FS_UNAVAIL (if theseattributes are None) or the proper dicts. As we don't allow editing ofthese attributes, in most cases they will therefore be FS_UNAVAIL onthe client....
A few style fixes in Ganeti.Network
Side-effects of working on some other network-related stuff…
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add simple Ip4Address/Ip4Network types
This patch adds some very simple IPv4 address/network types, and usesthem in the 'Network' config object.
We need these in order to properly compute the reserved IP addresses,without depending on an external library (which I haven't found, by...
Add missing external_reservations query field in confd
Based on the implemented Ip4Network/Address types, we can now computethe (external) reservations.