History | View | Annotate | Download (291.3 kB)
LUSetNodeParams: autopromote self when needed
If we're de-offlining or de-draining a node we need to promote it to MCif we have not enough, or the config will be corrupt.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Abstract self-promotion decision
During node add we decide whether to self promote to an MC. Abstractthis decision making to a separate function.
Fix master candidate removal
Currently during a master candidate removal, when it's possible topromote another node, the removal operation fails because of a corruptconfig before it's even possible to do the promotion. Fixing this bydoing the promotion before, excluding the current node....
LUSetNodeParams: Don't break config on mc demotion.
If --force is used to demote an MC, but then there are not enough MCs inthe cluster, the configuration gets corrupted until a node is promoted.
In order to avoid that we only allow demotion with --force if the node...
Master candidate stats, return one more value
Other than returning the current number of candidates, and the number ofdesired and possible candidates, we also return the maximum possiblenumber, even if greater than our desires. All callers for now ignore...
Merge remote branch 'origin/master' into mogu
Fix the confusing ssh/hostname message in node add
Before, it used to say:
ssh/hostname verification failed node1.example.com -> hostname mismatch, got node2
Now it says for wrong hostnames (maybe too verbose):
ssh/hostname verification failed (checking from node1.example.com): hostname...
Merge commit 'origin/next'
Export and show the cluster uuid in cluster info
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Implement uuid in gnt-node/instance list and info
The patch modifies LUQueryInstanceData to return the uuid too and alsoadds support for it in the gnt-* scripts.
Simplify handling of regular fields in LUQuery*
For fields that correspond directly to an object's field, we cansimplify the handling. The patch also adds the new 'uuid' fields toobjects so that it can be queried.
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix _RemoveDisk for file based instances
During 621b7678 two typos were introduced which prevent file basedinstances removal to work correctly. Fixing both of them to what theywere meant to be.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cmdlib._CreateDisks fix a broken result.Raise
The format string has the ": %s" at the end, but no argument is passed,which of course raises a TypeError. Removing ": %s" as it's added bythe RpcResult Raise() method anyway.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Remove RpcResult.RemoteFailMsg completely
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add an error-simulation mode to cluster verify
One of the issues we have in ganeti is that it's very hard to test theerror-handling paths; QA and burnin only test the OK code-path, sinceit's hard to simulate errors.
LUVerifyCluster is special amongst the LUs in the fact that a) it has a...
Introduce parseable error codes in LUVerifyCluster
Currently the output of cluster verify can be parsed for 'ERROR'messages, but that is the only indication we get (error or no error). Inorder to allow monitoring tools to separate different error conditions,...
Remove RpcResult.failed attribute
It's redundant with RpcResult.fail_msg. This change survived QA, burnin andunittests.
Replace last hardcoded 'nodelist' with NV_NODELIST
LUAddNode has this usage remaining, as it's the only other LU to usecall_node_verify (beside LUVerifyCluster).
RpcResult: Fix cases where “failed” wouldn't be set to True
This broke “gnt-instance replace-disks --auto” when the instanceis down.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Merge commit 'origin/next' into branch-2.1
Wrap lines over 80 characters
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
cmdlib: Fix typo in variable name
Add check for duplicate MACs in instance add
Currently LUAddInstance doesn't check for duplicate MACs, and it failsduring the Exec() phase when trying to add the instance to the config(ConfigWriter checks for this). This patch copies the code fromLUModifyInstance (which already does it)....
Use ReadFile/WriteFile in more places
This survived QA, burnin and unittests.
Conflicts: lib/cmdlib.py: Trivial
Return cluster tags from LUQueryClusterInfo
Merge branch 'next' into branch-2.1
Add file to pause watcher for a certain duration
This can be used during maintenance work.
cmdlib: Add some messages to LUExportInstance
LUDestroyCluster: hooks support
We're going to call hooks from its Exec method so LUDestroyCluster has tosupport them.
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
LUDestroyCluster: run hooks
Run post hooks on master node before it's removed.
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
LURemoveNode: no logs running post on removed node
Do not log results from hooks ran on the removed node as now it's done byRunPhase.
node-remove post on removed node
Run post phase of node-remove on the removed node as well.
Fix error output in LUSetClusterParams
Before: gnt-cluster modify --enabled-hypervisors=xen-hvm,xem-pvm Failure: command execution error: Enabled hypervisors contains invalid entries: set([u'xem-pvm'])
After: gnt-cluster modify --enabled-hypervisors=xen-hvm,xem-pvm...
Add OPMoveInstance and LUMoveInstance
This patch adds a basic version of LUMoveInstance. It doesn't yetsupport iallocator-mode and it's implemented in old-style (non-TL) mode.
Add arbitrary node support to create/remove disks
Currently the cmdlib _CreateDisks and _RemoveDisks always work on theinstance's (current/primary) nodes. This patch extends them to take anadditional target_node parameter denoting that the creation/removal...
cmdlib: Fix broken QueryInstanceData for plain instances
Fixes this bug:Failure: command execution error:Can't compute disk status for instX.domain.tld: No error information
repair-size: ensure child disks have sane sizes
While this patch doesn't do a full match of on-disk size to config-sizefor child devices, it does a sanity check (for DRBD only) that the childsize is not less than the DRBD size. While this would be a strange...
Add support for querying the ctime/mtime
This patch adds querying of ctime/mtime for the cluster/nodes/instances.
Add opcode to repair storage volumes
cmdlib: Add function to list all instances on node
cmdlib: Use common function to list instances on node
This will be used by another new function, too.
cmdlib: Make TLReplaceDisks._FindFaultyDisks global
It'll be used for repairing storage units.
Implement instance recreate-disks
This can be used for a 'plain' type instance when the underlying storagewent away, to recreate the storage (and reinstall) instead of removingthe instance and readding it.
Fix checks in LUSetNodeParms for the master node
There was a check already in the LU for the master node, however iswasn't correct. This patch disallows any role changes on the master nodevia LUSetNodeParms (and as this LU can't change anything else, it...
TLReplaceDisks: Refuse changing secondary for specific disks
We move all disks anyway.
cmdlib: Add new automatic disk replacement mode
TLReplaceDisks: Simplify argument checking logic
Ignore results from drained nodes in iallocator
Since drained nodes could be (partially or fully) broken in iallocator,we ignore results from these nodes when building the cluster map inpreparation for sending it to the script.
This is a cheap change for the stable branch; ideally we should not...
Fix yet another bug in LURepairDiskSizes
This is a result of broken copy-paste, and because needed_locks is not adict right here it will error out.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Post cluster initialization LU
Add an 'empty' logical unit to run hooks after cluster initialization.
Fix a bug in LURepairDiskSizes
The same old story: disks need SetDiskID before being sent to remotenodes.
Add cluster-init --no-etc-hosts parameter
If --no-etc-hosts is passed in at cluster init time we set a newparameter in the cluster's object to false, and avoid adding nodes tothe hosts file. The UpgradeConfig function is used to set the value toTrue, when upgrading from an old configuration version....
Merge branch 'master' into next
Convert ldisk_degraded to tri-state value
This allows us to report “uncertain” states (LDS_UNKNOWN) for caseswhere the code can't easily detect or report what's wrong with ablock device.
Handle None result from BlockdevFind
objects.BlockDevStatus: Remove ToLegacyStatus
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
export: add meaningful exit code
Currently ‘gnt-backup export’ always returns exit code zero, even in theface of complete failure during backup (only failure to stop/start theinstance will cause job failure and thus non-zero exit code). This isbad, since one cannot script the backup....
Use objects for blockdev_getmirrorstatus RPC call result
This patch changes the return type for backend.BlockdevGetmirrorstatus froma list of tuples to a list of objects.BlockDevStatus instances.
Use object for blockdev_find RPC call result
This patch changes the return type for backend.BlockdevFind to an object(objects.BlockDevStatus). Before a tuple was used. Adding more values tothis tuple causes a lot of work. Converting the result to an object with...
Implement gnt-cluster check-disk-sizes
This patch adds a new opcode and lu for checking disk sizes. Currentlyit does only top-level disk verification, and also doesn't checkprimary/secondary node size mismatches (these two are added as TODOs inthe Exec() function of the LU)....
Implement --ignore-size in activate-disks
This patch modified OpActivateDisks, LUActivateDisks and gnt-instanceactivate-disks to support and pass this option to_AssembleInstanceDisks.
The patch is quite trivial I think; there should be no issues from it...
Add ignore size support in _AssembleInstanceDisks
This patch adds an optional parameter to _AssembleInstanceDisks thatallows ignoring of size information by making a copy of the diskstructure and setting the size to zero.
cmdlib: Fix parameters for storage.FileStorage
It wants a list of directories, not a string.
cmdlib: Add opcode to modify storage unit fields
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add new opcode to list physical volumes
cmdlib: Change tasklet logging to debug level
cmdlib: Add new opcode to migrate node
It migrates all primary instances from the node to their secondaries.
cmdlib: Add logging for tasklets
cmdlib: Fix tasklets handling if no tasklets are added
If no tasklets are added, self.tasklets evaluates to None. The LU baseclass will throw an exception because it thinks the derived class doesn'timplement the right methods.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Extend call_node_start_master rpc with no_voting
When the parameter is set to True and start_daemons is also True,ganeti-masterd will be started with the new --no-voting --yes-do-itoptions.
This new option is set to True only on masterfailover, when no_voting is...
cmdlib: Add init to Tasklet class
cmdlib: Move LUMigrateInstance functionality to tasklet
Add new opcode to evacuate nodes
cmdlib: Convert _DiskReplacer to tasklet
cmdlib: Function to get all secondary instances on a certain node
cmdlib: Add tasklet support to logical unit base class
cmdlib: Add tasklet base class
Generate a shared HMAC key at cluster init time
This key is shared on all nodes (via cmdlib._RedistributeAncillaryFiles)and will be used for HMAC authentication of confd messages.
cmdlib: Move code doing disk replacements into separate class
This class will be used for a new opcode to evacuate nodes.
cmdlib: Pass config and rpc objects directly to IAllocator
Before IAllocator would access them using “self.lu.cfg” and “self.lu.rpc”.It shouldn't know about the internals of the LU.
Yet another fallout from the pylint fixes
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Fix another issue with hypervisor_name change
Make sure enabled_hypervisors list is valid
Get rid of the default_hypervisor slot
Currently we have both a default_hypervisor and an enabled_hypervisorslist. The former is only settable at cluster init time, while the lattercan be changed with cluster modify.
This becomes cumbersome in a few ways: at cluster init time for example...
cmdlib: Use dict.fromkeys instead of custom loop
Conflicts:
daemons/ganeti-masterd...
_GenerateDiskTemplate: use base_index in the name
Currently if a disk is added later the base_index is not considered, andall the disks are called disk0. This patch fixes it.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
cmdlib: Fix typo in LUQueryClusterInfo
This was broken by my pylint fixes patch.
Fix pylint warnings
Fix some typos
Cleanup config data when draining nodes
Currently, when draining nodes we reset their master candidate flag, butwe don't instruct them to demote themselves. This leads to “ERROR: file'/var/lib/ganeti/config.data' should not exist on non master candidates...
Fix node readd issues
This patch fixes a few node readd issues.
Currently, the node readd consists of two opcodes: - OpSetNodeParms, which resets the offline/drained flags - OpAddNode (with readd=True), which reconfigures the node
The problem is that between these two, the configuration is inconsistent...
Fix error message for extra files on non MC nodes
Currently the message for extraneous files on non master candidates isconfusing, to say the least. This makes it hopefully more clear.
Merge branch 'master' into branch-2.1