History | View | Annotate | Download (228.2 kB)
Use instance.all_nodes instead of hand-building it
This patch replaces a few obvious uses of [instance.primary_node] +list(instance.secondary_nodes) (or similar usage) with the newinstance.all_nodes.
Reviewed-by: ultrotter
Split the block device creation in two parts
Some callers of _CreateBlockDev need recursive behaviour, but not all.The replace secondary first creates (manually) new LVs to ensure storageis there, and then it creates the new DRBD. At this point, we need a...
Combine the two _CreateBlockDevOnXXX functions
Since only two boolean parameters differ between these two functions, wecombine them as to have less code duplication. This will be needed inthe future as we will need to split off the recursive part off....
Switch call_blockdev_create call to (status, data)
This allows errors to be visible at the user level instead of just nodedaemon logs.
Small change in the instance disk creation path
For future propagation of error messages from backend to cmdlib and tothe job log, just having True/False return from the disk creationfunction is not enough.
This patch converts these functions (_CreateDisks, _CreateBlockDevOnXXX)...
Use the same root for both _data and _meta LVs
Currently we use a different UUID for the _data and _meta volumes of aDRBD disk. This is confusing as it's hard to associate the two in theoutput of “lvs” or “gnt-node volumes”.
The patch changes so that they use the same prefix....
Fix LUExportInstance
Due to deficiencies in our block device implementation, it is a must tocall SetDiskID on disks before passing them to remote nodes. Since inexport/import, we don't touch the disks themselves, this was not neededbefore in this function....
Fix gnt-backup export with short names
We need to pass the fully-qualified node to _CheckNodeOnline, not the shortone.
Reviewed-by: imsnah
Forward port the live migration from 1.2 branch
This is forward port via copy (and not individual patches cherry-pick)of the latest code on the 1.2 branch related to the migration.
The changes compared to 1.2 are the fact that we don't need theIdentifyDisks step anymore (the drbd rpc calls are independent now), and...
Port replace disk/change node to the new DRBD RPCs
In replace disks to new secondary, since Attach (and thereforecall_blockdev_find) is not modifying the devices anymore, we need toswitch this LU to the new call_drbd_disconnect_net andcall_drbd_attach_net functions....
Fix modification of instance memory
... as found by the QA script - bug was introduced by me in commit 2117.
Reviwed-by: imsnah
Fix some errors in instance modify --disk remove
The RpcResult introduction still left some bugs (after multiple patches): - we don't correctly check the result type - rename a variable to prevent a conflict
Fix an error handling case in instance info
The checking for invalid instance names in LUQueryInstanceData is brokensince commit 1642.
Introduce a very simple LU to force config updates
This LU can be used to force a push of the config in case it's needed,for example after an upgrade to update the ssconf_release_version file.
Fix gnt-os for offline nodes
We shouldn't query offline nodes in gnt-os. This patch adds an utilityfunction to ConfigWriter that returns the names of online nodes and usesit in LUDiagnoseOS to query only the good nodes.
Cleanup replace-disks modes and options
In 1.2, due to the md+drbd7 legacy, we had a complex choice of replacemodes, and the new drbd8 modes where forced into this syntax, with somecomplicated rules of transition from one mode to another (if REPLACE_ALL...
Fix cluster verify/node net test for offline nodes
For offline nodes, we shouldn't add them to the NV_NODELIST andNV_NODENETTEST tests since they most likely won't succeed.
The patch makes gnt-cluster verify happy again in such cases.
_AssembleInstanceDisks: fix rpcresult handling
Commit 2117 changed _AssembleInstanceDisks to correctly parse thefailure status of the new RpcResult structure, but it didn't fix thestoring of only the result payload. Since RpcResult is not JSONserializable, LUActivateInstanceDisks is failing....
ganeti.cmdlib: Check remote API certificate on "gnt-cluster verify"
Reviewed-by: amishchenko
LUConnectConsole: fix primary_node online check
The primary node is part of the instance, not of the opcode.
Reviewed-by: iustinp
cleanup: fix IAllocator hypervisor usage
Two problems: the iallocator.hypervisor wasn't initialized to None inthe constructor, so pylint doesn't realize it's initialized later withsetattr.
Second, 'hypervisor' is a module, so we shouldn't use it as a variable....
cleanup: LUReplaceDisks unused vars
And a small whitespace fix.
cleanup: do not hide upper-scope name
hypervisor is a module, so we shouldn't use it as an argument.
cleanup: fix use of _CheckNodeOnline
A few cases of wrong variable name.
cleanup: LUAddNode, LUSetNodeParams unused variable
This is a leftover from the abstraction of AdjustCandidatePool, and italso requires the config lock, so it's better to remove it.
cleanup: LURenameCluster wrong variable name
Warn for instances living on offline nodes
The patch also changes the result to error for non-reachable secondary nodes(as for primary nodes).
Fix _AdjustCandidatePool
Currently the ConfigWriter.MaintainCandidatePool returns node names, and_AdjustCandidatePool uses them as such, but then it passes these tocontext.ReaddNode which in turn passes them to jqueue.JobQueue.AddNode whichuses them as objects.Node instances....
gnt-node modify: add the offline attribute
This patch changes gnt-node modify and the associated opcode/lu to allowmodification of the node offline attribute.
Setting a node into offline mode automatically demotes it from themaster role.
Make cluster verify understand offline nodes
This patch changes cluster verify to not alert on offline nodes, butinstead just show a note at the end with the number of such nodes.
It also removes warnings in verify-disks and hooks about failures tomake rpc calls to such nodes....
cmdlib: check node stats in prereqs
This patch adds checks for offline nodes in most instance LUs so that wecan work with offline secondaries, but not with offline primaries. Somecases (like grow disk, which needs both sides up) are not allowingoffline nodes at all....
Add two utility functions to cmdlib
These will be used for parameter checking and node status checking.
Add function to compute the master candidates
Since some nodes can be offline, we can't just take the length of thenode list as the maximum possible number of master candidates.
The patch adds an utility function to correctly compute this value andreplaces hardcoded computations with the use of this function. It then...
Cleanup the config file on demotion from candidate
This patch adds a simple rpc which makes a backup of the config file andthen removes it. This is done so that cluster verify doesn't complainimmediately after demoting a node.
watcher: handle offline nodes better
This patch changes the LUQueryInstances to show a different state foroffline nodes and also modifies the watcher to understand the offlinestate in its checks.
node list: add the offline field
Add a new node parameter 'offline'
This patch adds a new node parameter called offline that will be used tomark nodes which should be touched by commands.
We also add this flag at cluster init, node add, and export it toiallocator scripts.
LURemoveNode, promote nodes to master candidates
If after the remove node there are not enough master candidates, we'lltry to promote them.
LUQueryExports: fix rpcresult handling
call_export_list is a multi node call, so we need to go through theresults, extrapolate the good ones, and return a failure value for thebad ones.
LUAddNode: Auto-make master candidates
When a node is added, if there are not enough master candidates, we'llautomatically promote it.
LUAddNode: Check the correct result
This is a typo in the conversion to RpcResult
A few fixes related to master candidates
This patch: - fixes cluster verify when all nodes are master candidates, but the candidate_pool_size is higher - warn when the master node is not marked as candidate - disable setting master node to regular node...
Fix cluster rename and known_hosts
This patch rewrites and distributes ganeti's known_hosts file in case ofa cluster rename.
We also fix a problem in the node add (from where I copied theknown_hosts file distribution).
Fix gnt-cluster verify w.r.t. rpc changes
This partially reorganizes the cluster verify LU: - introduce constants for the node verify rpc call - move from additional rpc calls to a single rpc call, the call_node_info, which gaters all data needed...
Fix cluster rename
With the recent configwriter/ssconf changes, cluster rename becomestrivial. This patch gets rids of the code and just updates the clusterobject.
Convert rpc results to a custom type
For a long time we had the problem that both RPC-layer errors andresults from the remote node share the same "valuespace". This isbecause we shouldn't raise an exception when only one node failed(and lose the results from the other nodes)....
Use the new utils.CheckBEParams function
Where we used/forgot to validate beparams we now use the new common function.
Handle default/none values in hv/be params
When a value is set to constants.VALUE_DEFAULT we have to remove it fromthe specific instance dict, as this way it will be populated from thecluster before. If instead it's specified as constants.VALUE_NONE we'll...
ImportExport: make src_node and src_path optional
If src_node is not there we'll default to using the currently exportedinstance name as src_path. Also, if src_path is not absolute we'll lookfor it in EXPORT_DIR.
LUCreateInstance: handle import without src_node
If we get called with no source node we'll thread src_path as aninstance name exported in EXPORT_DIR in one of the nodes and look forit with the export_list rpc call.
LUCreateInstance: keep src node lock on import
Currently the node lock also guards against removing the import at thewrong time, so if we're importing an instance image we want to keep thesource node locked. In the future we might want to put export locks at a...
Adjust cluster-verify to check for candidate role
Currently cluster verify checks all nodes for the same set of files,even if the nodes are not master candidates.
This patch adds back checking of ssconf files for consistency and splitsthe checksum check into different error reporting messages based on...
Prevent demotion from candidate based on pool size
In gnt-cluster modify we prevent demotion from the candidate role ifthere are not enough master candidates left.
Add cluster candidate pool size parameter
This patch adds a new cluster paramater "candidate_pool_size" whichtracks the desired size of the list of nodes with the master_candidateflag set.
Add a gnt-node modify operation
This patch adds the OpCode, LogicalUnit and gnt-node command formodifying node parameters, more specifically the master candidate flagfor a node.
Add master/master_candidate fields to node list
This patch adds listing of the master_candidate field (as Y/N) and ofthe master role (again Y/N) for nodes.
Fix errors when the node info RPC is incomplete
[Forward-port from the 1.2 branch]
If ganeti starts before xend, the node information will not have all thefields filled in. The patch changes so that missing keys will be treatedas unknown (this applies to other cases as well, not only xend not...
Fix gnt-backup export
This patch fixes a bug in disk calculation for gnt-backup export, whichcompletely broke one-disk instance export.
The patch also corrects some error messages and style issues.
Fix a message in LUExportInstance
We never verified the node name before, so this is most likely not anon-retrieve but a wrong name case.
Fix instance creation
This patch fixes the diskless and drbd/file based instances. Sorry :(
Implement support for multi devices changes
This big patch adds support for: - changing NIC/disks in the multi-device model - adding/removing NICs - adding/removing disks
The patch is big and not very nice; the error checking paths are notvery clear....
Slight change to the LU initialization code
This patch adds support for a separate LU.CheckArguments() method whichshould do syntactic checks without holding locks and without pollutingthe ExpandNames which is a lock-related function. See for example the...
Fix a bug in LUSetInstanceParams
The wrong names were reused in a copy-paste.
Show disk access mode in gnt-instance info
The mode parameter needs to be exported and shown in the info output.
Change _GenerateDiskTemplate iv_name generation
Currently the _GenerateDiskTemplate assumes it does initial creation ofdisks (i.e. it starts with index 0).
For dynamic disk adds, we need to pass an additional offset. This patchadds this offset and modifies its sole current caller....
LUCreateInstance: Fix import mac AUTO mode
Previously on import LUCreateInstance used to recycle the mac if the instancename was the same than the one used at export time. Now we do the same, butapply the setting separately for each nic.
LUCreateInstance unlock all nodes mid-way
When creating a new instance, after saving the instance data to the config fileand creating the disks, but before waiting for sync and installing the OS, werelease the node locks, to allow for more instance creations to proceed in...
IAllocator: subtract down instances from free mem
Currently free_memory just reports the amount of free ram, as seen by thehypervisor. We adjust this amount by subtracting the memory for any instancewhich is down, and the difference for any instance which is configured to have...
IAllocator: use the right hypervisor
Since the hypervisor is instance dependent we'll get one on instance creation,and use the one in the instance config on relocation.
IAllocator: fill i_list in a more proper way
- reuse the previously called cluster_info, rather than calling it again- get all the instances from the config atomically, to prevent race conditions- use a list comprehension, for simplicity
Parallelize instance operations on the same node
With static minors we don't have a race condition anymore whenstarting/stopping/rebooting/reinstalling more than one instance on the samenode, so we'll drop node locking altogether.
Convert iallocator to the new _ComputeDiskSize
_ComputeDiskSize's API was changed for multidisk support in r2010, butiallocator's call to it were not fixed. Converting them now.
Documentation updates for cmdlib.py
This makes cmdlib.py not throw epydoc errors anymore.
Move FieldSet class to utils.py
Since we can use the FieldSet class in cli.py to nicely format disksizes and such, we move it to utils.py and also move its associatedunittest. I didn't remove the cmdlib.py unittest file as that's not thegood direction :)...
Change disk index validation to FindDisk
This patch replaces the hand validation of the disk index with theinstance.FindDisk method (actually reverting to previous method, beforethe multi-disk, but now with indexes).
Change GrowDisk to work with multi-disk
This patch changes the instance.FindDisk method to take index arguments(instead of iv_names), and changes GrowDisk and list instancesaccordingly.
Change replace secondary to work with multi-disk
Also fix an error in the CheckPrereq.
Convert replace-disks (same nodes) to multi-disk
This patch changes the drbd8 replace disk only (no secondary change) towork in with multi-disk. This mode of replaces works correctly withreplacing only a subset of disks.
Initial multi-disk/multi-nic support
This patch adds support for mult-disk/multi-nic in: - instance add - burnin
The start/stop/failover/cluster verify work as expected. Replace diskand grow disk are TODO.
There's also a change gnt-job to allow dictionaries to be listed in...
Add more disk/nic listing options in gnt-instance
This adds some more listing cases (useful for scripting/rapi): - disk.sizes for a list of all sizes - nic.(ips|macs|bridges)
Allow querying of variable number of parameters
This patch adds support for querying in gnt-instance list of: - disk.count - nic.count - disk.size/$N - nic.(ip|mac|bridge)/$N
The patch also disables the exception raised when the header description...
Convert cmdlib.py to _FieldSet
This patch converts the current usage of _CheckOutputFields to theFieldSet class, but it doesn't start to use its variable matchingfeatures.
Add a FieldSet class for variable parameter sets
This patch adds a _FieldSet class that can be used for the new variableparameter sets: e.g. the sda_size will change to disk/0.size (orsimilar) and we need to both check validity and extract the index of the...
Fix instance rename
As can be seen from the patch, we remove from the locking managerinst.name. However, we do this right after cfg.RenameInstance, whichchanges inst.name to the new name. So we need to remove old_name notthe new name.
The real question is why does the glm allow me to remove a not-existing...
Fix gnt-instance reinstall
Commit 1881 changed a rpc call but didn't fix all its users. This shouldfix it (but I can't test as HTTP is broken).
Update LUGrowDisk _WaitForSync call
The _WaitForSync call changed in r1794 but the GrowDisk call wasn't updatedthen. This makes GrowDisk work in trunk.
Export the disk index in the import/export scripts
We want to export the disk index as some OSes will only want to exportthe first disk (or the second one, etc.), even if we have multipledisks.
The patch also updates the backend.ExportSnapshot docstring....
RAPI: Export beparams as dict. The patch also enables LUQueryInstances to accept beparams as valid field.
LUCreateInstance: import multiple disks
Previously we used to handle only one disk. Now we'll import all theones present in the export, in order, on the instance's disks. Any diskwhich was present on the original instance but wasn't exported is justskipped in the target instance....
Convert ImportOSIntoInstance to OS API 10
- Change ImportOSIntoInstance not to get any "os_disk" and "swap_disk" arguments but to accept multiple target images to import, and to return a list of booleans with the result of each import- Change the relevant rpc call and the only caller to conform...
LUExportInstance: snapshot all disks
Rather than just snapshotting the "sda" disk, we'll snapshot all of theinstance disks. If we can't snapshot a disk for any reason we'll log anerror and proceed anyway: in this case the resulting export will miss adisk. This also changes all the warning messages to self.LogWarning()....
Move some LU logging to use proc.Log*
We change some messages which are obviously intended for the user to usethe proc.Log* functions instead of (only) the logging ones.
We also fix some wrong uses of feedback_fn.
Set default hypervisor at cluster init
During cluster init, set the default hypervisor to be used for instances.Ensure that the default hypervisor belongs to the set enabled hypervisorsfor this cluster. Also fix a small bug with setting the default enabled...
Use constants.VALUE_AUTO for ip comparison too
Forward-port-of: r1889, Reviewed-by: imsnah
LUCreateInstance: reuse mac address on import
When importing an instance with the same name as the exported one if themac address is "auto" we try to reuse the previous mac address. One canstill force generation of a new one with mac="generate".
Forward-port-of: r1887, Reviewed-by: iustinp...
LUCreateInstance: accept mac = VALUE_GENERATE
VALUE_GENERATE is handled exactly the same as VALUE_AUTO and the macaddress is generated randomly.
Forward-port-of: r1886, Reviewed-by: iustinp
Convert cmdlib.py to use the logging module
Note that many uses of logger.Error were used in 1.2 for theirside-effect of logging to stderr, where the user will see the messages,and not for having the entry in the log. As such, we need to go over andreview every use of logging.* and decide if it should use feedback_fn...
Fix gnt-instance modify with beparams
The gnt-instance modify didn't work correctly w.r.t the be parameters.There was also a typo in the corresponding LU.
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
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...