Introduce two-argument style for OpPrereqError
This patch introduces a two-argument style for OpPrereqError. Only thedirect raise calls in cmdlib.py are converted, other users will follow.
cli.py is modified to handle both two-argument style and the current...
Remove the OpRetryError exception
This is only used in two places, in an error path that is no longervalid since Ganeti 2.0. We remove the try..except since we should notget it anymore (and if we do, then we should catch it in allconfig.Update cases) and we remove the exception class completely....
Activate disks while exporting an instance
Exporting an instance not running or without activated diskswill fail. This patch makes sure to activate disks beforeexporting an instance if it's in the ADMIN_down state.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Epydoc fixes
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
backend: Don't overwrite function parameter with loop variable
Add QA test for “gnt-node {list,modify,repair}-storage”
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Unify the query fields for the storage framework
This patch unifies the query fields in the storage framework for alltypes. Note that the information is still computed on-demand, so if e.g.the used disk space is not requested for the ‘file’ type, it won't be...
Make cluster initialization more reliable
There was a race condition between starting the node daemonand sending requests to write the ssconf files. With thispatch, the initialization waits up to ten seconds for thenode daemon to become responsive.
Don't show warnings on ADMIN_down instance failover
Before:$ gnt-instance failover -f inst1… checking disk consistency between source and target… - WARNING: Can't find disk on node node21.example.com… shutting down instance on source node
After:$ gnt-instance failover -f inst1...
Update NEWS
Add rapi_users changes, rearrange a bit and one wording change.
Add remote API users and passwords documentation
ganeti-rapi: Use new function to verify passwords
This enables the use of hashed passwords in rapi_users.
http.auth: Add new function to verify passwords
This new function supports two schemes for passwords:- Old-style cleartext passwords- Hashed passwords according to RFC2617 (H(A1))
Schemes are differentiated by their prefix, a concept alsoused in OpenLDAP. Cleartext passwords can no longer start...
Makefile.am: Add more checks to distcheck-hook
Also use grep only to convert find's output to an exit status.
Documentation updates
Our admin guide was very very trivial. This patch updates it to containadvice on when to use which commands, removes the instanceadministration part from the installation guide (moved to the adminguide), and adds a walkthrough document that should be useable as a...
Fix another style issue
For the Nth time, re-fix shadowing of outer-scope variable :)
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Make gnt-node list-storage more standard
This patch adds support for the -o+field,… format that the other listcommands accept and changes the format of the allocatable field fromsimply str(bool) to Y/N.
Rename the node storage commands
To reduce confusion, the following gnt-node commands are renamed:
- physical-volumes → list-storage- modify-volume → modify-storage- repair-volume → repair-storage
The NEWS file is update accordingly and it also gets emacs local...
Fix an error handling case in TLReplaceDisks
pylint is your friend, since the compiler doesn't exist.
Provide feedback from redistributing configuration
This is particularily useful for “gnt-cluster redist-conf”, butalso for all other cases where the configuration files arerewritten on other nodes.
$ gnt-cluster redist-conf… Copy of file /var/lib/ganeti/config.data to node … failed: Error while...
Include NEWS in documentation again
This was implemented in 350ecfecca and reverted in 700bb84367after it broke “make distcheck”. With other changes in thispatch series this will work now.
Contributing to the original problem was that the news.rst file...
Makefile.am: Wrap long lines
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
bash_completion: Move common code into function
This reduces the size of the script by about 9 kB.
Makefile.am: Use noinst_DATA instead of all-local target
Makefile.am: Don't include MAINTAINERCLEANFILES in EXTRA_DIST
Makefile.am: Make HTML doc building depend on stamp file
This patch also adds an explicit list of all files written bysphinx (“docoutput”).
By using an explicit list the build process is more predictableand will allow us to include the NEWS file again....
Makefile.am: Use dependencies to create symlinks only if necessary
Makefile.am: Move stamp-directories to BUILT_SOURCES
Fix gnt-debug breakage due to options move
Commits d3ed23f and 4eb6265 broke gnt-debug due to renamed optiontargets. Sorry again!
Fix gnt-node evacuate w. iallocator
Commit 2bb5c911 moved around and changed the _RunAllocator function inthe DiskReplace → TaskLet conversion, but in the process it changed therelocate_from argument from a list of nodes to just the secondary node.This breaks the protocol and current iallocator scripts....
InstanceIpToNodePrimaryIpQuery: use a query dict
In 95b487b we changed InstanceIpToNodePrimaryIpQuery to be able to querymultiple instances at once. We also need to be able to query ipsbelonging to a specific nic link, so what we do is:
1) Move the "query" argument to a dict, containing different fields...
SimpleConfigReader: ips are partitioned by link
We were already half-doing it, but this completes the process.
1) We don't maintain a list of ips or an ip->instance map2) We add a new link,ip->instance map (link->ips list we had)3) We add the link parameter to GetInstanceByIp (making it...
SimpleConfigReader: queries for default nicparams
GetDefaultNicParams returns the default nic parameters.GetDefaultNicLink returns the default nic link.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Import errors in confd init
It's used by some functions defined there.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Use RUN_IN_TEMPDIR in Makefile.am
Since we have this variable and use it in other places, remove the onlyleftover hardcoded place.
Allow '@' in tag values
This allows using an email address (as is) as part of a tag. The mainproblem that could arise is when parsing tags from a shell script, but(AFAIK) '@' is not a special character when used in values (happy to becorrected if not true)....
Fix gnt-node modify-volume
This was broken by me in 064c21f, sorry!
gnt-node: add short option -t for --storage-type
init script: allow singling out confd as well
Currently we can start/stop the various subdaemons, but not confd.
cmdlib._AssembleInstanceDisks: Fix case where variable wouldn't be set
The “result” variable may not be set and/or come from the previous loop.
Makefile: Use path from configure script for sphinx-build
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Ken Wehr <ksw@google.com>
KVM netscript: add static routes, with no suffix
The /32 suffix is useless, since the kernel already assumes single-host,if no suffix is specified. Moreover we prefer these routes to be"static" so that routing daemons, if present, won't mess with them....
gnt-job manpage: Remove detailed description for lock_status
The format changed in the meantime and should be self-explanatory.
Adding '--no-ssh-init' option to 'gnt-cluster init'.
Allows the initialization of a cluster without the creation or distributionof SSH key pairs. Includes changes for LeaveCluster and RPC.
Signed-off-by: Ken Wehr <ksw@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>...
Man page for ganeti-confd
KVMHypervisor: implement instance policy routing
Until now we relied on traffic from instances being policy routed via arule based on the instance network. With this change we can enforce iton the instance interfaces. Since the ip rules survive interface...
KVMHypervisor: configure v6 parameters on nic
In routing mode we are tweaking a few parameters on the interface. Withthis patch we'll tweak both the v4 and v6 ones.
confd: query the pnode of multiple instances at once
Signed-off-by: Flavio Silvestrow <flaviops@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Try to reduce wrong errors in InstanceShutdown
In backend.InstanceShutdown(), there is a race condition betweenchecking that the instance exists and trying to shut it down whichtranslates sometime in error messages like:
Tue Oct 20 20:08:30 2009 - WARNING: Could not shutdown instance: Failed...
Revert breakage introduced in e4e9b80
Commit e4e9b8064787df01a79846a40f49c8ae06a8eb0e introduced two problemsin backend.InstanceShutdown():
- first, it reduced the check interval significantly (especially for the first few checks); there are very few production VMs that shutdown in...
Xen: Ignore the retry argument in stop instance
Commit 4ad4511 changed the KVM hypervisor to send multiple shutdownrequests to the monitor, but it didn't change this for the Xenhypervisor. We simply remove the return on retry model, since we do wantto send multiple shutdown signals for both Xen and KVM (even if the...
Ensure RpcResult has “payload” attribute
Also add assertions to avoid missing attributes in the future.They won't be included in optimized bytecode.
Fix typo in install.rst
install.rst: mention xen config for live migration
This addresses issue 75.
Bump version to 2.1.0~beta2
I forgot to bump the configure.ac version before tagging the 2.1.0~beta1release. Since we cannot remove old tags (see “On Re-tagging” in git-tag(1)),we have to call this release 2.1.0~beta2.
Introduce checks for /sys and /proc
This patch adds checks for /proc and /sys in cluster verify, sinceGaneti relies on these special filesystems to be mounted.
Fix serializer unittests
Commit d22b29997cd broke the serializer unittests with certainversions of simplejson. This patch removes sort_keys againand implements a slightly more efficient way of detectingsimplejson functionality. The serializer unittests no longer...
cfgupgrade: Implement upgrade to 2.1.0
bootstrap: Factorize HMAC key generation
Make bootstrap._GenerateSelfSignedSslCert public
cfgupgrade: Remove Ganeti 1.2 support
This also fixes a few typos.
serializer: Sort keys in JSON
Bump version to 2.1.0~beta0
mcpu: Use new timeout class for timeout
locking: Convert pipe condition to new timeout class
locking.LockSet: Move timeout calculation to separate class
This class can also be used by mcpu.
locking, mcpu: Ensure timeout is always >= 0.0
locking.LockSet: Improve assertions
locking: Factorize LockSet.acquire
By moving the main code of LockSet.acquire to its own functionwe reduce the code complexity a bit and clarify the exceptionhandling.
This also fixes a case where a lock acquire timeout wasn'thandled correctly, leading to obscure error messages....
mcpu: Make sure added locks are released on errors
Test LockSet.acquire return value for timeout
opcodes: Add missing shutdown_timeout to OpRemoveInstance
luxi: Pass socket path directly to exception, not in tuple
Update NEWS for instance shutdown timeout
gnt-* use the correct opcode slot to build opcodes
gnt-* scripts were building wrong opcodes for commands which had theshutdown_timeout slot (due to missing testing after renaming). Fixing.
Also change SHUTDOWN_TIMEOUT_OPT dest field name to "shutdown_timeout":...
Update documentation for recreate-disks
This also clarifies the UUIDs NEWS entry.
rapi: fix tag operations
This patch fixes the tag PUT/DELETE operations, and additionally changesthe Tags* functions to take only positional and not keyword arguments(the defaults do not make any sense at all, and they are always calledwith all arguments)....
Update NEWS for Ganeti 2.1
Convert NEWS to ASCII
cli: add SHUTDOWN_TIMEOUT_OPT
Add timeout options to other LUs
All the LUs that shut down the instance need to be able too pass thetimeout parameter as well.
Update manpages for --shutdown-timeout
mcpu: Change lock attempt timeout calculation
With this patch all timeouts are pre-calculated. The interface ofthe _LockTimeoutStrategy class is also changed a bit; NextAttemptnow returns a new instance.
Code and docstring style fixes
Found using pylint and epydoc.
mcpu: Improve lock reporting with timeouts
mcpu: Implement lock timeouts
The timeout is always between ~0.1 and ~10.0 seconds. A smallvariation of ±5% is added to prevent different jobs fromfighting each other. After 10 attempts to acquire the locks witha timeout, a blocking acquire is made.
Lock status reporting will be improved in a separate patch....
mcpu: Remove unused exclusive_BGL attribute
locking.LockSet: Implement acquire timeouts
The timeout passed to LockSet.acquire() is measured over all lock acquires. IfLockSet.acquire fails to acquire all requested locks within the specifiedamount of time, all locks are released again and the acquire fails....
Update gnt-instance(8) for shutdown --timeout
Accept shutdown timeout from the user
Using the new --timeout option:
- gnt-instance shutdown is changed to accept a timeout- the opcode is changed to hold one- the LU is changed to optionally get one- the rpc is changed to carry one- the backend is changed to take it as a parameter rather than...
ChrootManager: clean StopInstance
Currently it has lots for duplicated code, and internal retries.Clean it up with the following assumptions:
We'll probably be called more than once.It is ok to fail to stop, unless we're called with force=True.If we're called only once, and with force=True it's ok not to run the...
cli: add a timeout option
KVMHypervisor: use the StopInstance retry feature
Since we know StopInstance is going to be called more than once (atleast twice, once with force and once without, but normally quite a lotmore) we don't need our own sleep/loop, and we can just send one monitor...
backend.InstanceShutdown: small cleanup
1) unhardcode the timeout, abstracting it in a constant2) Use time.time() rather than hiding the timeout in a range()3) call hyper.StopInstance multiple times -- currently all hypervisors just ignore all calls but once...
Add default instance shutdown timeout constant
It reflects the "current" two minutes we give to the instance.
Hypervisors: Add retry= to StopInstance
Currently some hypervisors need the stop operations to be retried morethan once, while other ones only do it in one pass. With this changewe'll handle retries outside the hypervisor code, but telling whetherthis is the first try or not....
Get rid of utils.CommaJoin
- We never remember to use it (5 uses vs 21 " ,".join())- It's longer to write than " ,".join()- The added value of the apostrophe in the string is not very much
ethers hook: allow more than one daemon pidfile
burnin: skip instance moves on single node
If we have only one node, instance moves fail, because it tries to movethe instance to itself. Skipping the operation, because in that case itdoesn't make sense.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Match instance and node names case insensitively
Since DNS cannot contain two names with different cases anyway, thisshould be ok.