History | View | Annotate | Download (35.6 kB)
Add default_iallocator cluster parameter
Add a cluster parameter to hold the iallocator that will be used by defaultwhen required and no alternative (manually-specified iallocator ormanually-specified node(s)) is given.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>...
Set drbd usermode helper on config upgrade
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Generalize a recursive check on logical disks
Add drbd_usermode_helper to configuration
Better specify old object slots removal policy
The comments seem to imply we can remove deprecated slots after 2.1 isreleased. This is not quite true, if we still want to support upgradingstraight from 2.0. So let's specify better that they can be removed only...
Add OS parameters to cluster and instance objects
The patch also modifies the instance RPC calls to fill the osparameterscorrectly with the cluster defaults, and exports the OS parameters inthe instance/OS environment.
Signed-off-by: Iustin Pop <iustin@google.com>...
Add os api v20 and related fields to the OS object
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix parameter names in SimpleFillBE/NIC docstrings
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Remove a TODO
Since OS objects are not stored in the configuration, we cannot putos_hvp there, therefore the TODO is obsolete…
Add cluster.SimpleFill*() functions
Currently, the existing cluster.Fill* functions take as argument aninstance. This means that in any case where we don't have an actualinstance object, we have to resort to calling the low-levelobjects.FillDict function....
backend: Add support for import/export magic
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
import/export daemon: Record amount of data transferred
This reports the amount of data transferred and the throughput (averagedover 60 seconds) to the master daemon. While not yet fully implemented,once the export scripts report the expected data size, we can even provide...
Allow control of import/export compression method
For exports to/imports from the same machine, compression willnot be used anymore.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Put common import/export daemon options into object
The X509 key name and CA are passed from cmdlib all the way tothe backend import/export daemon. With the addition of an optionto choose the compression method, another parameter would haveto be passed all the way. By moving these options to a separate...
Merge branch 'devel-2.1'
Conflicts: doc/security.rst trivial lib/cli.py trivial
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add daemon for instance import and export
This backend daemon for instance import and export will be used totransfer instance data to other machines. It is implemented in a genericway to support different ways of data input and output. The third-partyprogram “socat”, which is already used by the KVM hypervisor abstraction,...
Add uid_pool cluster parameter
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Merge remote branch 'devel-2.1'
objects.Cluster: add method to get hv defaults
Currently the FillHV method is the one that does the cluster hvparams +os hvparams merger. However, in some cases we need to do just this,without adding the instance hvparams on top.
This patch adds a function to compute just this (hv + os hvp...
Add a new cluster parameter maintain_node_health
This will be used to conditionally enable the watcher node maintenancefeature.
SerializableConfigParser: Make Loads class indep
Currently SerializableConfigParser.Loads is a static method that returnsa SerializableConfigParser. With this patch we change it to a classmethod that returns a member of the class. This way a subclass calling...
Allow file storage to be grown
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge remote branch 'origin/devel-2.1'
Add support for per-os-hypervisor parameters
This patch implements all modifications to support per-os-hypervisorparameters in the framework.
Signed-off-by: René Nussbaumer <rn@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add caller-validation on Disk.StaticDevPath
Since in objects we don't have access to utils.py, we add a warning thatthe result value from objects.Disk.StaticDevPath might not be a validpath, and change its only caller to validate the path.
Add command line options for instance removal on export
Fix dumpers/loaders after slots cleanup
Commit 154b958 changed (correctly) the slots usage, but this brokedumpers/loaders since we relied directly on the own class slotsfield.
To compensate, we introduce a simple function for computing the slots...
Fix slots definitions
According to http://docs.python.org/reference/datamodel.html#slots
Merge branch 'devel-2.0' into devel-2.1
Conflicts: lib/backend.py - trivial merge...
Ensure all int/float conversions are handled right
int()/float() can raise either ValueError (in case of int("a")), orTypeError (in case of int(None)). We had many bugs over time due tothis, and a recent one was just diagnosed, so we go over the codebase...
pylint cleanups: dangerous initializers
Plus a silence for a wrong "uninitialized var".
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Add targeted pylint disables
This patch should have only:
- pylint disables- docstring changes- whitespace changes
Add targetted pylint disables
This patch adds targeted pylint disables, where it makes sense (eitherdue to limitations in pylint or due to historical usage), and also a fewblanket ones in rapi where all the names are… “different”.
NIC.CheckParameterSyntax: fix bridged check
We should match for the strings to be the same "==" not to point to thesame memory location with is, or we skip the actual check.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Fix pylint 'E' (error) codes
This patch adds some silences and tweaks the code slightly so that“pylint --rcfile pylintrc -e ganeti” doesn't give any errors.
The biggest change is in jqueue.py, the move of _RequireOpenQueue out ofthe JobQueue class. Since that is actually a function and not a method...
Introduce 'global hypervisor parameters' support
This patch adds support for global hypervisor parameters in instancecreation, instance modification, instance query and at instance loadtime.
We basically prevent any query on these parameters, discard them at load...
Convert the rest of the OpPrereqError users
This finishes the conversion of OpPrereqError creation to two-argumentstyle. Any leftovers as one-argument are not breaking anything, justlosing information about the errors.
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)....
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>...
Add slot and constant for supported OS variants
The slot will contain a list of variants, and the variants file constantcontains the file in the os dir which is supposed to hold the list.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Change config upgrade to be explicit
Currently the config upgrade is done at each object instantiation, thatmeans that ganeti-noded will run UpgradeConfig on all objects receivedremotely (instances, disks, nics). This is not so good, so this patchchanges it so that only the ConfigWriter runs this method at...
Add uuid attributes to configuration entities
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Even more style fixes
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Add ctime/mtime support to the main ConfigObjects
This patch adds ctime/mtime support to the “main” config objects - theconfig data itself, and the cluster/nodes/instances objects.
These are not added on auto-upgrade, but rather should be migrated if it...
Remove obsolete ConfigObject.__setitem__
setitem is used to emulate container objects. We don't use this, andthe method is not used in a couple of normal operations (add/removeinstance, add/remove disk).
Merge commit 'origin/next' into branch-2.1
Upgrade be/hv params with default values
From time to time we're adding new be or hv parameters. With this patchmissing parameters get set to the default value when loading the clusterobject. This patch version also considers the case when hv/be params...
objects: add configuration upgrade system
Add a very basic configuration update mechanism to objects.An object can define the UpgradeConfig method, which will be called atinit time, and use it to fill in missing defaults in the configuration.In the future we may want to make it more complex, for example adding...
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
Confd{Request,Reply} objects
These objects are used to store confd queries and replies.
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.
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>
ConfigObject.ToDict() only export non-None values
The method is changed to a normal loop, to avoid calling getattr()twice. Also getstate is changed to just use ToDict() by default.
This should also make getstate work for objects which have tooverride the ToDict function because they contain other objects....
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...
Add a objects.Disk.UnsetSize() method
This method recursively resets the size of the disk and its children tozero.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add a Copy method to object.ConfigObject
This small patch adds a simple Copy method that is can be used for'throw-away' copies of objects.
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...
Merge branch 'next' into branch-2.1
Fix pylint warnings
Fix various pylint warnings
There were multiple issues: - copy-paste resulted in wrong indentation - wrong function name - missing spaces around assignment - overriding built-in names (type, dir) or already defines ones (errors, hypervisor)
Specify the object type in two docstring
Remove old invalid-os related functionality
We no longer need OS objects to be able to represent invalid OSes. Thiscleans up the code handling those cases.
Remove bridge and default_bridge from objects
These values are deprecated, and not used in 2.1 anymore.The slots are still there to allow auto-upgrading from 2.0.
Add nicparams to the NIC object
Also populate nicparams with a sensible default for imported instances.Unfortunately we don't know if the bridge set up in old nics is thedefault one or not, and we don't have access to the config clusterobject here to verify, so we'll just copy it without questions....
Cluster: add nicparams, and update them on upgrade
This also migrates the default bridge from the cluster object to the nicparams, at load time. Since we don't support changing the default bridgeafter cluster init, this is ok for now. In the future we'll make...
Add NIC.CheckParameterSyntax
This function will be used to check the NIC parameters for validity.Unittests are included.
Abstract Param upgrade from cluster.UpgradeConfig
A new UpgradeGroupedParams is used to upgrade all the profiles for oneparameter filling in the default values, or creating the whole dictanew, should it be missing. This is used only for beparams, currently,...
Change BEGR_DEFAULT to PP_DEFAULT
This way the same constant can represent the default profile also fornic, disk and OS parameters.
Move FillDict at module level
This way it can be also used by scripts and other object types.
Don't allow spaces in tag names
This patch restricts the use of spaces in tags, as this does not allownice exporting of tags to environment in hooks. One can use underscoresor dashes instead of spaces.
Reviewed-by: schreiberal
Handle better broken disks
While running burnin: File "/usr/lib/python2.4/site-packages/ganeti/objects.py", line 497, in str val += ", size=%dm)>" % self.sizeTypeError: int argument required
This happened while handling another error, so we lose the original...
Add a ‘drained’ attribute to node objects
This attribute will be used to prevent any allocation on the node (anyof replace-disks with new secondary this node, failover to the node,migration to the node).
The patch adds the attribute and initializes it correctly in cluster...
Implement disk verify checks in config verify
This patch adds a simple check that the 'mode' attribute of top-level disks iscorrect. It does not recurse over children.
The framework could be extended with other checks in the future.
Reviewed-by: imsnah
Change the instance status attribute to boolean
Due to historic reasons, the “should run or not” attribute of aninstance was denoted by its “status” attribute having a string value ofeither ‘up’ or ‘down’. Checking this is in code was done via hardcoding...
Update the objects.Disk formatting method
With the addition of minors, this needs to show them too.
Reviewed-by: ultrotter
ConfigObject docstring, close an open parenthesis
Reviewed-by: iustinp
Fix non-drbd instance creation
Commit 2294 introduced a new instance.all_nodes property, whichunfortunately is working incorrectly for non-drbd instances.
This patch fixes it by making sure the primary node is always added tothe set, even before recursing over (any potential) children....
Small simplification in MapLVsByNode
We don't need to pre-create the node entries in lvmap, since they willbe created at recursion time.
Instance: add a new all_nodes property
Since we often need the list of all nodes of an instance, we add a new"all_nodes" property that returns all nodes of the instance, and weswitch secondary_nodes to a simpler implementation based on this newfunction....
Fix epydoc format warnings
This patch should fix all outstanding epydoc parsing errors; as such, weswitch epydoc into verbose mode so that any new errors will be visible.
Add a new node parameter 'offline'
This patch adds a new node parameter called offline that will be used tomark nodes which should be touched by commands.
We also add this flag at cluster init, node add, and export it toiallocator scripts.
Add cluster candidate pool size parameter
This patch adds a new cluster paramater "candidate_pool_size" whichtracks the desired size of the list of nodes with the master_candidateflag set.
Introduce a new 'master_candidate' node attribute
The field is not yet used.
Change GrowDisk to work with multi-disk
This patch changes the instance.FindDisk method to take index arguments(instead of iv_names), and changes GrowDisk and list instancesaccordingly.
Initial multi-disk/multi-nic support
This patch adds support for mult-disk/multi-nic in: - instance add - burnin
The start/stop/failover/cluster verify work as expected. Replace diskand grow disk are TODO.
There's also a change gnt-job to allow dictionaries to be listed in...
Set default hypervisor at cluster init
During cluster init, set the default hypervisor to be used for instances.Ensure that the default hypervisor belongs to the set enabled hypervisorsfor this cluster. Also fix a small bug with setting the default enabled...
Remove old instance attributes
Switch instance hypervisor parameters to hvparams
This big patch changes instance create to the new hvparams structure.Old parameters are removed, so old jobs or old instances file will breakcurrent clusters.
Add the hv/be params object attributes
This patch adds the instance and cluster be/hvparams attributes, and theFill* methods on the cluster object. Nothing else is changes, exceptthat these attributes exist now on the objects.
OS API: support for multiple versions in an OS
Allow multiple api versions in an OS. This is according to the OS APIchanges design doc, by which an OS can support multiple versions of theGaneti API and if one is supported by Ganeti it will work. Since up to...