History | View | Annotate | Download (48.8 kB)
objects.Cluster: Add property for primary hypervisor
This is useful for working with a node's hypervisor state, where onlythe primary hypervisor will be authoritative.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add basic support for disk parameters
objects.py: * add disk parameters to Disk, Cluster, NodeGroup.
constants.py: * add dictionaries that will hold types and default values for disk parameters (for now, empty).
test/ganeti.constants_unittest.py:...
Add objects for disk/hv state
- Data objects- Serialization/deserialization- Unittests
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
objects.Node: Add static hv/disk state
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Remove BE_MEMORY from beparams but keep compatibility
Queries are already compatible (be/memory is an alias for be/maxmem) andimport/exports work. This patch patch fixes it for cluster init, modifyand instance add/start/modify.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
beparams: add min/max memory values
For now the new "memory" parameter stays there, but it will be removedlater. The new values are just taken from the old one, in this patch.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Rename admin_up to admin_state
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add use_external_mip_script cluster parameter
Add the use_external_mip_script cluster parameter, that representswhether the master IP address turnup/turndown procedures must use ascript provided by the user (True) or the one provided by Ganeti(False)....
Adding basic elements for the new node params
This patch adds the new fields to the objects.py as well as defines theconstants used in the dicts and their type.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add master_netmask to Cluster.UpgradeConfig
And also suppress pylint R0902 error about an object instance havingmore than 20 attributes.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add object representing the master network params
Rename filter and filter_ to qfilter
We currently use 'filter' as the OpCode, QueryRequest and RAPI fieldname for representing a query filter. However, since 'filter' is abuilt-in function, we actually have to use filter_ throughout the codein order to not override the built-in function....
Add cluster netmask parameter
Add the master_netmask cluster parameter, that represents the netmask ofthe master IP, encoded as a CIDR suffix.
This parameter can be set via the --master-netmask of gnt-cluster initand gnt-cluster modify. The default behaviour is to be consistent with...
Make migration RPC non-blocking
To add status reporting for the KVM migration, the instance_migrate RPCmust be non-blocking. Moreover, there must be a way to represent themigration status and a way to fetch it.
Merge branch 'devel-2.5'
Add SPICE support to gnt-instance console
Also update related unit tests.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
PEP8 style fixes
Identified using the “pep8” utility.
Allow importing instance with full auto parameters
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix broken object references in docstrings
The module is called “objects”, not “object”.
masterd: Add support for tagging node groups
Fix shared_file_storage_dir on upgrades
If the cluster was upgraded from 2.4 or earlier, this key won't exist(it's only set to a correct value on cluster init), so we need toproperly set it to a null string (disabled).
Signed-off-by: Iustin Pop <iustin@google.com>...
Shared block storage support
This patch introduces basic shared block storage support.
It introduces a new storage backend, bdev.PersistentBlockDevice, touse as a backend for shared block storage. The new bdev requires a newBLOCKDEV_DRIVER_MANUAL constant with the value "manual" and uses it as...
Merge branch 'stable-2.4'
Core shared file storage support
This patch introduces core file storage support, consisting of the following:
A configure-time switch for enabling/disabling shared file storagesupport and controlling the shared file storage location:--with-shared-file-storage-dir=. Shared file storage configuration is then...
1-char comment typo fix
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
query: Add support for field description
Merge branch 'devel-2.3' into devel-2.4
Improve import/export timeout settings
With this patch, the exporting node will retry to connect a few times.The receiving node will make use of the master's increased timeout (seeprevious patch).
Fix growing of DRBD disks
Patch 03941a26 made disk growth VG-aware, but the code has a bug: itonly works for LD_LV disks, and not LD_DRBD. To fix it, we add ageneric function to compute the per-VG growth requirements, and switchto using that instead of manual build....
objects: Fix off-by-one in error message
For an instance with a single disk the message should be “… disks 0 to0”, not “… 0 to 1”.
Introduce verbose opcode result for console
With this patch OpConnectConsole will no longer just return a commandwith arguments, but rather a detailed description about how to connectto an instance's console. Unittests for some parts are included. Another...
Add new Node attribute powered
This is just a state of record field and does not necessaryreflect the reality.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add the "alloc_policy" attribute to node groups
This can be set at group creation time and via OpSetGroupParams. The defaultis "preferred", and existing node groups from previous Ganeti version willget the attribute set to this value.
Signed-off-by: Adeodato Simo <dato@google.com>...
objects: Add custom de-/serializing code for query responses
… and use them in cmdlib.
objects: Add definitions for query requests and responses
Also update description of QueryFieldDefinition.name.
objects.py: fix minor error in NodeGroup.SimpleFillND docstring
The defaults are filled in from the node group defaults, not clusterdefaults (presumably copy & paste error).
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
config.py, objects.py: more node group support
In particular:
- add AddNodeGroup and RemoveNodeGroup in config.py
- refactor _UpgradeConfig to make use of _UnlockedAddNodeGroup
- add support for objects.NodeGroup in ConfigWriter.Update; add missing...
Remove bridge NIC slot
This has been deprecated and unused since 2.1.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Make rpc.call_lv_list() VG-aware
Changes to backend.GetVolumeList():- now accepts a list of VGs instead of one VG- returns LV names in the form "vg_name/lv_name"
Corresponding changes are done in: VerifyDisks, VerifyNode,LUCreateInstance (for both disk creation and adoption cases)...
objects: Add QueryFieldDefinition
backend: Add support for IPv6 in import/export
Adding oob_program in the same style as beparams
Add the master/vm_capable flags to objects
This adds the flag and some initial handling. The rest of the changes,for cmdlib, come in a separate patch.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Rename node.nodegroup to node.group
In the context of a node, its group has (at least today) only onemeaning, that is the node's node group. As such, we renamenode.nodegroup to just node.group.
Note: if we want to keep node in there, it should be at least...
Add prealloc_wipe_disks as a cluster-wide configuration variable
This is the first step for the support of wiping block devices priorto creation of the instance.
Merge branch 'devel-2.2'
Conflicts: lib/objects.py (trivial, strange that this one, and only this one, conflicted)
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Rename the _oss cluster vars to _os
Per the mailing list discussion, rename _oss to _os, both in cluster parametersand in the rest of the code.
This is just an s/_oss/_os, with the exception of a small bit of cleanuparound the helper_os function in cmdlib.py....
Add two new cluster settings
The new variables are:
- a list of hidden OSes, that should not be displayed to the users in interactive selection (e.g. reinstall); however, if they are selected, they can be used- a list of OSes that should be hidden and blocked from install-time selection...
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....
Split a long docstring line in objects.py
Add node's nodegroup field
If a node doesn't have a node group we'll upgrade the config making itthe cluster default. Also the node add and removal operations arechanged to set/clear the node group correctly. Finally we populate the"members" list of nodegroups on config load with the value from the...
Add a 'nodegroups' slot to ConfigData
Also: - reformat the slots declaration of ConfigData - call UpgradeConfig on each node groups to handle future upgrades - add nodegroups special case in {To,From}Dict - add nodegroups to _AllUUIDObjects
_ContainerFromDicts: handle None source
When _ContainerFromDicts is called on some element which doesn't existin the config, because it is yet to be upgraded, it will receive itsvalue as None. We take care of this case by using an empty element ofthe required target type....
Add a new NodeGroup config object
The "members" slot of this object is not serialized, and is discardedwhen deserializing, initializing it explicitly to [].
Cluster.UpgradeConfig: populate primary_ip_family
Add new cluster parameter primary_ip_version
We expose the ip_version (4, 6) to the external interface and internallywe convert it to ip_family (AF_INET=2, AF_INET6=10). This makes the codemore concise as all functions deal with family rather than version....
Introuce a new cluster parameter - reserved_lvs
This parameter, which is a list of regular expression patterns, willmake cluster verify ignore any such LVs. It will not prevent creation orremoval of such volumes by the backend code.
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.
Add os api v20 and related fields to the OS object
Fix parameter names in SimpleFillBE/NIC docstrings
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.
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
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...