- 16 Feb, 2009 1 commit
-
-
Iustin Pop authored
If /proc/drbd can't be opened, this raises an IOError, but all the error-handling behaviour in backend treats only BlockDeviceErrors. This creates a plain failure in cluster verify and in other RPC calls. This patch simply converts EnvironmentErrors into BlockDeviceErrors, and also changes the RPC result for NV_DRBDLIST and its handling to be able to show the error. The other RPC calls work by default now, due the existing error handling. Reviewed-by: ultrotter
-
- 13 Feb, 2009 1 commit
-
-
Guido Trotter authored
Currently we export the old instance "as is" and any nic changes get lost, 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 any changes are done. Reviewed-by: iustinp
-
- 12 Feb, 2009 7 commits
-
-
Guido Trotter authored
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 CheckPrereq: Check that bridge and mac if present in the dict are not None (before this wasn't handled at all) Generate the nic mac address here if demanded Exec: Do not generate nics and macs Reviewed-by: iustin
-
Guido Trotter authored
We want the real nic to be shown to the hooks and the allocators, so we'll generate them in CheckPrereq. We also write a comment about the race condition we generate. This race condition existed even before, so moving this generation will just lenghen it a bit. A separate patch mitigates its effects. This patch also adds an ENDIF comment for a very long if, and removes a double empty line inside the CheckPrereq function of LUCreateInstance. Reviewed-by: iustin
-
Iustin Pop authored
This patch removes the admin_ram LUQueryInstances field (is broken anyway) and fixes the VNC address checks in the Xen Hypervisor. Reviewed-by: imsnah
-
Iustin Pop authored
The query fields are now regular expressions. We need to quote the dots, otherwise invalid fields will be accepted but they will lose special formatting in the cli scripts. Reviewed-by: imsnah
-
Iustin Pop authored
For (status, data)-style RPC calls, the result data is in the ‘payload’ attribute. This was missed in the conversion patch, with the only side effect that gnt-instance activate-disks didn't show a nice output anymore. Reviewed-by: ultrotter
-
Iustin Pop authored
This patch changes the return type from this RPC call to include status information and renames the backend method to match the RPC call name. The patch is a little bigger than the reboot one, since this call is used in more than one place. However, all the points of call have the same usage pattern, so the patch is trivial. Reviewed-by: ultrotter
-
Iustin Pop authored
This small patch changes the return type from this RPC call to include status information and renames the backend method to match the RPC call name. Reviewed-by: ultrotter
-
- 11 Feb, 2009 2 commits
-
-
Guido Trotter authored
Currently when adding disks the base for the index is not taken into account, and disk 0 is added twice. Reviewed-by: iustinp
-
Guido Trotter authored
Currently we use the HTS_USE_VNC constant only to copy the vnc password file. While KVM uses vnc it currently has no password support, nor we'll be on time making one for 2.0, so renaming the constant to HTS_COPY_VNC_PASSWORD and only putting Xen HVM in it. In the future (2.1) password handling will need to be reworked anyway. Reviewed-by: iustinp
-
- 10 Feb, 2009 11 commits
-
-
Iustin Pop authored
The patch changes the pre-checks in node-add and re-add: - if the node is not already in the cluster, refuse to re-add - when re-adding, reuse the secondary IP from the cluster configuration - when re-adding, reset the offline and drained flags, so that RPC calls work (and we can actually upload the keys) The patch also adds a missing log entry in LUSetNodeParams. Reviewed-by: imsnah
-
Guido Trotter authored
We want all the hv/be parameters to have a known type, rather than a random mix of empty string, boolean values, and None, so we declare the type of each variable and we enforce/convert it. - Add some new constants for enforceable value types - Add new constants dicts HVS_PARAMETER_TYPES and BES_PARAMETER_TYPES holding not only the valid parameters but also their types - Drop the old HVS_PARAMETERS and BES_PARAMETERS constants and calculate the values from the type dict - Convert all the default parameters to a valid type value - Create a new ForceDictType utils function, to check/enforce a dict's element value types, with relevant unit tests - Drop a few custom functions to check/convert the BE param types in utils and cli, in favor of ForceDictType - Double-check the parameter types using ForceDictType in both scripts and LogicalUnits, when possible. As a bonus: - Remove some old commented-out code in gnt-instance - Remove some already fixed FIXME - Fix a bug which prevented VALUE_DEFAULT to be applied to BE parameters in SetInstanceParams because the value was checked for validity before that transformation was made - Fix a bug which prevented initing a cluster and passing hvparams to work at all - ForceDictType allows an allowed_values for exceptions, which makes us able to do the checking even when some values must not be converted/typechecked (for example the 'default' string in SetInstanceParameters) Reviewed-by: iustinp
-
Iustin Pop authored
This patch adds LU and cli-level support for modification of the node drained flag. It is similar to the offline changes. Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds checks for drained nodes in the logical units that allocate or move instances around. We also update an error message (not style-compliant). Reviewed-by: imsnah
-
Iustin Pop authored
This patch changes slightly the output of gnt-cluster verify for drained nodes, and also adds a note with the total number of drained nodes (similar to the offline nodes note). Reviewed-by: imsnah
-
Iustin Pop authored
This patch exports the drained attribute: - LUQueryNodes accepts now the drained field - RAPI exports it for node objects - gnt-node info shows it now (along newly-added master_candidate and offline flags) - gnt-node list can list it (but not by default) - to the iallocator scripts Reviewed-by: imsnah
-
Iustin Pop authored
This attribute will be used to prevent any allocation on the node (any of replace-disks with new secondary this node, failover to the node, migration to the node). The patch adds the attribute and initializes it correctly in cluster init and for new nodes. Reviewed-by: imsnah
-
Iustin Pop authored
This converts the backend and cmdlib modules to a (status, data) implementation of the blockdev_remove rpc call. bdev.py is not yet converted, so we don't actually have error information. We also fix a bug in _RemoveDisks by not reusing a variable. Reviewed-by: ultrotter
-
Iustin Pop authored
This converts the backend and cmdlib modules to a (status, data) implementation of the blockdev_shutdown rpc call. bdev.py is not yet converted, so we don't actually have error information. We also fix a bug in _ShutdownInstanceDisks by not reusing a variable. Reviewed-by: ultrotter
-
Iustin Pop authored
This converts the RPC call blockdev_assemble to the new-style result format. Note that we won't usually have error information, but it's the first step toward it. Reviewed-by: ultrotter
-
Guido Trotter authored
In LUSetInstanceParam we used to save the dict without defaults for the instance params as hv_inst, but to use the populated one for the instance (hv_new). Fixing this leads to instances without all the parameters set. Reviewed-by: iustinp
-
- 09 Feb, 2009 6 commits
-
-
Iustin Pop authored
This patch adds a new instance query flag called disk_usage that retrieves the overall space used by an instance on each of its nodes. This can be used when balancing the cluster or checking N+1 status. The flag is also exported in RAPI. Note the flag is currently broken for file-based instances, as it represents the amount of space in the cluster volume group. Reviewed-by: ultrotter
-
Iustin Pop authored
Currently, the names of the functions in backend.py that are actually RPC procedures and are called from ganeti-noded are not corresponding to the RPC names. This makes it hard to actually see which functions are exported and which functions are internal to backend. This patch renames all blockdevice-related functions in backend.py match the name of the RPC call (without the ‘call’ or ‘perspective’ prefix). This should make it easier to grep for a given function called in cmdlib, without having to open and check in ganet-inoded what backend function it corresponds to. The patch also does two minor extra cleanups (rename a variable and change a logging level). Reviewed-by: ultrotter
-
Iustin Pop authored
This patch converts the call_blockdev_find - which searches for block devices and returns their status - to the (status, data) format. We also modify the backend function name to match the rpc call. Reviewed-by: ultrotter
-
Iustin Pop authored
This is a hand-picked forward patch of commit 1755 on the 1.2 branch (hand-picked since the trees diverged too much since then): The patch changed the xen hypervisor to compute the number of cpu sockets/nodes and enables the command line and the RAPI to show this information (for RAPI is enabled by default in node details, for gnt-one one can use the new “cnodes” and “csockets” fields). Originally-Reviewed-by: ultrotter For the KVM and fake hypervisors, the patch just exports 1 for both nodes and sockets. This can be fixed, by looking at the /sys/devices/system/cpu/cpuN/topology directories, and computing the actual information, but that should be done in a separate patch. Reviewed-by: imsnah
-
Iustin Pop authored
By using the RemoteFailMsg() or the payload field of RpcResult, we can simplify a few functions in cmdlib. Reviewed-by: ultrotter
-
Iustin Pop authored
In lockless queries, it's better if we see the instance in ADMIN_down rather than ERROR_down during the time it's installed. As such, we change the LU to only mark the instance 'up' at the time we are ready to start it. Reviewed-by: ultrotter
-
- 04 Feb, 2009 2 commits
-
-
Iustin Pop authored
Similar to the instance list, this patch enables lockless node queris. “gnt-node list” accepts now the “--sync” flag which enables locking, the default is lockless. Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds the framework for, and enables lockless OpQueryInstances. This means that instances will be shown in ERROR_up or ERROR_down state, even though this is not an error (but just an in-progress job). The framework is implemented as follows: - the OpQueryInstances, OpQueryNodes and OpQueryExports opcodes take an additional “use_locking” flag which will denote whether to lock or not; this patch only implements this for LUQueryInstances - the luxi query functions take an additional argument use_locking which is passed to the master daemon, and then passed to the above opcodes - cli.py export a new SYNC_OPT command line options which implement setting this flag to true - except for gnt-instance list, which uses this option, and for name-only queries (e.g. QueryNodes(fields=["names"])), all other callers are setting this flag to True - RAPI also sets the flag to True The patch was tested with a continuous (0.2s sleep in-between) gnt-instance list during a burnin, and no problems were observed. Reviewed-by: ultrotter
-
- 03 Feb, 2009 2 commits
-
-
Iustin Pop authored
This patch unifies the hardcoded re-encoding attempts into a single function in utils.py. This function is used to take either an unicode or str object and convert it to a ASCII-only str object which can be safely displayed and transmitted. We replace then the current manual re-encodings with this function. In mcpu we stop re-encoding the hooks output and instead we do it right at the hook generation in backend.py. This passes on my 'custom' lvs output with non-ASCII chars. But there are probably other places we will need to fix. Reviewed-by: ultrotter
-
Iustin Pop authored
This small path hopefully fixes the handling of ssh verify errors in node add (note: untested). Reviewed-by: ultrotter
-
- 02 Feb, 2009 1 commit
-
-
Iustin Pop authored
When the rpc call node_add fails, we don't have any error message. This patch changes the call to return (status, data) so that the user can see the correct error message. Reviewed-by: imsnah
-
- 01 Feb, 2009 1 commit
-
-
Guido Trotter authored
We don't need to show hvparams for hypervisors which are not enabled on the cluster. Reviewed-by: iustinp
-
- 29 Jan, 2009 4 commits
-
-
Guido Trotter authored
Before we used to copy the file if xen-hvm was enabled on the cluster, no we'll do that if any enabled hypervisor is in the new HTS_USE_VNC group. Reviewed-by: iustinp
-
Guido Trotter authored
Sometimes the hypervisor will use the instance hv and/or be parameters to determine the best shell command. This is not possible, though, currently, as the instance hv/beparams are not filled, so we have to pass the filled versions separately. Reviewed-by: iustinp
-
Iustin Pop authored
Currently the LUVerifyCluster only reports the protocol version changes, not software ones. This is useful to know/monitor, so we add this too as a warning. Reviewed-by: ultrotter
-
Iustin Pop authored
Currently LUQueryInstances keeps the ordering of instances only in some cases, and in others it will reorder the list. This patch fixes this by more clearly separating the various cases (names passed or not and locking or not locking), so that the output list is in the same order as always. Of course, this disables the sorting when arguments are passed. Reviewed-by: ultrotter
-
- 28 Jan, 2009 1 commit
-
-
Iustin Pop authored
Reviewed-by: ultrotter
-
- 27 Jan, 2009 1 commit
-
-
Iustin Pop authored
Currently, only the LUSetInstanceParams correctly sets up the mode attribute via a manual operation. We remove this and instead do the correct setting in the generic _GenerateDiskTemplate function, so that we set the mode correctly for all disk creations. Reviewed-by: ultrotter
-