History | View | Annotate | Download (521.8 kB)
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.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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).
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
_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.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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...
Merge branch 'devel-2.5'
Merge branch 'stable-2.5' into devel-2.5
LUGroupAssignNodes: Fix node membership corruption
Note: This bug only manifests itself in Ganeti 2.5, but since theproblematic code also exists in 2.4, I decided to fix it there.
If a node was assigned to a new group using “gnt-group assign-nodes” the...
Fix pylint warning on unreachable code
Commit c50452c3186 added an exception when all instances should beevacuated off a node, but did so in a way which made pylint complainabout unreachable code.
LUNodeEvacuate: Disallow migrating all instances at once
There is a design issue in the iallocator interface which prevents usfrom doing this.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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....
LUNodeEvacuate: Locking fixes
When evacuating a node, only an assertion without informative text wasused to check if the necessary node locks had been acquired. This was ontop of evaluating the list of nodes without having a node group lock, sothis was changed as well....
Fix error when removing node
ConfigWriter.GetAllInstancesInfo returns a dictionary, not a list.Removing a node would fail with “too many values to unpack”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
cmdlib: use MAXMEM for all operations
Since for now we can only start instances at their maximum memory, wemodify all checks to use that value. When we'll have better support forusing a value in between some of these checks have to move to minimummemory....
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>...
ImportExport: use max and min memory params
Import uses the old "memory" parameter to populate the two new ones, ifthey're not overridden already.
FinalizeExport exports minmem and maxmem, but also memory, as maxmem, toallow importing to older ganeti clusters....
instance hooks: pass maximum and minimum memory
Also pass the "memory" value for retrocompatibility, for now.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Reapply commit 2a6de57 after merge
In the last merge I erroneously discarded the changes introduced bycommit 2a6de57 "Check the results of master IP RPCs". This commitreintroduces them.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix QA breakage caused by merge 0e82dcf9
Patch tested and confirmed to work by Andrea Spadaccini<spadaccio@google.com>.
Merge branch 'devel-2.4' into devel-2.5
Warn if we enable maintain-node-health without confd
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
LUInstanceCreate: Release unused node locks
After iallocator ran we can release any unused node locks. Since theymust be in exclusive mode this should improve parallelization duringinstance creation.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
cmdlib.TLReplaceDisks: Use itertools.count
… instead of a variable which needs to be incremented for every step.
Transition into and out of offline instance state
Introduce admin_state as 3-values data type
Rename admin_up to admin_state
cmdlib._ReleaseLock: Do nothing if no locks are owned
The locking library doesn't like it when “release()” is called ona lockset or lock which isn't held by the current thread. Insteadof modifying the library, which could have other side-effects,this rather simple change avoids errors when a LU simply tries to...
Use resource lock when setting node parameters
Also acquire instance and resource locks in shared mode (see comment).
Use node resource lock for replacing instance disks
If early-release is not used, the resource lock is kept while waitingfor disks to sync.
Hold node resource locks while setting instance parameters
Important for when disks are converted. Release locks once they're notneeded anymore. Make liberal use of assertions.
Hold node resource lock while moving instance
Acquire node resource lock when removing instance
Removing an instance affects available disk space and memory.
Use node resource lock when recreating instance disks
Recreating disks conflicts with other disk operations, therefore thenode resource lock must be acquired.
LUClusterRepairDiskSizes: Use node resource locks
Since this doesn't really touch the node, but it conflicts with e.g.growing a disk, the resource lock must be acquired.
LUInstanceGrowDisk: Use node resource lock
Also add one more feedback line. Downgrade instance lock to shared modewhile we're only waiting for disks to sync. The node lock is releasedwhen not needed anymore.
LUInstanceCreate: Hold node resource lock
The node resource lock is released once the disks are in sync (that is,after wiping).
LUNodeQueryvols: Acquire all locks in shared mode
Nothing is being written to.
LUNodeQueryStorage: Acquire all locks in shared mode
Nothing is written to.
cmdlib: Share lock in LUInstanceConsole
No writes are being done.
LUNodeQuery: Call implementation's DeclareLocks function
Just in case we ever add locks for querying nodes. Currently_NodeQuery's DeclareLocks is a no-op function.
Change master IP address RPCs for external script
Change the master IP address RPC call chain to accept theuse_external_master_ip_script parameter. Introduces an unused parameterin backend.ActivateMasterIp and backend.DeactivateMasterIp, that will beused in the next commit....
Update cluster verify to check IP address scripts
Update cluster-verify to check the integrity of the default master IPaddress setup script and the presence and executability of the externalone (if currently in use by the cluster).
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;...
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)....
Ensure unused ports return to the free port pool
Ensure ports previously allocated by calling ConfigWriter's AllocatePort() arereturned to the pool of free ports when no longer needed:
Fail if node/group evacuation can't evacuate instances
If an instance can't be evacuated, only a message would be printed. Withthis change the operation always aborts. Newly added unittests check forthis behaviour.
LUNodeSetParams: Lock affected instances only
Until now LUNodeSetParams would lock all instances if a node'ssecondary IP address was to be changed and would then releaseall instances it didn't actually need. With this patch the LUoptimistically locks instances and, once it got the locks,...
Check BGL when adding/removing node
Improve error handling in netmask change
- check if the master IP with the old netmask is up before attempting to change the netmask (to avoid a failed change netmask resulting in an undesired activation of the master IP);- improve error messages of the backend function;...
LUInstanceRename: Compare name with name
… instead of object with name.
LUClusterRepairDiskSizes: Acquire instance locks in exclusive mode
Instances are modified if their disk size doesn't match.
cmdlib: Allow specifying lock level when calculating node locks
This is needed to lock node resources.
Pass MasterNetworkParameters instances in RPCs
Pass instances of objects.MasterNetworkParameters when calling RPCs foractivation and deactivation of master IP.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Use MasterNetworkParameters attributes for RPC
Instead of manually unpacking the return values ofcfg.GetMasterNetworkParameters, let it return an instance ofobjects.MasterNetworkParameters and pass its attributes.