hspace: add short forms for the group policy
This adds a shortened versions of the allocation policies, as writingout the whole name in the command line can become tedious.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
Fix interaction between CPU pinning and KVM migration
CPU pinning requires the KVM hypervisor to start in the paused state, inorder to retrieve information, and immediately unpauses it.
This does not play well with live migration, as the unpausing was done...
htools: add a MonadPlus instance for Result
This will be used to implement more easily 'choice' parsing of inputdata, without resorting to syntax (case … of Bad _ -> …).
Merge branch 'devel-2.5'
RAPI: Add resource to powercycle node
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add tls_ciphers and use_vdagent options
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Updated man pages with new SPICE TLS options
Implementation of TLS-protected SPICE connections
Added support for TLS-protected SPICE connections:
Added SPICE TLS option and related cert paths
Fix OS creation's error handling when pausing sync
Commit 41e1e79 introduced a feature in which when wait_for_sync is notset, DRBD sync is paused during the OS installation.
Doing so, however, broke OS creation's error handling: the result valuefrom the instance_os_add RPC call was overwritten by the one of the...
Fix two pylint errors
- hv_kvm.py: silence F0401, that is raised if pylint does not find the affinity module- rlib2.py: change disable-msg to disable
Fix backend.MigrateInstance docs
The MigrateInstance function does not return anything, so the relevantlines are removed from the documentation. Instead, the raised exceptionis documented.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
hv_kvm: bugfix
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Import: further doc updates
Signed-off-by: Agata Murawska <agatamurawska@google.com>Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
RAPI: Add resource to recreate instance's disks
This was still missing from RAPI.
Adding an updated design doc for the caching mechanism
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
hv_xen: fix use of CPU pinning constants
… to be consistent with hv_kvm
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
hv_kvm: fix hardcoded KVM command string
hv_kvm: support for CPU pinning
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: Iustin Pop <iustin@google.com>[iustin@google.com: fixed some small code and style issues]Reviewed-by: Iustin Pop <iustin@google.com>
constants: support for CPU pinning under KVM
Make affinity module optional
This was overlooked in the review, sorry.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
configure.ac: changes for CPU pinning
Also added optional affinity Python package for CPU pinning under KVMto the INSTALL doc.
Signed-off-by: Tsachy Shacham <tsachy@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>...
docs unittest: Add verification of opcodes covered by RAPI
All opcodes which are not yet covered or can't with the current design(e.g. cluster initialization) are excluded. This test is added to thedocs unittest since here the code already has access to a list of all...
docs unittest: Split into two separate test cases
The RAPI and hooks documentation aren't related at all.
docs unittest: Make _ReadDocFile a global function
rlib2: Declare all opcodes and equivalents
By declaring all used opcodes or opcodes equivalent to the operationsexecuted in a resource we will be able to ensure all opcodes are coveredby RAPI (with some exceptions).
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
baserlib: Function to retrieve opcodes used by handler
This will be used to verify opcodes used by RAPI.
htools: remove dead code
The tryEvac/evacuateInstance functions are no longer used in the newmulti-group world order, so we remove them and change the unit-test totest the actual IAllocator function.
hail: don't select the primary as new secondary
This just adds the primary node of the instance as 'non-allocable'during the choosing of the new secondary.
hail: add an extra safety check in relocate
If we select the primary as new secondary, better to fail than returnwrong data to Ganeti.
Fix RAPI documentation for gnt-instance console
Fix a failing pyassert in the RAPI docs and update it to reflect theaddition of SPICE to gnt-instance console.
Add SPICE compression and streaming options
Add the following SPICE audio/image compression and video streamingdetection hypervisor options:
Add SPICE support to gnt-instance console
Also update related unit tests.
Fix unittest breakage from commit 132cdb87159e
rapi: Re-add “/2” resource
Like “/”, it'll just return a JSON null.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Wrap long line in ganeti.rapi.rlib2_unittest.py
rlib2: Improve test for _ParseInstanceReinstallRequest
rlib2: Add test for /2/info
rlib2: Add tests for /, /version and /2/features
rlib2: Convert /2/instances to OpcodeResource
rlib2: Convert /2/*/tags to OpcodeResource
rlib2: Convert /2/nodes/[node_name]/storage/repair to OpcodeResource
rlib2: Convert /2/nodes/[node_name]/storage/modify to OpcodeResource
rlib2: Convert /2/nodes/[node_name]/storage to OpcodeResource
rlib2: Convert /2/groups/[group_name] to OpcodeResource
rlib2: Convert /2/nodes/[node_name]/role to OpcodeResource
Also fix a typo in a constant name.
rlib2: Convert /2/instances/[inst]/disk/[idx]/grow to OpcodeResource
rlib2: Convert /2/instances/[inst]/modify to OpcodeResource
rlib2: Convert /2/instances/[inst]/rename to OpcodeResource
rlib2: Convert /2/instances/[inst]/failover to OpcodeResource
rlib2: Convert /2/instances/[inst]/migrate to OpcodeResource
rlib2: Convert /2/instances/[inst]/export to OpcodeResource
rlib2: Convert /2/instances/[inst]/prepare-export to OpcodeResource
rlib2: Convert /2/instances/[inst]/deactivate-disks to OpcodeResource
rlib2: Convert /2/instances/[inst]/activate-disks to OpcodeResource
rlib2: Convert /2/instances/[inst]/replace-disks to OpcodeResource
rlib2: Convert /2/instances/[inst]/shutdown to OpcodeResource
rlib2: Convert /2/instances/[inst]/startup to OpcodeResource
rlib2: Convert /2/instances/[inst]/reboot to OpcodeResource
rlib2: Convert /2/instances/[inst]/info to OpcodeResource
rlib2: Convert /2/instances/[inst] to OpcodeResource
rlib2: Convert /2/groups/[group_name]/assign-nodes to OpcodeResource
rlib2: Convert /2/groups/[group_name]/rename to OpcodeResource
rlib2: Convert /2/groups/[group_name]/modify to OpcodeResource
rlib2: Convert /2/groups to OpcodeResource
rlib2: Convert /2/nodes/[node_name]/evacuate to OpcodeResource
rlib2: Convert /2/nodes/[node_name]/migrate to OpcodeResource
rlib2: Convert /2/redistribute-config to OpcodeResource
rlib2: Convert /2/modify to OpcodeResource
Also add unittests.
rlib2: Add unittests for two error conditions
Adds tests for errors on connecting to the server and for a full queue.
baserlib: Accept empty body in FillOpcode
baserlib.ResourceBase: Allow overriding of LUXI client
This enables unittesting of RAPI resources.
baserlib: Add more generic base class for opcode resources
This base class, which employs a meta class for the actual work, allowseasier definitions of RAPI resources using opcodes. Follow-up patcheswill change some of the existing RAPI resources.
The long-term goal with these changes is to make it easier to verify the...
baserlib: Rename R_Generic to ResourceBase
Apart from making match Ganeti's code style the name is also moredescriptive.
baserlib: Move GetClient/SubmitJob into base class
Unlike stand-alone functions these will be relatively easy to overridefor unittests.
rapi: Merge tag helpers into resource
They were only used in one place and upcoming changes, enabling testingof resource classes, will be easier with this merge.
rapi: Remove “/2” resource, deprecate “/”
These were never really useful. Neither gave a complete list ofavailable resources—the documentation in doc/rapi.rst is much better atthat.
Since some monitoring code might use the “/” resource it's kept around...
Make KVM use the QXL vga driver with SPICE
Enable by default the QXL paravirtualized graphic card if SPICE isenabled. The QXL driver is VESA compatible, so it degrades gracefully ifthe guest OS does not have QXL drivers.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>...
Use a loop to check SPICE parameters dependency
Use a loop to check if the user specified any SPICE option and SPICEsupport is disabled.
import: Fix a logic error due to missing "not"
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
import: Make sure the disk_dump path is in EXPORT_DIR
Switch other commonprefix to IsBelowDir
utils: Introduce IsBelowDir
This is mainly a wrapper to overcome the limitation of commonprefixwhich makes a string by string comparisation and reports the commonprefix in both strings. However this is bad for directory handling.
IsBelowDir works around this limitation and should be used in favour of...
Fixed a typo in gnt_cluster.py
Added password for SPICE sessions
Added an optional parameter called spice_password_file that allowsthe user to protect the SPICE login with the password contained inthe specified file.
Draft implementation of QMP connection
Basic implementation of the QMP connection and related tests.
Pylint fixes for autogenerated files
Applied s/disable-msg/disable/ also to Makefile.am, in order to inhibitpylint warnings for autogenerated files.
Version bump for 2.5.0~beta3
cmdlib: Support for CPU pinning
Signed-off-by: Tsachy Shacham <tsachy@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Update design doc with cmd line description
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix for auto parameters on import
Fix standalone module import check
Turns out my attempts to get it work nicely with “make distcheck” brokethe detection and of course I only notice after pushing.
Makefile: Use $(LN_S) instead of “ln -s”
Some platforms apparently don't support “ln -s”, otherwise Autoconfwouldn't have AC_PROG_LN_S.
Add check for standalone modules' imports
This check will abort if one of the standalone modules (currentlylib/rapi/client.py and tools/ganeti-listrunner) imports anything fromthe Ganeti source directory.
Fixes to errors/warnings raised by pylint 0.24
Running pylint 0.24.0 revealed 2 errors and 1 warning. Here is how Ifixed them:
PEP8 for QA
- Makefile.am: added QA directory to the paths checked by pep8- qa/: fixed the reported errors- Makefile.am: also, added qa_group.py to qa_scripts
listrunner: Allow passing of arguments to executable
This wasn't possible until now.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
listrunner: Replace str.split with library functions
- str.split("/").pop() should be os.path.basename- str.split("\n") should be str.splitlines()