History | View | Annotate | Download (189.7 kB)
Cleanup os_add/rename rpc for OS API 10
- remove now unused osdev and swapdev arguments from backend, noded, rpc, cmdlib- convert docstrings to epydoc
Reviewed-by: iustinp
Enable gnt-cluster modify to hv/beparams
This patch enables the cluster modify to change: - enabled hypervisor list - hvparams (per hypervisor) - beparams (only the default group)
Syntax: gnt-cluster modify -B vcpus=3 -H xen-pvm:no_initrd_path
Validation for parameters is somewhat missing - the individual...
Show the cluster parametrs in gnt-cluster info
This is just a raw update without any special formatting.
Reviewed-by: imsnah
Add an interface for the drain flag changes/query
This adds the set/reset in the jqueue and luxi modules, and a way toquery it in OpQueryConfigValues, and also the comand line interface forit:$ gnt-cluster queue infoThe drain flag is unset$ gnt-cluster queue drain...
grow-disk: wait until resync is completed
The patch adds a new ‘--no-wait-for-sync’ parameter to grow-disk similarto the one in instance add, and changes the default to wait.
This is cleaner as at the moment when the command returns, we eitherhave a fully synced disk or there is an error....
Some fixes related to auto_balance
Change the constant name to match the value (autobalance ->auto_balance).
Also add the auto_balance header so that gnt-instance can list it.
Reviewed-by: ultrotter
Fix auto_balance and memory modification
The secondary nodes should not be checked for free memory in case of nonauto-balanced instances.
This is a forward-port from rev 1567 on the 1.2 branch.
Use the auto_balance in cluster verify
This patch changes the cluster verify in two ways: - do not use instances marked with auto_balance=False in N+1 memory checks - report, if any, the number of instances with auto_balance=False
Forward port from rev 1562 on the 1.2 branch....
Fix ordering of instance/nodes
After the locking changes, and the partial locking of nodes, theinstance/node list is not ordered anymore. Reorder so that it behaves asbefore.
Change over to beparams
This big patch changes the master code to use the beparams. Errors mighthave crept in, but it passes a small burnin.
Fix a bug with instance creation and hvparameters
When creating an instance, we need to check not the opcode hvparams, butthe final, filled hvparams against validity. While we do this for theremote node calls (i.e. ValidateParams), we didn't do this for...
Allow instance info to only query the config file
This patch adds a new '-s' parameter to ‘gnt-instance info’ that makesit return only 'static' information. This is much faster, especially fordrbd instances.
This is a forward-port of rev 1570 on the ganeti-1.2 branch, resending...
Convert gnt-instance info to the hvparams model
Some informations are not printed nicely (e.g. “virtual CDROM: False”),but this is the first step.
Change gnt-instance modify to the hvparams model
Change gnt-instance list to the hvparams model
This is just a change of the various hvm_ and pvm parameters to the hvmodel. Parameters are queried via hv/$name or via the whole dict asreturned by hvparams.
Reviewed-by: ultrotter,imsnah
Switch instance hypervisor parameters to hvparams
This big patch changes instance create to the new hvparams structure.Old parameters are removed, so old jobs or old instances file will breakcurrent clusters.
Abstract checking own address into a function
Currently, we check if we have a given ip address (i.e. it's alive onone of our interfaces) but manually calling TcpPing(source=localhost).This works, but having it spread all over the code makes it hard to...
LUVerifyCluster: fix error from rpc call
When calling node_verify leads to an error _VerifyNodes tries to iterateover a non-sequence. Catch the error before and avoid this fromhappening.
Convert rpc module to RpcRunner
This big patch changes the call model used in internode-rpc fromstandalong function calls in the rpc module to via a RpcRunner class,that holds all the methods. This can be used in the future to enablesmarter processing in the RPC layer itself (some quick examples are not...
Cleanup in cmdlib for standalone function calls
This patch is a cleanup of the standalone functions in cmdlib. Many ofthem too as argument a ConfigWriter instance, but some also took otherparameters from the lu (e.g. proc), and in the future, if we want to...
Small random fixes
Indentation in bootstrap was wrong and some names in cmdlib.py were notright.
Move instance hypervisor check to ExpandNames
This check can be done earlier, in ExpandNames, and is needed here forthe hypervisor parameter check.
Sanitize the hypervisor names
Since in 2.0 the user will possibly have more interaction with thehypervisor names, we sanitize them by removing the version numbers(the version can be a prerequisite for the ganeti installation, weshouldn't document it in variable names)....
Move the hypervisor attribute to the instances
This (big) patch moves the hypervisor type from the cluster to theinstance level; the cluster attribute remains as the default hypervisor,and will be renamed accordingly in a next patch. The cluster also gains...
backend.py change to get cluster name from master
Currently there are three function in backend that need the cluster namein order to instantiate an SshRunner. The patch changes these to get thecluster name from the master in the rpc call; once the multi-hypervisor...
Fix SshRunner breakage from the changed API
More places actually use the SshRunner than just the gnt-clustercommands.
Don't pass sstore to LUs anymore
sstore is no longer used in LUs.
Convert cmdlib.py
Replacing ssconf with configuration. Cluster rename is broken and staysthat way.
Convert ssh.py
Get rid of ssconf and convert to configuration instead.
Convert hypervisor
Replacing ssconf with configuration.
Add new query to get cluster config values
This can be used to retrieve certain cluster config values fromwithin clients.
OpDumpClusterConfig was not used anywhere, hence I'm just reusingit. The way ConfigWriter.DumpConfig returned the configurationwas not thread-safe, anyway (no deepcopy)....
Extend DRBD disks with shared secret attribute
This patch, which is similar to r1679 (Extend DRBD disks with minorsattribute), extends the logical and physical id of the DRBD disks with ashared secret attribute. This is generated at disk creation time and...
Allow listing of the serial_no via gnt-* list
This patch adds listing of the serial_no attribute in gnt-instance andgnt-node list, and updates to the manpages to reflect the change.
Replace a cfg.AddInstance with UpdateInstance
This seems to be the last (deprecated) use of AddInstance in order toupdate an instance.
The patch also removes a whitespace-at-eol case.
Fix iallocator name
port forward of patch from revision 1690 with following message:
Patch on revision 1686 used the wrong field: ial.name, which is the instancename and not the iallocator name. self.op.iallocator is the right field.
Sorry for this inconvenience....
Fix a broken format string
This patch fixes a broken format string. It's expecting 3 parameters, but onlygets 2. This change will add the missing parameter. This is a forward-portof the fix in Ganeti 1.2
Switch to static minors for DRBD
With some todos remaining, this patch switches the DRBD devices to usethe passed minors, and the cmdlib code (add instance and replace disks)to request and assign minors to the DRBD disks.
Todos: - look at the disk RPC calls to see which can be optimized away, since...
Fix disk replace secondary with static minors
The code in 'updating instance configuration' section of the replacedisks with change secondary node was setting a wrong new logical_id forthe drbd devices (only set the new node, not the new minor). The patch...
Extend DRBD disks with minors attribute
This patch converts the DRBD disks to contain also a minor (per eachnode) attribute. This minor is not yet used and is always initializedwith None, so the patch does not have any real-world impact - except forautomatically upgrading config files (it adds the minors as None, None)....
Apply filter properly in LUQuery{Nodes, Instances}
Currently when not locking all nodes/instances are returned, regardlessif the user asked only for some of them. With this patch we return tothe previous behaviour: - if no names are specified return info on all current ones...
Remove auto_balance from burnin/cmdlib
There is no such feature in trunk yet.
Parallelize Tag operations
For now we lock the instance/node for adding/deleting tags from it, butwe could probably in the future do without, with more support from theconfig for atomic operations.
Parallelize LUSetClusterParams (and add a FIXME)
Parallelize LURemoveExport
Parallelize LURemoveInstance
Using the new add/remove infrastructure this becomes pretty easy! :)
Parallelize LUCreateInstance
Finally, instance create on different node, without iallocator, can runin parallel. Iallocator usage still needs all nodes to be locked,unfortunately. As a bonus most checks which could have been moved toExpandNames, before any locking is done....
Implement adding/removal of locks by declaration
With this patch LUs can declare locks to be added when they start and/orremoved after they finish. For now locks can only be added in theacquired state, and removed if owned, and added locks default to be...
Remove locking of instances in certain queries
This patch is similar to the node patch (rev 1650). We disable lockingof instance (and nodes) if we only query static information.
Optimize the OpQueryNodes for names only
Currently, OpQueryNodes is locking all nodes (in shared mode), whichwill also block the special case of querying only for the node names(this is needed for gnt-cluster command, for example). There is nological requirement to not give the administrator enough power if she/he...
Parallelize LUQueryInstanceData
Parallelize LUVerify{Cluster,Disks}
These are two easy querying LUs which require shared access to allnodes/instances.
Parallelize LUReplaceDisks
This is the most complex parallelization so far. We have to lock oneinstance (and its nodes) plus one more node if doing a remote replace,or all nodes if doing a remote replace with iallocator.
_LockInstancesNodes: support append mode
This will be used to lock the instance's nodes in addition to some more.
Parallelize LU{A,Dea}ctivateInstanceDisks
Now that they are not used in other opcodes by chaining,this can easily be done.
LUReplaceDisks: remove use of ChainOpCode
The calls to OpActivateInstanceDisks and OpDeactivateInstanceDisks hasbeen replaced by _StartInstanceDisks and _SafeShutdownInstanceDisksrespectively. This is the last usage of ChainOpCode.
Create new _SafeShutdownInstanceDisks function
This new function checks whether an instance is running, before shuttingdown its disks. This is what the Exec() of LUDeactivateInstanceDisksdid, so that is replaced by a call to this function.
Fix a typo in LogicalUnit.ExpandNames docstring
s/locking.LEVEL_INSTANCES/locking.LEVEL_INSTANCE/
Use constants.LOCKS_REPLACE instead of hardcoding
This constant replaces what we used to write in recalculate_locks, andrepresents the lock recalculation mode. It lives in constants.py becauseit's used only in cmdlib, and thus doesn't deal with the locking library...
Fix LUReplaceDisks with iallocator
self._RunAllocator() sets self.op.remote_node, but doesn't return thenew remote node. If we set it to the return value of the function webasically reset it to None, and iallocator is never run.
Fix LUGrowDisk
The rpc library returns a list, not a tuple, so we'll accept both.
Fix iallocator run
Parallelize LUExportInstance
Unfortunately for the first version we need to lock all nodes. The patchdiscusses why this is and discuss ways to improve this in the future.
Parallelize LUGrowDisk
LURebootInstance: lock only primary when possible
When rebooting an instance and we're not changing it's disks status (allthe cases except in a "full" reboot) we can lock just its primary node.
Add primary_only flag to _LockInstancesNodes
As the name says when the flag is on (the default is off) only theprimary nodes are locked, as opposed to all of them.
Add locking.ALL_SET constant and use it
Rather than specifying None in needed_locks every time, with a nicecomment saying to read what we mean rather than what we write, and thatNone actually means All, in our magic world, we'll hide this secretunder the ALL_SET constant in the locking module, which has value, you...
Prevent mistakes using _GetWantedNodes
All the users of _GetWantedNodes have been converted to be concurrentLUs, and thus cannot call this function with an empty list of nodesanymore. This patch makes this restriction a part of the functionitself. This prevents mistakes in new concurrent LUs, and creates more...
Paralleliza LUQueryNodeVolumes and LUQueryExports
Parallelize LUDiagnoseOS
LUQueryExports: make 'node' field mandatory
It turns out this fields was already mandatory. If it hadn't beed valid,in fact, a value of None would have been passed to _GetWantedNodes whichwould have thrown an exception.
s/Chain(OpQueryExports)/rpc.call_export_list(...)/
Parallel opcodes are not (yet?) supported for chaining. Turns outthough that chaining is used only four times in the code, and twice it'sfor querying exports. But what's the need to chain the full opcode, when...
Fix wrong indentation in LUQueryNodes
Merge r1607 from branches/ganeti/ganeti-1.2
Use a default vnc_bind_address if None is specified
merge r1568 from branches/ganeti/ganeti-1.2
Add more fields to gnt-instance list
merge r1548 from branches/ganeti/ganeti-1.2
Fix wrong wording of instance rename error message.
merge r1541 from branches/ganeti/ganeti-1.2
more information for VNC console port
merge r1539 from branches/ganeti/ganeti-1.2
Display VNC console port in gnt-instance info.
merge r1538 from branches/ganeti/ganeti-1.2
Check HVM device type on instance modify as well.
Check memory size before setting it
With this change when a user asks for a new memory size for an instance,the number is checked instead of just applied. The operation fails onlyif the instance would not be able to restart on its primary node, butgenerates warnings should it be impossible to failover the instance or...
Pass the force param to SetInstanceParms
It was already allowed in gnt-instance modify, but ignored.It will be used to force skipping parameter checks.
This is a forward-port from branches/ganeti-1.2
Original-Reviewed-by: imsnahReviewed-by: iustinp
Merge r1536 from branches/ganeti/ganeti-1.2
Add HVM device type flags 2/3
merge r997 from branches/ganeti/ganeti-1.2
Fix gnt-instance modify for HVM parameters
This patch makes gnt-instance modify work again for the advancedHVM parameters after it was broken by other changes.
Fix issue when acquiring empty lock sets
By design if an empty list of locks is acquired from a set, no locks areacquired, and thus release() cannot be called on the set. On the otherhand if None is passed instead of the list, the whole set is acquired,...
Parallelize LUQueryNodes
As for LUQueryInstances the first version just acquires a shared lock on allnodes. In the future further optimizations are possible, as outlined bycomments in the code.
Parallelize LUQueryInstances
This first version acquires a shared lock on all requested instances andtheir nodes. In the future it can be improved by acquiring less locks ifno dynamic fields have been asked, and/or by locking just primary nodes.
LURebootInstance: move arg check in ExpandNames
The check for the reboot type can be done without any locks held, sowe'll move it to ExpandNames. Plus, we note in a FIXME that if thereboot type is not full, we can probably just lock the primary node, and...
LUVerifyCluster: Return boolean indication success
Reviewed-by: schreiberal
Implement {Add,Readd,Remove}Node in GanetiContext
By doing this we've a central place which coordinates what needs to bedone when adding or removing nodes. Another patch will add calls intothe job queue.
Two log messages move to config.py.
When removing a node, node_leave_cluster is now called after it has...
Fix cluster destroy
With the recent startup/shutdown changes (and with the master daemon inplace), the cluster destroy needs some fixing.
This patch moves the finalization of the destroy out from cmdlib intobootstrap, so we can nicely shutdown the rapi and master daemons....
Parallelize LUFailoverInstance
Fix pylint-detected issues
This is mostly: - whitespace fix (space at EOL in some files, not all, broken indentation, etc) - variable names overriding others (one is a real bug in there) - too-long-lines - cleanup of most unused imports (not all)...
Parallelize {Startup,Shutdown,Reboot}Instance
Parallelize LUReinstallInstance
self.recalculate_locks[locking.LEVEL_NODE] could have any value andeverything would work anyway. We'll use the string 'replace' byconvention because in the future we might want an 'append' mode.
LogicalUnit._LockInstancesNodes helper function
This function is used to lock instances' primary and secondary nodesafter locking instances themselves.
Make sharing locks possible
LUs can declare which locks they need by populating theself.needed_locks dictionary, but those locks are always acquired asexclusive. Make it possible to acquire shared locks as well, bydeclaring a particular level as shared in the self.share_locks...
Add LogicalUnit.DeclareLocks
This additional LogicalUnit function is optional to implement, but letsyou change your locking needs for one level just before locking it, butafter the previous levels have been already locked. It is useful forexample to calculate what nodes to lock after locking an instance....
LURenameInstance, add/remove relevant locks
LURenameInstance forgot to remove the old lock name and add the new one,making it impossible for parallel LUs to act on the instance (without amaster daemon restart). This also fixes burning+rename with theparallelization of {Start,Stop}Instance....
Rework master startup/shutdown/failover
This (big) patch reworks the master startup/shutdown and the fixes themaster failover.
What does the patch do?
For master start/stop: - remove the old ganeti-master script and its associated man page - moves the ip start/stop directly into the backend.(Start|Stop)Master...
Add a new parameter to backend.(Start|Stop)Master
This patch adds a new, unused for now, parameter to the start and stopmaster operations in backend. The idea behind it is that we need to beable to control whether the IP (de)activation is coupled with daemon...
Convert set to a list in LUGetTags
The set triggers exception on a list-tags command and RAPI calls for tagssince it is not serializable by JSON.