History | View | Annotate | Download (28.4 kB)
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>
Add uuid attributes to configuration entities
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@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...
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).
Signed-off-by: Iustin Pop <iustin@google.com>...
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.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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....
Move FillDict at module level
This way it can be also used by scripts and other object types.
Change BEGR_DEFAULT to PP_DEFAULT
This way the same constant can represent the default profile also fornic, disk and OS parameters.
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,...
Add NIC.CheckParameterSyntax
This function will be used to check the NIC parameters for validity.Unittests are included.
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...
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...
Move the hypervisor attribute to the instances
This (big) patch moves the hypervisor type from the cluster to theinstance level; the cluster attribute remains as the default hypervisor,and will be renamed accordingly in a next patch. The cluster also gains...
Add cluster options from ssconf to configuration
ssconf will become write-only from ganeti-masterd's point of view,therefore all settings in there need to go into the main configurationfile.
Extend DRBD disks with shared secret attribute
This patch, which is similar to r1679 (Extend DRBD disks with minorsattribute), extends the logical and physical id of the DRBD disks with ashared secret attribute. This is generated at disk creation time and...
Add serial_no attributes to objects
This patch adds the ‘serial_no’ attribute to the other top-level objects(the configuration object itself, the nodes and the instances).
Extend DRBD disks with minors attribute
This patch converts the DRBD disks to contain also a minor (per eachnode) attribute. This minor is not yet used and is always initializedwith None, so the patch does not have any real-world impact - except forautomatically upgrading config files (it adds the minors as None, None)....
merge r1535 from branches/ganeti/ganeti-1.2
Add HVM device type flags 1/4
Cleanup old DRBD 0.7.x code
Apparently there were still some leftovers. While removing an instance,I got the message "unhandled exception 'module' object has no attribute'LD_MD_R1'".
objects: Remove config_version from cluster configuration
Allow disk object to set their own physical ID
Currently, the way to customize a DRBD disk from (node name 1, node name2, port) to (ip1, port, ip2, port) is to use the ConfigWriter methodSetDiskID. However, since this needs a ConfigWriter object, it can be...
Add method to update a disk object size
This patch adds a method that implements updating of a disk(object.Disk) size, together with its children.
While this will not track the exact disk size, it allows at least anapproximate size to be recorded in the configuration (and queried)....
Complete removal of md/drbd 0.7 code
This patch removes the last of the md and drbd 0.7 code. Cluster whichhave the old device types will be broken if they have this applied.
patch 1/4 extended HVM features for 1.2
This patch extends the config objects with the slots to handlemore HVM configuration items.
Author: schreiberalReviewed-by: iustinp,imsnah
Abstract the json functions into a separate module
This simple patch adds a new module that holds the simplejson functionsfor serialization/deserialization. This reduces the amount of redundantcode.
The patch also adds some normalizations to the json output:...
Modify Disk.GetNodes() to support LD_FILE
Codestyle fixes: adding a few empty lines
Add boot_order entry to Instance object.
First step to support custom boot device order for HVM instances, add alocation to actually store that information for the instance.
Add kernel/initrd paths to the instance object
This patch adds two new attributes to the instance object: - kernel_path - object_path
The code ignores them and the configuration handling is not broken bythis addition.
Add instance port support.
Extends the instance object by adding a port item, also adds changesto print this port via gnt-instance info.
Allow DRBD8 operation without backing storage
This patch adds the following functionality: - DRBD8 devices can assemble without local storage (done by allowing None in the list of children, and making DRBD8 to ignore all children if any is None)...
Add a support function to objects.Disk
This patch adds a function returning the device path if it is computablefrom the disk object (and we don't need to instantiate a bdev object onthe target node in order to compute this). Only LVs support this.
Create OS from an InvalidOS error
Add a new FromInvalidOS static function to objects.OS that makes it easy tocreate an object representing a broken OS starting from the relevant exception.
Reviewed-By: iustinp
Make the OS object able to represent broken OSes
Till now the OS object just represents a correct OS instance. Change it so itcan represent a broken one too, by adding a "status" field: if this field isdifferent from the OS_VALID_STATUS constant the object is considered to be an...
Revision 302 is broken, this fixes it
I forgot a pair of parentheses in that revision which break the commoncase. This patch adds them.
Fix printing of unconfigured DRBD devices
If the device is unconfigured (not yet did SetDiskID for it ever), itmight have a physical_id of None. This patch fixes that case.
Add a custom str() method for objects.Disk
This is done in order to easy debugging of disk-related issues.
Initial implementation of drbd8 template type
This is a partially working drbd8 template type. It does: - add/remove - startup/failover/shutdown
Not working is replace disks, which needs custom code for this template.
Abstract more strings values into constants
Currently, the disk types are defined using constants in the code.Convert those into constants so that we can easily find them and checktheir usage.
Note that we don't rename the values of the constants as they are used...
Remove the shebang from modules
Since modules are not directly executables, remove the shebang fromthem. This helps with lintian warnings.
Also make the autogenerated _autoconf.py contain two comment lines atthe beginning, like the other modules.
Fix super() calls for objects.Cluster
Use indenting if supported by simplejson.
Change configuration storage format from Pickle to JSON.
- Add NEWS file with major changes between versions.- Bump RPC version number- No longer serialize in RPC, but just convert to dict
Old Pickle based configuration files can be converted using the cfgupgrade...
Implement to/from dict conversion for ConfigObject(s)
This change allows instances of ConfigObject and its children to beconverted to and from standard python types. This will allow easierupgrade of the configuration and use of any serialization protocol (not...
Change class hierarchy in objects.py
It makes sense to make the TaggableObject a child of the ConfigObject,since in this case we can derive the Instance, Node and Cluster objectsonly from the TaggableObject and have a cleaner hierarchy.
For consistency child classes will have to declare their slots by adding...
Add slots on TaggableObject
Unless we use slots on all parents, we don't get the benefits thatslots bring. This patch adds this attribute to the TaggableObject sothat Instances, Nodes and the Clusters behave as intended.
Reviewed-by: schreiberal,imsnah
Add support for rename operation in the OS API
This patch adds support for renaming at OS level. Because of this, weneed to bump up the version of the OS api from 4 to 5.
The patch also documents the new script interface in theganeti-os-interface(7) man page and adds a section on upgrading the OS...
Add support for listing instance disk sizes.
Style changes for pep-8 and python-3000 compliance.
This changes the raising of exceptions from: raise Exception, valueto raise Exception(value)
as the first form will be removed in python-3000 and the second form ispreferred now.
The changes also involve a few cases of changing from raising standard...
Implement tag support for cluster, nodes and instances.
This is only the backend part, from the command line the tags can't beread/modified yet.
Implement setitem for ConfigObject to add container protocol compatibility.
Move the cluster name from ConfigWriter to SimpleStore.
Reason: if left ConfigWriter, nodes don't know to which cluster they belong.This will bite us later when we'll revisit node join operation.
Cons: we lose the cluster name from the config file, which means a...
Comment formatting updates.
The master_node is no longer stored in the config file (but in sstore)and all users have been converted, let's remove it from the slots of thecluster object.
Also let's move the tcpudp_port_pool to the cluster object.
Get ports from configuration if there are some.
Initial commit.