Abstract OS name/variant functions
Currently, the computation of the 'pure' name or the variant ishardcoded and spread around the functions that need it. This is notnice, and in the future we'd spread it even more with more usage ofvariants/pure os names....
Add OS new states to the design doc
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Remove the RPC changes from the 2.2 design
These were not implemented.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Remove 'Detailed Design' from design-2.2.rst
This also bumps up the rest of the headings.
Merge branch 'stable-2.2' into devel-2.2
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Merge branch 'devel-2.1' into devel-2.2
NEWS: Add 2.2.0~rc2 release date
This was forgotten when preparing the release.
Bump version to 2.2.0~rc2
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix mac checker regex
Currently, the mac checker regex could match a corner case of11:22:33:44:55:66: (one extra colon at the end). We fix this, and wealso move the regex compilation outside of this function, at modulelevel.
Signed-off-by: Iustin Pop <iustin@google.com>...
Remove two old aliases
These were deprecated since Ganeti 2.0, it's time to remove them.
Fix migration on new KVMs
New KVMs (0.12.1.2-el6 and 0.13.5 tested) exit immediately afterunsuccessful network connection when they are in "-incoming" mode. Thesimple check netutils.TcpPing causes remote kvm to exit so the migrationwill always fail. This check is also redundant by the way as if the...
Fix typo in ganeti man page
cli: Pass options in {Add,Remove}Tags
They'll be used for job priorities. Also add an empty line tognt-os where it's missing.
Prepare 2.2.0~rc2 release
Update NEWS, but not yet configure.ac.
QA: Test more tag operations via RAPI
This ensures tag operations work via RAPI. Also print requested URI tostdout for debugging.
qa_rapi: Fix indentation error
If no function to verify the result was specified, qa_rapi._DoTestswouldn't return the result.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
opcode summary: improve display for list summaries
Currently, opcodes like NODE_EVAC_STRATEGY look bad:
89684 error NODE_EVAC_STRATEGY([u'node3'])
With this patch, we try to render list arguments a little bit better:
89684 error NODE_EVAC_STRATEGY(node3)...
(no conflicts, took LGTM from original commit)
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix case of MAC special-values
This fixes Debian bug #596347. An alternative would be to also allowthe uppercase form, but it's not nice I think.
cmdlib: Fix type of “name” parameter for tag operations
The parameter “name” is be None for cluster tags.
rlib2: Set tag operation param “name” to None for cluster tags
Otherwise parameter verification in the master daemon fails.
Remove mcpu's ReportLocks callback
This is no longer needed with the new lock monitor. One callback is kept tocheck for cancelled jobs.
Revert "jqueue: Resume jobs from “waitlock” status"
This reverts commit 4008c8edae31a3971fa8c4b200238afc8005d3d4.
While it worked in my initial tests, I've now found cases where this doesn'twork properly as it is. More work is needed and will be done as part of the...
Fix OS_VARIANT variable setting
This was introduced in efaa9b06d1e1e6d1678d0edd75b1ba37cf0de3d9.
in OSCoreEnv: inst_os.name is pure operating system name (without variant) as variant is stripped in OSFromDisk(). So we always get variant = inst_os.supported_variants[0] (first...
Fix pylint warning in http/__init__.py
My bad for not seeing this before:R0201:614:HttpBase.GetSslCiphers: Method could be a function
Allow SSL ciphers to be overridden in HTTP server
Users of this class, such as the RAPI server, might want to override or adjustthe default SSL cipher defined in a constant.
jqueue: Resume jobs from “waitlock” status
After an unclean restart of ganeti-masterd, jobs in the “waitlock” status canbe safely restarted. They hadn't modified the cluster yet.
jqueue: Move queue inspection into separate function
This makes the init function a lot smaller while not changingfunctionality.
jqueue: Don't update file in MarkUnfinishedOps
This reduced the number of updates to the job files. It's used in two placeswhile processing a job and the file is updated just afterwards.
locking.SharedLock: Update class docstring
This was already outdated when the initial version of SharedLock was addedin commit 162c1c1f1 (February 2008).
If we had any errors in setup in one of the hosts, exit with non-zero
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix the output of the key fingerprint from binary to hex
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cli: Use list of options shared between commands
The completion script for bash has to know about these options. Until nowthe list was in two places--once in cli.py and once inautotools/build-bash-completion. A shared list is used with this patch.
jqueue: Use separate function for encoding errors
Comes with unittest.
Fix some epydoc warnings
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix breakage introduced by commit 8044bf655
Note to self: even patches removing one line can break everything.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Manuel Franceschini <livewire@google.com>
Remove “dry_run” from opcodes.OpCreateInstance
I'ts declared twice, once in opcodes.OpCode and here, and this oneis redundant.
Disable the RAPI CA checks in watcher
Since the RAPI certificate is not necessarily self-signed, and wecurrently don't have any configuration variable for the real CA file, wedisable for now the CA checks. This fixes the 'restart RAPI every 5minutes' problem with non-self-signed certs....
move-instance: Fix parameter order in _CreateInstance
This patch fixes a bug, which caused the primary and secondarydestination nodes to be revered on the destination cluster after aninstance move.
Signed-off-by: Manuel Franceschini <livewire@google.com>...
Show list of pending acquires in “gnt-debug locks”
This is accomplished by keeping a list of waiting threads insteadof just their number inside the lock-internal condition. A fewother tweaks to the output format are also made.
Adding host key verification to setup-ssh
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Adding a paramiko fingerprint format helper
And provide unittests for them
Conflicts: NEWS - merge configure.ac - keep the 2.2 version
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Increase version to 2.1.7
Update NEWS for the 2.1.7 release
Fix race condition in locking unittest
While writing unittests for the new lock monitor, I made a small mistake anddidn't synchronize acquiring locks properly. This patch takes care of thisissue by adding additional synchronization.
Add simple lock monitor
This patch adds an initial implementation of a lock monitor, accessiblefor the user through “gnt-debug locks”. It currently shows all resourcelocks: BGL, nodes and instances. Config and job queue locks could beshown too, but wouldn't be of much help. The current owner(s) and mode...
workerpool: Allow setting task name
With this patch, the task name is added to the thread name and will show up inlogs. Log messages from jobs will look like “pid=578/JobQueue14/Job13 mcpu:289DEBUG LU locks acquired/cluster/BGL/shared”.
Use one function to parse “--fields” option values
locking.LockSet: Use function to get member lock name
Finalize removal of “lock_status” job field
When removing the field in commit 9bdab62198, I forgot to remove some parts.
Prepare 2.2.0~rc1 release
Update NEWS and version number.
setup-ssh: fix updating of authorized_keys
Due to what seems like a bug (or inconsistency) in paramiko, filesopened with a+ over SFTP need a seek() in order for the user to be ableto read data from them. We implement this, and rely on the fact that wedo iterate over all lines before writing and that the file is opened in...
setup-ssh: Also use keys from the ssh-agent
Currently, setup-ssh only uses one disk-based key. This means that anysetup where we use keys from ssh-agent (which do not necessarily existon disk) will break when moving from the old method to setup-ssh.
This patch moves the SSH key handling to separate functions, and uses...
setup-ssh: fix the logging error message
This took a bit of interesting debugging, but the issue seems to be thaton older python/logging/paramiko (I'm not sure which is at fault here),the other threads are finishing later than the main thread, so thelogging module closes the logging file (but doesn't unregister it)...
setup-ssh: only read the ssh port once
Then reuse it. With certain setups, this could be slow when pre-seedingan entire cluster.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
setup-ssh: redo the logging levels
There is not enough logged by default on stderr, and way too muchinformation in the log file.
Since we don't want to debug paramiko itself, we filter only warningsand above.
Otherwise, we make WARNINGS the default level, with verbose meaning INFO...
setup-ssh: try to use key auth first
This patch changes the setup-ssh workflow to try key authenticationfirst, and then fall-back to password authentication. The password isalso read lazily, with no prompts if we can authenticate via keys.
Use Sphinx' :rfc: extension to refer to RFCs
Document non-standard usage of JSON in RAPI
This was requested in issue 118.
Fix small spelling mistake
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix a few commands behaviour with dry-run
These commands use or display the result from the LU, so in case ofdry-run, they will crash or display just 'None'. At least checking thatthe result is 'true' (in the boolean sense) will make them work better....
Stop adding the dry-run option by default
Currently cli.py unconditionally adds the dry-run option. This patchdisables this, and exports dry-run as a normal option.
The other alternative I tried to implement (adding a new fake option fordisabling the auto-add per individual command) would require changes in...
Explicitly add dry-run to some commands
Based on manual inspection (that the command only does a submit of somejobs/opcodes), we re-add the dry-run option on a subset of the existingcommands.
A few more commands could use dry-run, but the code doesn't deal nicely...
jqueue: Remove lock status field
With the job queue changes for Ganeti 2.2, watched and queried jobs areloaded directly from disk, rendering the in-memory “lock_status” fielduseless. Writing it to disk would be possible, but has a huge cost atruntime (when tested, processing 1'000 opcodes involved 4'000 additional...
QA: Run simple job queue test
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Don't ignore secondary node silently
Currently on non-mirrored disk templates the secondary node is ignoredsilently. This patch adds a check for this case, and warns the usershould this be happening. This solves issue 113.
The patch also moves a prereq check to an argument check. This is ok...
etags: force Python as a language
etags has cannot properly identify the scripts/gnt-* files as Python, sowe statically force the language to Python.
Conflicts: man/gnt-instance.sgml...
RAPI client: Support modifying instances
RAPI: Allow modifying instance
Small fixes for instance creation via RAPI documentation
- Inconsistencies- Missing types
gnt-debug: Extend job queue tests
Test multiple opcodes, also with failure.
jqueue: Mark opcodes following failed ones as failed, too
When an opcode fails, the job queue would leave following opcodes as “queued”,which can be quite confusing. With this patch, they're all marked as failed andassertions are added to check this.
jqueue: Work around race condition between job processing and archival
This is a simplified version of a patch I sent earlier to make sure the jobfile is only written once with a finalized status.
jqueue: More checks for cancelling queued job
We can also check when the lock status is updated. This willimprove job cancelling.
errors: Function to check whether value is encoded error
jqueue: Add more debug output
gnt-backup: Pass error code to OpPrereqError
Merge branch 'devel-2.1'
Re-add the 'live' parameter to migration opcodes
This patch reintroduces the live parameter, for backwards compatibilityat the Luxi level. This way, clients can work transparently with both2.1 and 2.2, even though sub-optimally.
Fix --master-netdev arg name in gnt-cluster(8)
This fixes Issue 114.
Restore 'tablet mouse on vnc' behavior
We needed to revert commit 5b062a58ac76b39c2dc6a7e1543affdf43dc7ee7because it was in conflict with the usb_mouse hv parameter. Here wereintroduce its functionality only when usb_mouse is not specified.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Document the usb_mouse hv parameter
Revert "Add -usbdevice tablet to KVM when using vnc"
This reverts commit 5b062a58ac76b39c2dc6a7e1543affdf43dc7ee7.This fixes issue 109. The mouse type can be set with the usb_mousehv parameter.
Fix path in ganeti-rapi man page
This takes care of issue 116.
workerpool: Don't keep reference to task arguments
The workerpool should not keep any reference to task arguments afterthey were processed by RunTask. Doing so led to jobs being cachedby the job queue's WeakValueDictionary for longer than they should've...
cli.SubmitOpCode: Pass keyword parameter as keyword
gnt-backup: Don't show confusing message w/o target node
“gnt-backup export” requires the target node. Until now, the masterdaemon would complain that the “parameter'OP_BACKUP_EXPORT.target_node' fails validation”. With this patch,an additional check is done in the client program....
masterd.instance: Add missing argument
_DiskTransferPrivate takes three parameters, not two.
Adjust message in case ~/.ssh is no directory
Use actual path, not something hardcoded.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
RAPI client: Fix docstring for migrating instance
QA: Test renaming instance via RAPI
RAPI client: Support renaming instances
Allow renaming instances via RAPI
RAPI client: Don't re-use PycURL object
With this patch, a new PycURL object will be created for each request.This should make the RAPI client safe for simultaneous calls frommultiple threads. Unittests are adjusted accordingly.
An unnecessary variable assignment is also removed from the unittest...