Remove physical_id field from disk object
The 'physical_id' field of disk objects is no longer used, so remove it.Also, all references are removed together with the code which made surethat the physical_id is up to date when transmitted over RPC.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Replace physical_id with dynamic_params
The disk field 'physical_id' has to be kept up to date whenever a diskobject is sent to a node via RPC. This is done with the SetDiskID methodmanually, which is a source of bugs.
This patch replaces the use of 'physical_id' with a new field names...
Fix typo
Fix typo in comment.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Handle $(python_scripts) and tools/burnin as python scripts
With the new private-module layout, python scripts using theganeti module must end up in $(versionedsharedir) in orderto see this private module.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Provide PYTHONPATH to burnin
One feature of the new private-module layout is that a pythonscript cannot simply 'import ganeti'. The reason is that theinterfaces to these modules are not stable and hence should notbe used outside Ganeti. However, this is what the burnin test...
Export VERSIONEDSHAREDIR to _autoconf.py
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
Fix 'AutoConf.hs.in' template substitution
Fix 'AutoConf.hs.in' template substitution, namely, change 'SOCAT' to'SOCAT_PATH' to match the value used in the invocation of 'm4' in thetarget 'src/AutoConf.hs' in 'Makefile.am'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Also install the version-dependent links forcefully
In this way, with default configuration options, runningmake install twice in a row succeeds. Fixes issue 567.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Hs2Py constants: update 'SF_*' references
Update references to storage field Python constants to fetch theirvalues from 'lib/_constants.py'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Hs2Py constants: add storage fields
Add storage fields constants to the Haskell to Python constantgeneration. These constants fetch their values from the Haskell datatype 'StorageField'.
Move 'StorageField' to 'Ganeti.Types'
Move 'StorageField' to 'Ganeti.Types' in order to break thecircularity of 'Ganeti.Rpc' and be able to generate constants fromthis Haskell data type.
Fix 'TOOLSDIR' when passed to 'src/AutoConf.hs'
Remove trailing parenthesis in 'TOOLSDIR' 'configure' variable whenpassed to 'm4' to generate 'src/AutoConf.hs'.
Improves allocation parameters check in move-instance
If the target cluster has a default iallocator, no allocation paramsare needed. The parameter checks take this into account and do notshow errors anymore.
Signed-off-by: Hrvoje Ribicic <riba@google.com>...
Move-instance can now change the disk template while moving
By using the --dest-disk-template option, the move-instance utilitycan change the disk template of the moved instance on-the-fly.This is done by simply altering the disk template of the instance...
Hs2Py constants: update Python references
Update references to the Python constants generated in the previouspatch.
Hs2Py constants: add constants from types
Add the constants to the Hs2Py constant generation from the Haskelldata types moved in the previous patch.
Move data types from 'Objects' to 'Types'
Move several Haskell data types from 'Ganeti.Objects' to'Ganeti.Types' in order to be able to generate constants whileavoiding module circularity.
Fix conflicting path values from 'configure'
Because the Hs2Py constant generation infrastructure is transitional,there are two generated 'autoconf' modules, namely, 'src/AutoConf.hs'and 'lib/_autoconf.py'. However, conflicting values were beinggenerated for Haskell and Python concerning the variables...
Fix constants for OOB commands
Fix values of the constants for OOB commands, namely, 'oobPowerOn' and'oobPowerCycle'.
The $(gnt_python_sbin_SCRIPTS) are GENERATED_FILES
Before the layout change, the corresponding scripts used to bepart of PYTHON_BOOTSTRAP, hence were already considered asgenerated.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>...
Merge branch 'stable-2.9' into master
For exported paths, use the canonical ones
Some paths set that are set at configure time are needed at runtime. These are exported by the Makefile. Change this to export the"canonical", unversioned, ones. This also has the advantage, thattools do not have to know which programs are python scripts (where,...
Update description of --enable-symlinks
As most of the symlinks in our setup are, in fact, independentof the Ganeti version, they can be installed unconditionally. Sothe --enable-symlinks configure option now only controls a smallnumber of symlinks that decide which version of Ganeti is used....
Adapt the version-dependent symlinks to the new design
With the latest change of our update design, there are only twosymbolic links left, that are specific to a particular version.Those are only installed, if requested.
Add the version-independent symbolic links
According to our new upgrade design, a couple of links areversion-independent, and should be installed always.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Make version granularity a configure option
From 2.10 onwards, all files are installed into versioneddirectories. As everything stays compatible between revisions,it is not technically necessary, to have revisions included inthe directories. Nevertheless, there are situations where this...
Adapt the base directories according to new layout
The file layout described in the upgrades design document has changed.Adapt the base directories accordingly.
Update Python references to all constants added in the previous patch,which are the constants associated with the Haskell types declared in'Ganeti.Types'.
Hs2Py constants: add constants from 'Ganeti.Types'
Add to Hs2Py constant generation all constants that are defined by theHaskell defined declared in 'Ganeti.Types'. This patch also fixes atype inconsistency between Haskell and Python, namely, the constant...
Fix alloc related constants value
Fix alloc related constants to fetch their value from the respectiveHaskell types, which are defined in 'Ganeti.Types'.
Add 'Ganeti.Types.OobStatus' for Hs2Py constants
Add 'Ganeti.Types.OobStatus' which is the Haskell counterpart to the'OOB_STATUS_*' Python constants.
Add 'PyValue' instance for triple
Add 'PyValue' instance for triple which is necessary for the'CvErrorCode' related constants.
Fetch 'randomUuidFile' from 'ConstantUtils'
In 'Ganeti.Utils', update the reference to 'randomUuidFile' to fetchthe value from 'Ganeti.ConstantUtils' instead of the Python to Haskellgenerated constant. This allows breaking the dependency of'Ganeti.Utils' on the constants module, which in turn will allow...
Fix indentation
Fix indentation to match Haskell coding conventions.
Fix missing constructors to 'CvErrorCode'
Data type 'Ganeti.Types.CvErrorCode' is missing several constructors,namely, 'CvEINSTANCEUNSUITABLENODE', 'CvEGROUPDIFFERENTPVSIZE','CvENODEDRBDVERSION', and 'CvEINSTANCEMISSINGCFGPARAMETER'. Thisfixes issue 580....
Add constructor 'TagKindNetwork' to 'TagKind'
Add missing constructor 'TagKindNetwork' to 'Ganeti.Types.TagKind'which is the counterpart of the Python constant 'TAG_NETWORK'. Thisfixes issue 578.
Rename 'ExportModeRemove' to 'ExportModeRemote'
In "Ganeti.Types", rename constructor "ExportModeRemove" of"ExportMode" to "ExportModeRemote". This fixes issue 577.
Fix 'NICMode' missing 'NIC_IP_POOL'
Fix, in 'Ganeti.Types', data type 'NICMode', which is missing aconstructor which is the counterpart of the Python constant'NIC_IP_POOL'. This fixes issue 576.
Change all types in 'Types' to use String
Haskell types should be the source of information related toconstants. Therefore, instead of building the Haskell types from theconstants, the constants should be taken from the Haskell types. Thispatch updates all the types defined in 'Ganeti.Types' to follow this...
Add missing exports in 'Ganeti.Types'
Add missing exports in 'Ganeti.Types' which are necessary for'Ganeti.HsConstants'. These exports concern the '*ToRaw' functionswhich convert a Haskell type into JSON. These functions are needed bythe constants which we want to generate from Haskell to Python based...
Hs2Py constants: add xen related constants
Add xen related constants, such as, 'xenBootloader' and 'xenCmdXm' tothe Haskell to Python constant generation.
Hs2Py constants: add 'devConsole' and syslog related
Add 'devConsole' and syslog related constants to the Haskell to Pythonconstant generation.
Add Template Haskell 'declareLADT'
Add 'declareLADT' in Template Haskell module to declare Haskelldatatypes using 'String's directly as values for the JSONserialization, as opposed to 'Name's which is what the current'declareADT' allows. To achieve this, 'genFromRaw' must be...
Fix strings invalid with newer lint versions
Generating ASCII characters via a supported but not official escape sequenceleads to a "Anomalous backslash in string" error in newer pylint versions. Thispatch fixes the issue.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Update Python references to exit code constants
Update Python references to exit code constants to take their valuesfrom the generated 'lib/_constants.py'.
Haskell to Python constants: add exit code constants
Add exit code constants to Haskell to Python constant generationinfrastructure. The module 'Ganeti.ConstantUtils' must be importedqualified in order to avoid a clash between'Ganeti.ConstantUtils.exitFailure' and...
Update Python reference to 'DAEMONS_LOGBASE'
Update Python reference of 'DAEMONS_LOGBASE' to fetch its value fromthe generated 'lib/_constants.py' module.
Haskell to Python constants: add 'daemonsLogbase'
Move constant 'DAEMONS_LOGBASE' from Python to Haskell to beautomatically generated.
Flip dependency between Haskell types and constants
Before this patch, Haskell types, such as, 'GanetiDaemon' and'GanetiGroup', and related functions were taking their values fromHaskell constants. However, given that the role of Haskell to Pythonconstants is to leverage Haskell and its typesystem, it makes sense to...
Replace import in 'Ganeti.Path'
Given that Haskell has its own generated 'AutoConf' module, it makessense that other Haskell modules import 'configure' variables directlyfrom 'AutoConf' instead of importing the Python to Haskell generatedconstants.
Fix missing dependency on 'src/hs2py-constants'
Fix missing dependency on target 'src/hs2py-constants' in'Ganeti.ConstantUtils'.
Further tests for LUNodeAdd
This patch adds tests for the remaining functionality of LUNodeAdd.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add unittests for OpenvSwitch in LUNodeAdd
This patch adds node_unittest.py containing the framework for unittesting LUNodeAdd.At this point, only test setup and tests for OpenvSwitch areimplemented.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>...
Replace more IPs with reserved adresses
Recently, some IP addresses were changed to TEST-NETs from RFC 5737.This patch changes some more occurences of wrong IPs and replaces them.
TEST-NET-1 is used for primary_ips, TEST-NET-2 for networks and TEST-NET-3 for...
Mock RPC for unit tests
This patch enables patching the rpc module to create a mocked versionwhich can be used to mock a rpc.DnsOnlyRunner(). This is needed forunit testing LUNodeAdd, as it need to run RPCs against nodes not yetpresent in the configuration....
Fix incorrect conflict resolution in lib/cmdlib/instance.py
Between the last two merges, nothing happened on stable-2.9. Theonly change on stable-2.8 that touched lib/cmdlib/instance.py isff34fb97. So make sure, the net change since the last merge tothis file is that of the said commit. This also fixes the doclint...
Merge branch 'stable-2.8' into stable-2.9
Version bump for 2.8 rc3
Also, add to the NEWS file a couple of items that were still missing.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Merge branch 'stable-2.7' into stable-2.8
Fix incorrect manpage reference to htools
the manpages for hcheck, hinfo and hroller have an incorrect referenceto htools(7) which does not exist. This patch links them to htools(1).
This bug also fixes Debian BTS#721824 (http://bugs.debian.org/721824)...
Add a default to file-driver when unspecified over RAPI
The file-driver value, used by file-based instances, had a default value whenan instance was being created over the CLI, but not when the instance wascreated through the RAPI.
This patch introduces a default value for the remote API and, while doing so,...
Fix monitoring daemon extra log filepaths
Haskell constants 'daemonsExtraLogfilesGanetiMondAccess' and'daemonsExtraLogfilesGanetiMondError' cannot be constants becausetheir Python counterparts are calculated through'pathutils.GetLogFilename', which indirectly depends on the...
Fix lint errors in fix keyerrors patch
This patch fixes one lint error introduced by my recent patch tofix keyerrors in lib/cmdlib/node.py.
Fix example IPs and hostnames in tests
Our tests are a form of documentation, and hence should useIPs from the TEST-NET ranges according to RFC 5737. They definitelyshould not use real public IP addresses.
Similarly, example host names should be from one of the reserved...
Remove typo from RAPI documentation
"be used instead." was repeated twice.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Fix keyerrors in cmdlib node
This patch fixes potential key errors in the OpenvSwitch implementationin cmdlib/node.py. The checks in that file expected to have a ndparams dictwith certain keys to be present. This should not be the case as it willresult in KeyErrors when those keys are not present....
design update: symlink structure
Update the upgrade design document according to the outcomeof the design discussion at GanetiCon 2013. There are twochanges in the design.
Make CPUload Data Collector aware of clock ticks
Modify CPUload data collector to get the number of clock ticksper second from Posix.Unistd. Since CPUload collector convertsclock ticks (jiffies) to seconds and the clock ticks to secondsratio varies between linux distributions, it must be read from...
Add shelltest for the --ignore-dynu option of hbal
In the example, we have two nodes and 6 instances, all using externalstorage. There are four small instances on one node, and two biginstances, requiring twice the amount of resources of a small instance,...
Make hbal support the option --ignore-dynu
This will allow to do balancing based only on static information.In particular, the effect of balancing towards same number ofinstances per node that the dynamic usage consideration hasif no usage file is provided, can be turned off, if this is...
Make ExtLoader honor the --ignore-dynu option
Make the external data loader correctly honor the --ignore-dynu optionby clearing the dynamic utilisation data from all instances if the optionis given.
Provide utility function to clear utilisation data
Using this utility function, the dynamic utilisation of all instancescan be set to 0. This will have the effect of all utilisation being ignored.
Define a new option --ignore-dynu
This option, if set, will tell htools to ignore any dynamicuse data.
Describe the files in doc/users in NEWS
While only a small feature, the files in doc/users can influencethe way ganeti is packaged. Hence it should be mentioned in thenews file.
Update the upgrade procedure
Now that users-setup asks for confirmation, explain in theprocedure how asking for this confirmation can be skipped.This skipping is particularly important for users followingthe recommendation of using the distributed shell (dsh)....
Add unit test for LUInstanceQuery and -QueryData
This patch provides rudimentary unit test coverage for LUInstanceQueryand LUInstanceQueryData.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add unit tests for LUInstanceMigrate and -Failover
This patch adds rudimentary unit test coverage for LUInstanceMigrate andLUInstanceFailover.
Add unit tests for LUInstanceChangeGroup
This patch provides unit test coverage for LUInstanceChangeGroup.
Use RpcResult.Warn where appropriate
Those two occurrences of warnings can be replaced the RpcResult.Warnmethod, which is done in this patch.
Remove unneeded except block
The validation of the opcodes already checks the size parameter for theright type, so this except block is not required.
Rename variable to reflect its content
Rename the "node" variable to "node_uuid" as that's the content itactually receives.
Add unit tests for LUInstanceSetParams
This patch adds unit tests for LUInstanceSetParams. It does not provide100% coverage, but covers a significant portion.
Fix testMasterNetmask in TestLUClusterSetParams
The netmask was previously wrongly given as a bitmask, now it's given asthe net prefix length.
Fix missing dependency in 'src/hs2py-constants'
Fix target 'src/hs2py-constants' because it must depend on'src/AutoConf.hs'. Fixes issue 573.
Update reference to Python constants
Update reference to 'DAEMONS_PORTS' and related constants that areused on the Haskell side to construct the 'daemonsPorts' constant.
Add 'daemonsPorts' and related constants
Add 'Protocol' datatype
Add 'Protocol' datatype which is necessary for the 'daemonsPorts'constant.
Fix instances of 'PyValue'
Fix instances of 'PyValue', namely, for tuples and maps.
Update references to Python constants
Update references to the Python constants introduced by the previouspatch.
Haskell to Python constants: more constants
Make tools/users-setup explain its actions first
Before doing any changes, make tools/users-setup explain itsactions first, and ask the user for confirmation. If the firstargument is --yes-do-it, this step will be skipped.
Generate tools/users-setup from descriptions
Now that we have a machine readable description of the usersto be added to the system, use it to generate the tools/users-setupscript, so that we again have only one authoritative source ofthe user and group requirements. This also has the advantage of...
Provide ganeti user and group data in easy-to-parse form
Upon build time, also generate, in the directory doc/users, filescontaining the groups, the users with their primary group, and theadditional groupmemberships to be added. In this way, packages can use...
Inconsistent auto repair related constant
In 'lib/constants.py', fix inconsistency in the value of'AUTO_REPAIR_TAG_SUSPENDED'. Fixes issue 569.
Update constant references
Update Python user separation constants to reference the generatedmodule 'lib/_constants.py' instead of 'lib/_autoconf.py'.
Add user separation constants
Add user separation constants, such as, 'daemonsGroup', 'rapiGroup',and 'rapiUser', to the Haskell to Python constant generationinfrastructure.
Add target 'AutoConf.hs'
Add Makefile target to generate 'AutoConf.hs' and add this file to'.gitignore'.
Add AutoConf.hs.in
Add 'AutoConf.hs.in' which is the template for generating the file'AutoConf.hs'. This file mimics the Python equivalent'lib/_autoconf.py' and it is necessary for Haskell constants to beable to retrieve their values from 'configure'....