rpc._NodeConfigResolver: Support resolving offline nodes
This is needed to powercycle a node marked offline.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
rpc_defs: Enable “node_powercycle” for offline nodes
With this change it's possible to powercycle nodes marked as offline. Ofcourse the node might not be running the node daemon anymore.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
rpc._RpcProcessor: Make read timeout a non-keyword argument
It is always used and can be set to “None” if intended.
rpc: Add support for resolver options callback
This adds support for a callback returning name resolver options. Thisis required for powercycling offline nodes. While it would be possibleto implement this using a separate RPC client class, doing so would...
rpc: Pass resolver options to actual resolver
QA: Make the ispec values configurable
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Update the resource model DD with current state
On my work for instance policies we decided not to overload --forcemore, instead we go with a new flag --ignore-ipolicy. This is just asmall patch to reflect this decision.
Signed-off-by: René Nussbaumer <rn@google.com>...
Fix failure in distcheck and coverage tests
autotools/testrunner was missing in distcheck. Now some changes from7004106119c5c56c93085ccfb1250b3561b5b6ad have been reverted, and testrunneris not built anymore. coverage now uses fakeroot when needed.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Makefile: Fix parallel distcheck
Running “make -jN distcheck” for any N > 1 would reliably break whenbuilding the RPC client wrappers. This was due to wrong dependencies inMakefile.am, fixed by this patch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Merge branch 'devel-2.5'
Merge branch 'stable-2.5' into devel-2.5
test/lockperf: Use a list of integers, not booleans
Add lock performance utility
I had an idea for improving locking performance. To see if it worked Iwrote this tool. Unfortunately the idea didn't quite work (brokeunittests left and right), but the tool is still handy for evaluatingfuture changes to the “SharedLock” class....
jqueue: Factorize checking job processor's result
This allows for more unittesting.
jqueue unittest: Rename simple fake-job class
Also add a parameter for priority, to be used in an upcomingpatch.
unit tests: Add tests for file mode handling in utils.WriteFile
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
unit tests: Add tests for uid and gid handling in utils.WriteFile
These tests need fakeroot. If it's not present, they are not run (theydon't fail).
noded: Fix /etc/hosts group ownership
When Ganeti was compiled with the option of running as a differentuser/group, the group ownership of /etc/hosts was set to gnt-daemons. Nowpermissions for /etc/hosts are preserved (or set correctly).
unit tests: added fakeroot support
Tests ending in "-runasroot" or "-runasroot.py" are run through fakeroot,so activity that needs root privileges can be tested.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>...
utils.WriteFile: Add new parameter to preserve file permissions
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
jqueue: Fix epylint errors introduced in 37d76f1e4
Extend RPC definition change with another parameter
This will be used in a later patch for parameter pre-processing. Fornow we just add the parameter as 'None' and add a consistency checkfor the parameter definitions.
Signed-off-by: Iustin Pop <iustin@google.com>...
Change internal RPC client body values
Currently, all RPC payloads sent by the client to the remote nodedaemons must be identical, due to how the data is passedinternally. This is deficient in both use (from the programmer's pointof view) and from the network traffic (cluster verify/disk data...
Switch blockdev_getmirrorstatus_multi to per-node bodies
Even for a small 4-node node-group, this reduces the payload of thisRPC call by half for each node; for a big node group, previous testing(using a different patch) showed a general reduction in traffic over...
hv_kvm: Make string containing regex a raw string
hv_kvm: Style fixes
Change a few lines to match rest of code.
test/hv_kvm: Code style, additional tests
Change code style to match rest of Ganeti code and addtwo tests checking for single-line messages.
hv_kvm.QmpMessage: Use dict.get
No need to look up the key twice.
serializer: Remove JSON indentation and dict key sorting
Serializing to JSON using “simplejson” is significantly slower whenindentation and/or sorting of dictionary keys is used. In simplejson 1.xthe difference isn't that big, but with simplejson 2.x the difference...
jqueue: Fix deadlock between job queue and dependency manager
When an opcode is about to be processed its dependencies areevaluated using “_JobDependencyManager.CheckAndRegister”. Dueto its nature that function requires a lock on the manager'sinternal structures. All of this happens while the job queue...
Fix unittests for daemon_util with disabled confd
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix parameters for QueryJob in JobExecutor
When gnt-job submit is used with the --each option, it sends asparameters for QueryJobs a list of lists, each containing a job ID.While this works now, it is not the intended format for QueryJobs.
This patch fixes this behavior, by making it send a list of job IDs....
locking: Add “__repr__” to SharedLock and PipeCondition
These help when debugging.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Fix cluster destroy failure
Cluster destroy would fail if there were errors while deactivating themaster IP address. This patch demotes such errors to warnings, allowingthe cluster to be destroyed even if the master IP address turndownfails.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>...
Add docs for missing option in gnt-debug man page
Document the --each option of gnt-debug submit-job.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
gnt-node: Add hv/disk state to add
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
gnt-group: Add hv/disk state to add
gnt-cluster: Add hv/disk state to init
RAPI client: Replace body value assignments with helper
RAPI client: Export feature constants
Users of the RAPI client may want to use feature strings too, thereforethey should be explicitely public.
sphinx_ext: No longer exclude “depends” parameter by default
By default parameters existing for all opcodes (e.g. “debug_level”) arenot listed in the RAPI documentation. With this change the “depends”parameter will be listed unless explicitely excluded....
RAPI client: Use utilities for building query parameters
Instead of repeating a “if cond: query.append(…)” pattern, utilityfunctions are added and used.
opcodes: Extend description of “depends” parameter
The documentation string is used in the RAPI description andhaving more details is good.
Add infrastructure for, and two extra hlint rules
This will allow us to easily use add new lint rules that westandardise on, if any.
Document DRBD dynamic resync params in man pages
Also, remove some spurious spaces in the documentation of other optionsand uniform the style of the disk parameters descriptions, byterminating them with a period and adding the measurement unit in square...
Add the remaining DRBD dynamic sync disk params
Add the c-plan-ahead, c-fill-target, c-delay-target, c-max-rate,c-min-rate parameters; report errors while setting thesynchronization speed.
Change the error signaling model of SetSyncParams. Instead of returning...
Add the dynamic-resync DRBD disk parameter
constants.py, cmdlib.py:- add the dynamic-resync parameter, both at DT and LD levels;
lib/bdev.py:- change SetSyncSpeed to SetSyncParams, and _SetMinorSyncSpeed to _SetMinorSyncParams;- use the dynamic-resync parameter....
Describe the dynamic-resync par. in the design doc
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Makefile.am: fix permissions for Python scripts on install
Some Python scripts in /usr/lib/ganeti/ were getting the wrong permissions(their 'x' bit was cleared). This patch fixes that behavior.
This patch renames the variable 'dist_tools_PYTHON' to 'python_scripts'....
devel/upload: Fix permissions for installed directories
Permissions for the directories created during install depended on theumask of the user running the script. Now umask is reset inside the scriptto remove such dependency.
QA: init cluster changes ispecs
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Empty ipolicy fix
Man page for gnt-group
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Man page for gnt-cluster
Resource model design update
SimpleFillIpolicy corrected
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Change constants: ISPECS suffixes to prefixes
mem_count is now mem_size everywhere
GroupSetParam supports instance policy changes
AddGroup supports instance policy
Group query now calculates ipolicy
Verification of instance policy for gnt-cluster verify
Introduce instance policy on nodegroup level
Cluster-level instance policy - other
SetClusterParams supports instance policy changes
InitCluster supports instance policy
Instance policy command line support
Introduce instance policy on cluster level
daemon.GenericMain: Don't generate backtrace on conflicting daemons
Instead, print a nicer error message. This should fix issue 200.
utils.io.WritePidFile: Improve error reporting
If the PID file is already locked by another process, try to readthe content and report it as part of the error message.
Add a balloon device to all kvm instances
This can be used to resize their memory (for now only manually, asganeti doesn't do the job yet)
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
kvm: get more accurate info from qmp, if possible
kvm: make qmp connections more robust
Currently qmp fails at connect() time if there are socket errors. (eg.if the instance was started without qmp). Add some better checking.
Also in the only place where we use it avoid hiding the error connectingto the socket as a failure to read the password file....
Move ErrnoOnStr backend function to utils
Add documentation for disk parameters to man pages
Document the stripes parameter for the plain template and theresync-rate, datastripes, metastripes, disk-barriers, meta-barriers,metavg, disk-custom and meta-custom parameters for the drbd template.
Add net-custom and disk-custom DRBD parameters
Those parameters can be used to pass options directly to drbdsetup diskand drbdsetup net.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add the metavg DRBD disk parameter
This parameter represents the default metadata volume group for DRBDdisks. It can be overridden at instance creation time using the metavginstance disk parameter.
Move LD parameters constants to the LDP_ namespace
Add the LDP_ prefix to the LD parameters-related constants, in order toavoid pollution in the global constants namespace.
Restore diskparams in the gnt-group options check
Commit a82823 accidentally removed opts.diskparameters from the list ofparameters that are checked for presence in gnt-group, thus causinginvocations of gnt-group modify with only disk paramaters to fail....
utils.ListVisibleFiles: Hide “lost+found” directories
If a “lost+found” directory is found at a filesystem's root path it isignored. In all other cases directory entries named “lost+found” aretreated normally. Unittests are included. Fixes issue 153.
Some small test simplifications
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add tests for parameter "always_failover"
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add new back-end parameter "always_failover"
Instances that have this parameter is set to True are never migrated, butinstead they can only fail over. There are some cases where freezing thekernel may cause problems, and hence this behavior is preferable....
manpages: Fix small errors in documentation
Mostly typos, except for the output of "gnt-instance migrate" in anexample, which has been updated to the current version
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Signed-off-by: Iustin Pop <iustin@google.com>...
gnt-cluster: Allow modify disk/hv state
gnt-group: Allow modify disk/hv state
gnt-node: Allow modify disk/hv state
cmdlib: Adding hv/disk state dict helper functions
cli: Add common command flags for hv/disk state
cmdlib: Adding _UpdateAndVerifySubDict helper
This helps with 2 dimensional dicts.For example the hv_state and the disk_state dicts.
Cleanup hlint errors
First, we update the recommended hlint version to what I used to get aclean output (1.8.15). Most of the changes are:
- remove unneeded parentheses- some simplifications (intercalate " " → unwords, maybe … id → fromMaybe, etc.)- removal of some duplicate code (in previous patches)...
Abstract some common hspace code into a function
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
Abstract some common Cluster.hs code into a function
Add DRBD dynamic resync speed params to design doc
Convert opcode TH code to the use of Field type
This makes more explicit the field behaviour - previously an optionalfield was detected via a "Maybe" constructor, and an optional one viaa "Just defval" one. With this, field behaviour become more explicit...
Unify some file lists in Makefile.am
These were repeated needlessly; I hope I grouped them correctly.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Add DRBD barriers disk parameters
Add the disk-barriers and meta-barriers parameters described in thedesign doc.
Style fixes on confd-client
Oops, forgot to check this before initial commit, sorry!
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
NEWS: Add missing space
htools: small change in error message in THH.hs
We should also display the value we can't parse, otherwise debuggingis very hard.