History | View | Annotate | Download (250.8 kB)
LU execution: implement dry-run framework
This patch adds a new (global) opcode flag 'dry_run' which, when True,causes early exit from the LU workflow, returning a special value fromthe LU object (initialized in the parent LogicalUnit class, and which if...
Fix some small epydoc warnings
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix various pylint warnings
There were multiple issues: - copy-paste resulted in wrong indentation - wrong function name - missing spaces around assignment - overriding built-in names (type, dir) or already defines ones (errors, hypervisor)
Signed-off-by: Iustin Pop <iustin@google.com>...
Update a forgot docstring for nic parameters
Properly document the expected nic format.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix QueryInstanceData for nic parameters
This CL updates QueryInstanceData to return NICs in the new format (mac,ip, mode, link) and fixes gnt-instance info to properly display them.
Update instance query for NIC parameters
Compatibility with the old parameters is maintained, by allowing toquery for "bridge" "nic.bridges" and "nic.bridge/N", but None isreturned in that case for routed nics.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Rename _PreBuildNICHooksList to _NICListToTuple
We're going to use this helper function for more than just hooks, sowe'll give it a more generic name.
Merge branch 'next' into branch-2.1
LUQueryInstances: fix querying for nic data
Currently we support querying for "mac" "ip" or "bridge", meaning "theone of the first nic. We are not checking that there is a first nic,though, and thus could incur in errors. This patch fixes it by returning...
Small whitespace change
Some indentation was wrong, and pylint rightfully complained.
Simplify RPC call result check in cmdlib.py
Now that all results are the same, we can even more simplify thehandling in cmdlib more. Almost all if result.RemoteFailMsg()…constructs are similar, and we resurect the RpcResult.Raise() functionto take a message argument, which it will process and raise an...
Big rewrite of the OS-related functions
Currently the OSes have a special, customized error handling: the OSobject can represent either a valid OS, or an invalid OS. The associatedfunction, instead of raising other exception or failing, create customOS objects representing failed OSes....
Convert the file storage rpcs to new style result
This patch converts all three file-storage rpc (create, delete, rename)to new style result. This is done in a single patch as they all use ahelper function which itself needs to/can be converted.
Convert test_delay rpc to new style result
Convert iallocator_runner rpc to new result style
This patch converts this rpc into the new style. Since the functionalready had some error handling, we remove this custom error reportingand replace it with our (new-style) result type. This allows significant...
Convert hooks_runner rpc to new style result
This also converts (and fixes) unittests and mock objects to deal withthis change, and the custom hook verifier in cmdlib.LUClusterVerify.
Convert os_diagnose rpc to new style result
This also removes custom post-processing from rpc.py; since this callhas only one user, it was simple to move it back to the caller.
Convert call_version rpc to new style result
This also cleans up its single use in cmdlib.py.
Convert node_volumes rpc to new style result
Conver node_leave_cluster rpc to new style result
This patch converts this rpc call to the new style result, and alsochanges in the process the meaning of the QuitGanetiException'sarguments and the node daemon rpc call exception handler.
The problem with the exception handler is that we used a two-stage one,...
Convert node_stop_master rpc to new style result
Convert node_start_master to new style result
This is used in multiple places outside cmdlib.py, so it's a moreinteresting patch.
Convert node_verify rpc to new result style
Convert node_info rpc to new style result
This patch also does some cleanup and enforces valid results (withproper type, i.e. int for memory/disk values) from remote node,otherwise we handle the result as failure.
We do this so that we can remove custom processing in rpc.py which is...
Convert node_has_ip_address rpc to new style
This should actually have a function in backend, but it's fine for now.
Convert instance_list rpc to new style result
Since backend.GetInstanceList() is used both as RPC endpoint and asinternal function, it can't return (status, value). Instead it returnsonly valid instance info, and failures are denoted by exceptions; and...
Convert all_instances_info rpc to new result style
Convert instance_info rpc to new style result
Convert instance_os_import rpc to new style result
This changes from a list of booleans to «status, error messages». Thismeans that instead knowing which disk has failed (position based), weget a list of all failures (with details how they failed).
Convert bridges_exist to new style result
This was a very simple (boolean) RPC, so converting it to actually havemore value with the new style results was more difficult.
Convert vg_list rpc to new style result
This doesn't have known failure modes but converting will help later.
We also now call directly utils.ListVolumeGroups() instead of thebackend.ListVolumeGroups() so that we don't have to undo the (status,value) result type....
Convert volume_list rpc to new style result
This is a big change, because we need to cleanup its users too.
The call and thus LUVerifyDisks LU used to differentiate between failureat node level and failure at LV level, by returning different types inthe RPC result. This is way too complicated for our needs....
Convert export_remove rpc to new style
This converts the export_remove rpc to new style result and also fixesand old TODO by adding exception handling (and conversion to failure).
Convert export_list rpc to new style result
This is used in multiple places, so it has a little more changes thanthe previous ones.
Convert export_info rpc to new style result
This also removes some code from ganeti-noded and rpc.py, which shouldnot do such processing of data (and be simply glue code). (Oralternatively they could, if we had better infrastructure).
Convert finalize_export rpc to new style results
This rpc doesn't have explicit failure modes, but once all RPCs areconverted and we can catch and convert expceptions to failure in noded,we will have meaningfull error messages.
Convert snapshot_export rpc to new style
Convert blockdev_snapshot rpc to new result style
This also slightly changes the code in cmdlib that uses it for moreclarity.
Convert blockdev_getmirrorstatus rpc to new style
Iallocator: NIC parameters
NIC Parameters: fix hooks environment generation
In order to do that we change the way nics are espected to be passed tothe _BuildInstanceHookEnv function, from (ip, bridge, mac) to (ip, mac,mode, link).
To translate new nics, which have the ip, mac and nicparams fields to...
QueryClusterInfo: don't show default_bridge
Since default_bridge is deprecated, avoid displaying it when queryingfor cluster information.
_CheckInstanceBridgesExist: move to NIC parameters
Rather than checking all bridges, we check all links for bridged nics,if any. Since this function is now slightly more complex than before,it's been split into an auxiliary function, and more parameters are...
LUSetInstanceParams: nic parameters
Hooks are dealt with in a later patch in the series.
LUSetInstanceParams: abstract _GetUpdatedParams
There is some duplicated code between hv and be parameters to create theupdated parameters dict. This will need to be done also for nicparameters, so we abstract this functionality in a function.
LUSetInstanceParams: save cluster
Rather than querying for the cluster multiple times, save it.
LUCreateInstance: NIC parameters
Instance creation is changed to support the new nic parameters.
Fix node add and RedistributeAncillaryFiles
Commit 28eddce5249f35c2c330a04da07b74950877dcf5 added theRedistributeAncillaryFiles, but it calls it with a wrong parameter and thusmakes node add fail.
This one-liner fixes it.
Show nic parameters in cluster info
Allow modifying of default nic parameters
Change BEGR_DEFAULT to PP_DEFAULT
This way the same constant can represent the default profile also fornic, disk and OS parameters.
Move FillDict at module level
This way it can be also used by scripts and other object types.
Convert call_blockdev_removechildren to new result
This patch converts blockdev_removechildren to new result type andslightly changes a message in addchildren to match this (paired)function.
Convert call_blockdev_addchildren to new result
This patch converts the blockdev_addchildren rpc call to the new resultformat.
Convert rpc call_blockdev_rename to (status, data)
This small patch converts the call_blockdev_rename to the new resulttype.
Merge branch 'master' into next
Wait for a while in failed resyncs
This patch is an attempt at fixing some very rare occurrences of messages like: - "There are some degraded disks for this instance", or: - "Cannot resync disks on node node3.example.com: [True, 100]"
What I believe happens is that drbd has finished syncing, but not all...
Fix two issues with exports and snapshot errors
This patch fixes two issues related to failed snapshots during exports: - first, the error messages used disk.logical_id1, which is a node name for DRBD, and it resulted in strange error messages like...
Set the size on new DRBDs in replace secondary
Currently the code in cmdlib doesn't set the device size to new DRBDdevices in replace secondary, but we need to do it otherwise it getsinitialized to None.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add cluster-init --no-etc-hosts parameter
If --no-etc-hosts is passed in at cluster init time we set a newparameter in the cluster's object to false, and avoid adding nodes tothe hosts file. The UpgradeConfig function is used to set the value toTrue, when upgrading from an old configuration version....
Convert UploadFile (and its callers) to new rpc
Add a node powercycle command
This (somewhat big) patch adds support for remotely rebooting the nodesvia whatever support the hypervisor has for such a concept.
For KVM/fake (and containers in the future) this just uses sysrq plus a‘reboot’ call if the sysrq method failed. For Xen, it first tries the...
_RedistributeAncillaryFiles: add hypervisor files
Each hypervisor can declare additional files to be shipped to all nodes.
_RedistributeAncillaryFiles function
This function is shared between AddNode and RedistributeConfig, and usedto redistribute additional files which are inherently part of thecluster configuration.
Remove the HTS_COPY_VNC_PASSWORD constant/feature
Currently just for xen-hvm we copy the vnc password on node-add. Thiswill be changed for 2.1 with a more advanced gnt-cluster redist-conffunctionality which is going to be used by node-add as well.
Change failover instance when instance is stopped
Currently, if the instance is stopped, we still check for enough memoryon the target node. This is a little bit too strict, since in case toomany nodes have failed and one is out of the memory, this prevents...
Export more instance information in hooks
Currently we miss in hooks the instance's hypervisor, hypervisorparameters and backend parameters. This forces hooks to query back intoganeti, which is dangerous due to possible luxi sockets exhaustion.
This patch adds these three as INSTANCE_HYPERVISOR, INSTANCE_HV_*,...
Merge branch 'master' into branch-2.1
Signed-off-by: Guido Trotter <ultrotter@google.com>
Merge commit 'origin/next' into branch-2.1
IAllocator: export total disk size for instances
This patch adds for current instance a ‘disk_space_total’ key, similarto the key for the new instance in case of new allocations.
Add -H/-B startup parameters to gnt-instance
This patch modifies the start instance script, opcode and logical unitto support temporary startup parameters.
Different from 1.2, where only the kernel arguments were supportingchanges (and thus xen-pvm specific), this version supports changing all...
call_instance_start: add optional hv/be parameters
This patch modifies the rpc.call_instance_start - the master side - totake optional hv/be parameters. The noded side is unchanged andoblivious to the change.
This will allow implementation of single-user capability and such on...
Instance reinstall: don't mix up errors
If the remote info rpc call fails we can't assume that the instance isup.
Don't check memory at startup if instance is up
LUSetClusterParams: improve volume group removal
Currently LUSetClusterParams will remove the volume group if the vg_namefield passed in is not true, but not None. Setting the target volumegroup to False or the empty string, though, is a bad idea because it's...
LUQueryClusterInfo: return a few more fields
Some fields can be set at cluster init, and perhaps even modifed withSetClusterParams but there's no way to know them. With this patch weexport them in the cluster info query.
LUSetInstanceParam: don't assume memory is integer
LUSetInstanceParam currently assumes that the 'memory' value of acall_instance_info result is an integer, while the rest of the codeexplicitely converts it to int(). Converting it to int works around a...
Remove some superfluous imports
This is for Python 2.6 compatibility.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Inform the OS create script of reinstalls
Sometimes reinstalls are slightly different than new installs. Forexample certain partitions may need to be preserved accross reinstalls.In order to do that on a per-os basis we pass in the INSTANCE_REINSTALLvariable to inform the create script about when a reinstall is...
Fix argument checking in LUSetClusterParams
This patch fixes two issues with LUSetClusterParams and argumentchecking.
First, this LU used the wrong function name (CheckParameters instead ofCheckArguments), which means that no parameter checking was done at all;...
Include node name in hypervisor validation errors
The current validation routine just says "failed", without specifyingthe node name. This is very confusing, and we should log the node nametoo.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Alexander Schreiber <als@google.com>
LUDiagnoseOS: change locking and error handling
Since the “list OSes” call is exported via RAPI, this can be used prettyeasily to DOS the master daemon during long jobs.
The implementation of LUDiagnoseOS makes an RPC call to all nodes; welock nodes here in order to prevent node removal....
Fix verify-disks with broken volume groups
When a remote node returns invalid LVM data, we check it, but we don'tstop and continue with the rest of the checks (which require a validvolume group). This raises an internal error and breaks verify disks.
This seems unchanged for a long while, I don't know why it surfaced just...
Prevent errors when xenvg is broken cluster verify
When vg_name is not returned at all, we currently abort with an internalerror. This is because we don't catch KeyError.
This patch adds a custom message for this case, and also adds KeyErrorto the list of catched exceptions, just for safety....
A bunch of doc and other small fixes
This patch adds a couple of both externally and internally reportedissues: - missing SGML tags (Issue 54), report and patch by superdupont - wrong variable used in the init.d script, report and patch by Karsten Keil <karsten-keil@t-online.de>...
Handle ghost instances in temp DRBD map
Currently cluster-verify doesn't handle the (admitedly invalid) case where wehave reservation for instances that were removed in the meantime.
This patch adds a check for this and prevents code errors in cluster-verify in...
Fix error handling in replace-disks with new node
Currently the _CreateSingleBlockDev function only raises OpExecError and notBlockDeviceError. This means that we don't release the instance's temporaryminors properly, and this creates problems later if the instance is removed...
Export tags to cluster verify hooks
This patch export the cluster and node tags to the cluster verify hookscripts. The tags are exported as a space-separated list, which allowseasy parsing from the shell (e.g. “for tag in $GANETI_CLUSTER_TAGS; do...”) and therefore requires the previous “Don't allow spaces in tag...
Update the iallocator documentation
This updates the iallocator documentation to 2.0, bumps up theiallocator version (and moves a constants to lib/constants.py), andfixes a style on install.rst.
Reviewed-by: ultrotter
LUVerifyCluster: Handle the "no volume group" case
If we're only file based and out volume group is set to "None" there'sno point in asking nodes for their volume groups, logical volumes, anddrbd devices, and checking those.
Reviewed-by: iustinp
Fix some epydoc style issues
99% of the epydoc return tags are "@return:", but each of the modified fileshad one "@returns:" line. We fix this for consistency.
Reviewed-by: imsnah
Update some hooks settings
While reviewing the hooks document, I realised we are not correctlyexporting the instance properties.
This patch fixes: - export the disk and disk template in all LUs, not only (hardcoded) in the instance create - removes the instance create INSTANCE_ prefix on some non-instance...
Remove the extra_args parameter in instance start
This patch removes the extra_args parameter and instead switches theinstance to the HV_KERNEL_ARGS hypervisor option.
This is a big change, but it's a needed cleanup, this extra parameter onall RPC calls is not generic and we also need to have a persistent value...
Make gnt-instance info work with offline nodes
This simply makes LUQueryInstanceData return the same information as fora static query when one or both of the nodes are down.
Fix some bugs in reboot
There are two issues fixed in this patch: - first, the recent RPC changes caused loss of data in hard reboot type; we weren't reporting any results from the stop/start instance calls; - second, in soft or hard reboots, we didn't initialized the disk...
Convert IOErrors for /proc/drbd into our errors
If /proc/drbd can't be opened, this raises an IOError, but all theerror-handling behaviour in backend treats only BlockDeviceErrors. Thiscreates a plain failure in cluster verify and in other RPC calls.
This patch simply converts EnvironmentErrors into BlockDeviceErrors, and...
SetInstanceParams: export nic changes to hooks
Currently we export the old instance "as is" and any nic changes getlost, so hooks won't know of a different ip, bridge, or mac address.This patch fixes it by putting the nics in the override dict, if anychanges are done....
LUSetInstanceParams: Fix nic handling
CheckArguments: Use constants.VALUE_NONE rather than hardcoding the string "none" If we're adding a nic fill the nic_dict with default values Check if the mac is syntactically valid, if we have one Don't allow the mac to be 'auto' when modifying a nic...