History | View | Annotate | Download (63.9 kB)
IP pool related objects, opcodes and constants
Config objects: * Introduce L{Network} with - IPv4 network field (mandatory) - IPv4 gateway, IPv6 (network/gateway), mac prefix, type (optional) * Modify existing config objects to support networks: - Add new slot 'network' to L{NIC} config object...
backend: Check for shared storage also
If normal file storage was disabled but shared storage enabled,“_TransformFileStorageDir” would still throw an exception.
in “opcodes._CheckStorageType” there's also a check, but I wasn't quitesure what the correct way of handling it was, so I added a TODO comment....
Pylint cleanup
The previous commits introduced some pylint errors.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Make validation error message more useful
Provide a custom Validate for OpInstanceMultiAlloc
This is needed, as we're not strictly separating validation frompopulating the defaults. We do this all in one function. If we nowreceive a non complete OpInstanceCreate opcode in instances, we wouldrun into AttributeErrors on those....
Adding the new opcode for multi-allocation
Skeleton for the multi-allocation opcode
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adapt gnt-debug iallocator
Add the new multi-alloc request to the test allocation framework. Fornow we just create --count identical instances. This might need furtherimprovements later.
Make the slots functionality more modular
As we will introduce another set of containers using the slots trickwe abstract away as much as possible to separate bases classes. Thechild classes then adapt them for their needs. This leads to less code...
Merge branch 'devel-2.6' into submit
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
Fix gnt-debug iallocator
There was an issue with the recent ipolicy introduction which lead to abug in gnt-debug iallocator. It was not providing the spindle_use fieldand therefore it wont let you create a valid iallocator request.
Signed-off-by: René Nussbaumer <rn@google.com>...
Allocator support in recreate-disks LU
This affects only the backend.
Signed-off-by: Adam Ingrassia <api@google.com>Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'stable-2.6'
9Add wait_for_sync flag to OpInstanceActivateDisks
This can be used to ensure that after activate-disks has returned, theinstance's storage is consistent; currently there's no programmaticway to do this.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add summary field to OpNodeModifyStorage
Fix inconsistent punctuation in rapi docs and opcodes
While reviewing the RAPI docs (for commit 003306f9), I realised thatthe punctuation used in RAPI is inconsistent, especially with regardsto definition lists.
This patch changes all such lists to not have punctuation, except for...
Add 'absolute' grow-disk mode at OpCode/LU level
This also improves the log messages for the (default) relative mode("by %s to %s").
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Ensure that the grow disk amount is positive
The CLI currently doesn't permit this, but a direct job submissionwould allow it.
Add opcode parameter descriptions
Fixes QA after commit cfdf561dade7.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Chris Schrier <schrierc@google.com>
Stop using locks in LUXI "QueryTags"
Also mark it as deprecated in NEWS as normal queries can be usedinstead.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge remote-tracking branch 'origin/devel-2.5'
Conflicts: Makefile.am (trivial, test data files added on both branches) lib/opcodes.py (trivial, master renamed filter→qfilter, 2.5 fixed the type of the parameter)...
opcodes: Remove dependency on query module
There's no need to verify the field definitions on every query. They arestatic for all intents and purposes anyway and verified at module loadtime.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add result checks for OpTags*
opcodes: Annotate the OP_RESULT of query operations
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
opcodes: Add result checks for OpBackup*
opcodes: Fix OP_RESULT for OobCommand
The result is a list of a list with elements with size of 2.
opcodes: Adding missing OP_RESULTs
OpInstanceSetParams: Make two type checks public
They'll be used for tests in cmdlib.py.
OpInstanceSetParams: Accept more flexible NIC/disk modifications
Start accepting a new form of NIC/disk modifications for adding/removingarbitrary NICs/disks. Unlike before the index must always be given. Anindex of “-1” stands for the last item.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
opcodes: Add comments to two parameter tests
These comments appear in the RAPI documentation.
Merge branch 'stable-2.5' into devel-2.5
Add stricter checks for OpInstanceSetParams.{nics,disks}
Add ht.TMaybeListOf type check
Replaces some uses of TOr(TNone, TListOf(…)).
Stricter check for OS modifications passed to OpClusterSetParams
Don't just check the first element of each item, but also make sure theOS name is a string and not empty.
Fix type check for OpQuery.filter
Just using ht.TListOf as a type check doesn't work correctly. Thefunction must be called with the expected item type. In this specificcase TListOf was always called with the filter as a value, and theresult of that call evaluated to truth. Since filters can be quite...
OpInstanceSetParams: Merge {off,on}line_inst parameters
Instead of having two separate parameters, a single boolean parameter isused. Unfortunately we need a third state to say “no change”, so thevalue can be None, True or False (similar to other parameters). There...
cli/opcodes: add a --no-runtime-changes migrate opt
This will be used for now to avoid ballooning memory at live migration time.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
doc/rapi.rst: Document ipolicy parameter
gnt-instance recreate-disks: Allow specifying new size
With this change a new disk size can be specified when recreating disks.
gnt-instance modify -m|--runtime-memory
TLReplaceDisk: Add ipolicy checks
gnt-node: Add instance policy to migrate
gnt-instance: Adding instance policy to add
gnt-instance: Adding verification of instance policy to modify
gnt-instance: Adding instance policy to move
gnt-instance: Adding instance policy to migrate
gnt-instance: Adding instance policy to failover
gnt-node: Add hv/disk state to add
gnt-group: Add hv/disk state to add
opcodes: Extend description of “depends” parameter
The documentation string is used in the RAPI description andhaving more details is good.
GroupSetParam supports instance policy changes
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
AddGroup supports instance policy
SetClusterParams supports instance policy changes
gnt-cluster: Allow modify disk/hv state
gnt-group: Allow modify disk/hv state
gnt-node: Allow modify disk/hv state
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:...
Merge branch 'devel-2.5'
Separate OpNodeEvacuate.mode from iallocator
Until now the iallocator constants for node evacuation(IALLOCATOR_NEVAC_*) were also used for the opcode. However, it turnedout this was due to a misunderstanding and is incorrect. This patch addsnew constants (with the same values) and changes the affected places....
Transition into and out of offline instance state
Document OpNodeMigrate's result for RAPI
- Commit b7a1c8161 changed the LU to generate jobs- Mention documented results in NEWS
Add --use-external-mip-script flag
- add a command line flag to gnt-cluster init and modify to change the value of the cluster parameter use_external_mip_script;- add two constants representing the paths of the default script and of the external script;...
OpGroupVerifyDisks: Fix wrong result type declaration
If an instance had actually a missing disk, the type check would fail.
opcodes: Add comment to *SetParams result description
Explicitely say that the second element of the tuple is the new value.
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 --ignore-errors parameter to cluster verify
lib/cli.py- add IGNORE_ERROR_OPT;
client/gnt_cluster.py- pass the ignore_errors parameter to the opcodes
lib/opcode.py- update OpClusterVerifyConfig, OpClusterVerify and OpClusterVerifyGroup to accept the ignore_errors parameter...
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...
Add gnt-cluster commands to toggle the master IP
RAPI: Add resource to recreate instance's disks
This was still missing from RAPI.
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.
Disk template is no longer required when importing instance
… provided that disk_template value is set in the config.ini file.
Signed-off-by: Agata Murawska <agatamurawska@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Allow locking to be used via OpQuery
The original design for query2 specifically excluded locking, but nowit's turned out that it would be a good thing to have in watcher. Thispatch adds a new parameter to OpQuery and enables its use in LUQuery. Amissing function is added to LUGroupQuery, a comment clarified in...
opcodes: Add more result checks, add some comments
Some of these will be used by the RAPI documentation.
Clarify job ID-related type checks, add unittests
Instead of a rather complicated expression only “JobId” is output. JobID lists (like generated by “SubmitManyJobs”) are limited to two-itemlists. Unittests are added.
Change OpClusterVerifyConfig's result, verify results
This patch removes the list of node groups (not used anymore sincecommit fcad7225e3fc) from OpClusterVerifyConfig's result and adds resultverification to all OpClusterVerify* opcodes.
Use LU-generated jobs for verifying cluster
This patch moves the logic for verifying the various node groups in acluster into the master daemon. Job dependencies are used to ensure theconfiguration, which requires the BGL, is verified first.
With this change it will be possible to expose whole-cluster...
opcodes: Use variables for verification parameters
Just some cleanup before the 2.5 release.
Use resource kind as OpQuery*'s description
This gives a hint as to what's queried. “QUERY” or“QUERY” are way better than just “QUERY”.
Remove iallocator's “multi-evacuate” mode
It is no longer used and has been deprecated in 2.5.
Add opcode to change instance's group
This is quite similar to evacuating a group, but the lockingis different.
Fix lint errors
It turns out that the only use of the operator module was foritemgetter, so patch eb62069e should have removed that import too.
Add two more compat functions
operator.itemgetter(0) → fstoperator.itemgetter(1) → snd
snd is not used yet, but it makes sense to add both.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add ht-based result checks to opcodes
This adds the infrastructure necessary to check opcode results usinght-based functions. Checks are added for two opcodes.
Change OpClusterVerifyDisks to per-group opcodes
Until now verifying disks, which is also used by the watcher,would lock all nodes and instances. With this patch the opcodeis changed to operate on per nodegroup, requiring fewer locks.
Both “gnt-cluster” and “ganeti-watcher” are changed for the...
Add opcode attribute for comments
This attribute allows programmatic submitters of jobs (e.g. iallocator)to add a comment to each opcode, describing its purpose. Example:
$ gnt-job info 123Job ID: 123 … Opcodes: OP_INSTANCE_REPLACE_DISKS …...
Add new opcode for evacuating group
jqueue: Implement submitting multiple jobs with dependencies
With this change users of the “SubmitManyJobs” interface can userelative job dependencies. Relative job IDs in dependencies are resolvedbefore handing the job off to the workerpool.
Implement chained jobs
An overview is available in the design document for this change,doc/design-chained-jobs.rst.
When a job enters the job processor, the current opcode's dependenciesare evaluated. If a referenced job has not yet reached the desired...
Add opcode attribute for chained jobs
Merge branch 'devel-2.4'
ht: Add new check for numbers
Places which receive floats can usually also deal with integers, e.g.OpTestDelay. Tests are added and the new check function is used for theaforementioned opcode and verifying query results.
Add gnt-instance start --pause
Creates the instance, but pauses execution before booting. This combinedwith 'gnt-instance console' unpausing instances means that the entireboot process can be viewed and monitored.
Signed-off-by: Stephen Shirley <diamond@google.com>...