History | View | Annotate | Download (537.3 kB)
Fix TLMigrateInstance use of IAllocator
hail now expects correctly that relocate_from is of equal length withthe number of required nodes (fixme: there's a lot of not welldocumented behaviour here… not nice for any other potentialIAllocators). As such, we need to pass just the instance's primary...
ipolicy: Keep track of spindle usage
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
iallocator: Add the spindle_usage to iallocator
This adapts the Ganeti side to export the spindle_usage
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)...
Remove a superfluous warning in LUNodeRemove
Since we run the post-hooks explicitly in the Exec() function (via_RunPostHook) after we removed the target node from the config, wewill get a:
WARNING Node 'node2', which is about to be removed, was not found in...
Small update to LogicalUnit.ExpandNames docstring
… to make even more obvious what's the difference between a declaredlock level with an empty list of locks and no lock level.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Export ndparams in iallocator
Strangely, these were not exported at all before.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix breakage introduced by fa6dd6bb56
Forgot “enumerate”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
LUInstanceSetParams: Update disk's “iv_name”
When modifications are made, disks may not have the same index anymore.Updating all disks fixes this.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
ApplyContainerMods: Fix issues with indices
When adding an item the index given to the callback function would beincorrect under certain conditions. This patch also adds assertions andmore tests.
cmdlib: Remove some users of “iv_name”
cmdlib: De-duplicate code in _GenerateDiskTemplate
There has been a lot of duplicated code in _GenerateDiskTemplate,and some cases of very similar, but not quite same duplicates. Thispatch merges them.
Generating a disk's “logical_id” attribute is done via a...
Add unittest for cmdlib._GenerateDiskTemplate
This is in preparation to de-duplicating significant chunks of code incmdlib._GenerateDiskTemplate.
cmdlib: Fix “unpack non-sequence” error
The callback is expected to return a two-valued tuple.
ApplyContainerMods: Return changes from callbacks
… instead of passing the list of changes as a parameter.
LUInstanceSetParams: Convert to generic algorithm for NIC/disk changes
Unfortunately this got a bit messier than I intended, but then again itcleans up a lot of messy code with heaps of local variables(“this_nic_override”) and LU attributes (“nic_pnew”, “nic_pinst”). Most...
cmdlib: Add generic algorithm for modifying NICs/disks
While preparing this patch series I identified at least three differentimplementations of the algorithm for adding/removing/changingNICs/disks. These two functions and corresponding unittests provide a...
LUInstanceSetParams: Assertion on disk template/disk changes
Disk changes aren't allowed at the same time as a disk template change.
Merge branch 'stable-2.5' into devel-2.5
Re-added constant mistakenly removed in 58f0ce16873
“INSTANCE_DOWN” is still being used.
LUInstanceSetParams: Allow no-op change of instance offline status
With this patch marking an instance already marked offline (or online)as offline/online again becomes a no-op. Also removed the unusedINSTANCE_UP variable.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
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...
N+1: verify using minimum memory
Since instances can be started, failed over and migrated with less thantheir maximum memory N+1 will use the minimum memory for verification.
Note that this accounts only for the instances being moved beingresized, and not for the ones already on the node, as ganeti will not...
Use allow_runtime_chgs in cmdlib
- Report the attribute value in the hooks runtime variable.- Use it to abort migration if not enough memory is available on the target node.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Migrate/Failover: allow less-than-max-mem op
Failover works magically after we relax the check: the start operationwill just use less memory, if less memory is available.
For migrate we need to balloon down the source memory before themigration, if the target node doesn't have enough capacity....
Failover and Migrate: acquire node resource locks
cmdlib._CheckNodeFreeMemory: return free memory
Export the cluster ipolicy in iallocator
And remove a strange comment (the commit which introduced it,d61df03e, doesn't explain it). Also document these new keys iniallocator.rst.
Add new ipolicy parameter vcpu_ratio
This adds the new parameter and changes the validation routines tohandle IPOLICY_PARAMETER value as floats. Very very ugly code :(,should be redone much cleaner.
Rename IPOLICY_PARAMETERS to IPOLICY_ISPECS
As opposed to the initial situation, the PARAMETERS will be more thanjust the min/std/max ispecs. Let's rename it, before re-adding thePARAMETERS constant with a different meaning.
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix cluster verification issues on multi-group clusters
This patch attempts to fix a number of issues with “gnt-cluster verify”in presence of multiple node groups and DRBD8 instances split over nodesin more than one group.
- Look up instances in a group only by their primary node (otherwise...
gnt-instance recreate-disks: Allow specifying new size
With this change a new disk size can be specified when recreating disks.
LUClusterSetParams: When ipolicy is updated warn for new violations
We need to loop over all node groups to apply their modification to makesure that the new ipolicy actually affects their instance
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>...
LUGroupSetParams: Warn if the new ipolicy will violate some ipolicies
If we modify the ipolicy we need to verify if any instance would nowviolate the new ipolicy and warn about it. Any instance which alreadyviolates the old one is ignored.
Signed-off-by: René Nussbaumer <rn@google.com>...
cmdlib: Add a helper function for a set of violating instances
This helper will be used with the Op*SetParams and ipolicy verifications
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Implement rbd disk template
Introduce the rbd disk template, which handles provisioning andmanagement of instance disks as block devices mapped to rbd volumeson a RADOS cluster.
The rbd template is of type DTS_EXT_MIRROR, meaning rbd-basedinstances can failover or migrate to any node, without...
Fix iallocator group objects
… this is yet another manual serialisation of objects :(
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
LUInstanceRecreateDisks: Actually acquire node resource locks
Before this change an assertion would fail as the resource locks weren'tactually acquired.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
cmdlib._CheckInstanceState: Use instance name in error message
The variable “instance” is an instance object, so to not get aserialized version of the instance, the “name” attribute must beused.
cmdlib: Drop use of “len(…) != 0”
Found by Constantinos Venetsanopoulos.
Merge branch 'devel-2.5'
Conflicts: lib/cli.py - trivial lib/cmdlib.py - merge new condition
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Migrate: don't check for free memory on cleanup
Cleanup just updates the config with the correct location of theinstance, or informs of its down status, but never starts it. As suchthere's no point in checking for enough free memory. Actually this check...
LUInstanceStartup: check for minimum memory
Instance startup: lock primary node
This will be used to balloon other instances on the node if needed.
gnt-instance modify -m|--runtime-memory
TLReplaceDisk: Add ipolicy checks
Further fixes to instance policy validation
As a followup from "Remove extraneous check in policy creation", thereare more places where we build an ipolicy, and then manually check forits validity. This is very bad style, as it duplicates theverification code across many places....
Add new disk_templates parameter to instance policy
This is a bit more complex patch, as it requires changing theassumption that all keys in the policy dict points to values that arethemselves dicts. Right now we introduce an assumption that anynon-dicts are lists, we'll see in the future if this holds or whether...
Fix handling of errors from InstancePolicy.Check...
This code raises a configuration error, but we need to transform itinto a prereq error (or possibly exec error), depending on when wecall this function.
Fix acquisition of node lock in LUInstanceGrowDisk
Ensure node level locks are recalculated properlyin LUInstanceGrowDisk.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cmdlib: _VerifyInstancePolicy has been replaced and is dead code
This removes this method
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
cmdlib: Rename _CheckMinMaxSpecs to _ComputeMinMaxSpec
This is to reflect the fact that _Check functions do raise Op*Errorwhich is not the case for _CheckMinMaxSpec.
LUInstanceCreate: Release node resource lock
… after running iallocator. Otherwise an assertion later in the codewould fail (for a good reason).
_CheckTargetNodeIPolicy: instance.primary_node is not objects.Node
cmdlib: node.group is not a nodegroup object
LUInstanceCreate: self.disks is a dict not a disk object
InstanceStartup: use overridden beparams in prereq
Without doing this memory checks happen on instance default parametersrather than any overridden ones.
Merge branch 'devel-2.4' into stable-2.5
gnt-node: Add instance policy to migrate
cmdlib: Adapt LUClusterVerifyGroup for instance policy
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
cmdlib: Adding helper for instance policy
Fix cluster destroy failure
Cluster destroy would fail if there were errors while deactivating themaster IP address. This patch demotes such errors to warnings, allowingthe cluster to be destroyed even if the master IP address turndownfails.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>...
gnt-node: Add hv/disk state to add
gnt-group: Add hv/disk state to add
Add the remaining DRBD dynamic sync disk params
Add the c-plan-ahead, c-fill-target, c-delay-target, c-max-rate,c-min-rate parameters; report errors while setting thesynchronization speed.
Change the error signaling model of SetSyncParams. Instead of returning...
Add the dynamic-resync DRBD disk parameter
constants.py, cmdlib.py:- add the dynamic-resync parameter, both at DT and LD levels;
lib/bdev.py:- change SetSyncSpeed to SetSyncParams, and _SetMinorSyncSpeed to _SetMinorSyncParams;- use the dynamic-resync parameter....
Empty ipolicy fix
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
SimpleFillIpolicy corrected
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Change constants: ISPECS suffixes to prefixes
GroupSetParam supports instance policy changes
AddGroup supports instance policy
Group query now calculates ipolicy
Verification of instance policy for gnt-cluster verify
Introduce instance policy on nodegroup level
Cluster-level instance policy - other
SetClusterParams supports instance policy changes
Add net-custom and disk-custom DRBD parameters
Those parameters can be used to pass options directly to drbdsetup diskand drbdsetup net.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add the metavg DRBD disk parameter
This parameter represents the default metadata volume group for DRBDdisks. It can be overridden at instance creation time using the metavginstance disk parameter.
Move LD parameters constants to the LDP_ namespace
Add the LDP_ prefix to the LD parameters-related constants, in order toavoid pollution in the global constants namespace.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add new back-end parameter "always_failover"
Instances that have this parameter is set to True are never migrated, butinstead they can only fail over. There are some cases where freezing thekernel may cause problems, and hence this behavior is preferable....
gnt-cluster: Allow modify disk/hv state
gnt-group: Allow modify disk/hv state
gnt-node: Allow modify disk/hv state
cmdlib: Adding hv/disk state dict helper functions
cmdlib: Adding _UpdateAndVerifySubDict helper
This helps with 2 dimensional dicts.For example the hv_state and the disk_state dicts.
Add DRBD barriers disk parameters
Add the disk-barriers and meta-barriers parameters described in thedesign doc.
cmdlib: Make use of cluster's new “primary_hypervisor” property
LV stripes parameters for plain and drbd
Add DRBD8 static resync speed disk parameter
Use disk parameters in Logical Units
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:...
More fixes after commit 78519c106
A quick QA run successfully finished with these changes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Change “node_info” RPC to accept multiple VGs/hypervisors
Keeping the node state up to date will require information from multipleVGs and hypervisors. Instead of requiring multiple calls this changeallows a single call to return all needed information. Existing users...