History | View | Annotate | Download (392.2 kB)
Rename OpPrepareExport and LUPrepareExport
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Rename OpQueryExports and LUQueryExports
Rename OpExportInstance and LUExportInstance
Fix bug introduced by f5677ab
Commit f5677ab added the _VerifyOob functionality, but there are twoissues with this function:
- a real bug, as objects.Node doesn't have a 'master' attribute- a design bug, as we need to verify the OOB programs not only on...
Fix growing of DRBD disks
Patch 03941a26 made disk growth VG-aware, but the code has a bug: itonly works for LD_LV disks, and not LD_DRBD. To fix it, we add ageneric function to compute the per-VG growth requirements, and switchto using that instead of manual build....
List node parameters (if any) in gnt-node info
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
List node parameters in gnt-cluster info output
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
gnt-group modify: ndparams not correctly updated
ndparams should delete keys which are reset to default
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Adeodato Simo <dato@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Pause/Resume sync accordingly before wiping disk
Add OpAssignGroupNodes and LUAssignGroupNodes
This operation allows to assign nodes to a group, verifying whetherthe change would leave any mirrored instance split between differentnode groups.
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Cluster verify warns if there are split instances
Emit a warning for each instance with a mirrored disk template that hasits primary and secondary nodes living in different node groups.
IAllocator: fix breakage for non-vm_capable nodes
Currently, the IAllocator doesn't know that non-vm_capable nodesshould not be queried for hypervisor/instance information.
This patch updates the node data computation to generate basic info,but not the runtime data for such nodes. Furthermore, the...
Use new console information in hypervisor abstraction
This makes use of the new way of returning console information from themaster daemon. Unittests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Introduce verbose opcode result for console
With this patch OpConnectConsole will no longer just return a commandwith arguments, but rather a detailed description about how to connectto an instance's console. Unittests for some parts are included. Another...
Support query of node field 'powered'
This field is based on OOB support and is only available if there's oobsupport for that node.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
cmdlib.py: convert LUQueryGroups to query2
cmdlib.py: move _GetQueryImplementation to end of file
_GetQueryImplementation() uses _QUERY_IMPL, which list all query typeimplementations. By moving it to the end of the file, we ensure all suchclasses are defined by the time we list them.
Signed-off-by: Adeodato Simo <dato@google.com>...
out of band verification in gnt-cluster verify
This adds the verify tests for out of band management
Migrate code verifying opcode parameters to base class
This allows the function to be used in other places as well.An optional parameter is added to control whether defaultvalues should be set. Unittests are added, providing fullcoverage.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
cmdlib: Remove opcode parameters
Remove the parameter definitions and use those from the opcode classesinstead. Small style changes are also made (empty lines, wrapping).
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
LUInstanceRename: log result of name resolving
While the LU does return the final name, it's useful to log the actualDNS resolving process (input and output) in order to help with thediagnose of failures.
The patch also fixes the docstring of the Exec() function....
query: Add wrapper for creating response object
It'll be used for querying locks.
Move QueryFields to query module
Also replace “sorted” with “utils.NiceSort” now that it supports a keyfunction.
Merge branch 'devel-2.3'
Conflicts: NEWS: Trivial
Merge branch 'stable-2.3' into devel-2.3
LUSetNodeParams: Add support for powered state
LUSetNodeParams/LUOobCommand respect offline/powered
This patch makes sure we cross verify the state the node isin with our view:
power off -> Node has to be set offlinemodify -O no -> Node has to be powered
Signed-off-by: René Nussbaumer <rn@google.com>...
Conflicts: lib/cmdlib.py: Trivial qa/ganeti-qa.py: Trivial...
ShutdownInstanceDisks: accept offline secondaries
For secondary node that is offline, we should not consider that thedisk shutdown has failed, as it can never succeed under this clusterstate and (by virtue of the fact that the secondary node is offline)...
LUAddNode: default ndparams to empty dict when not provided
Fix gnt-cluster verify with diskless instances
`gnt-cluster verify` was failing with KeyError if there was anydiskless instance in the cluster. This was because _CollectDiskInfo()was not including these instances in the returned dictionary, but theywere expected to be present in LUVerifyCluster.Exec()....
Fix N+1 error message
The error contained a typo and is slightly cumbersome. It changes from:
- ERROR: node a: not enough memory on to accommodate failovers should peer node b fail
to:
- ERROR: node a: not enough memory to accomodate instance failovers should node...
Rename (Op|LU)OutOfBand to (Op|LU)OobCommand
Do the expanding of the node name in ExpandNames
iallocator: Export node group allocation policy
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Set powered to True for added nodes
Set recorded powered state for OOB calls
Add the "alloc_policy" attribute to node groups
This can be set at group creation time and via OpSetGroupParams. The defaultis "preferred", and existing node groups from previous Ganeti version willget the attribute set to this value.
Add modification of node groups (OpCode/LU/CLI)
With this commit, only modification of the "ndparams" attribute issupported.
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Introduce OpAddGroup.ndparams and expose in CLI
Fix sorting bug in LUQueryGroups
In LUQueryGroups.Exec(), NiceSort was being applied to group UUIDs, andnot to group names. We use a temporary name to UUID map to sort the listof UUIDs by group name instead.
cmdlib: Sort list of fields for QueryFields
objects: Add custom de-/serializing code for query responses
… and use them in cmdlib.
Add gnt-cluster modify --master-netdev
Although this might be a dangerous operation, it's still better to allowit rather than requiring a hand-edit of the config file, should it benecessary.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
cmdlib: Convert instance query to new infrastructure
Fix disk status verification in LUClusterVerify
Commit b8d26c6 added disk status verification, but it has two(different) bugs for not healthy nodes.
For offline nodes, we don't add at all the disk status to theinstance/node dict, with the result that the instance is not present in...
Check payload of OOB execution
Replace GetOobProgram by GetNdParams
This was due to a older review which used GetOobProgram but thenchanged to GetNdParams. Forgot to adjust this in the LU before.
Allow rename of instance to same name
This basically is a no-op in ganeti, but forces the execution of theos-specific rename scripts.
Node query: maintain order as requested
If the client requests certain names, their order should be maintained.This is already done for instance queries. Moving this part into aseparate function allows sharing code.
cmdlib: Fix prototype for _QueryBase.DeclareLocks
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
Group operations: OpCode and LU for renaming a group
Group operations: OpCode and LU for removing a group
Group operations: OpCode and LU for adding a group
Expose new node group attributes in CLI and RAPI
Adding new Logical Unit for OOB
cmdlib: Don't sort list of nodes if names are given
This makes _GetWantedNodes consistent wit _GetWantedInstances.
Make rpc.call_lv_list() VG-aware
Changes to backend.GetVolumeList():- now accepts a list of VGs instead of one VG- returns LV names in the form "vg_name/lv_name"
Corresponding changes are done in: VerifyDisks, VerifyNode,LUCreateInstance (for both disk creation and adoption cases)...
cmdlib: fix typos in the docstring for LogicalUnit
Querying node groups: LU/Opcode
This adds opcodes.OpQueryGroups and cmdlib.LUQueryGroups.
Signed-off-by: Adeodato Simo <dato@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Trivial style fixes
Add missing closing brackets and fix a typo.
cmdlib: Add base for query classes
LUQueryNodes: Convert to new query model
Add OpQuery opcode
Increase timeout for connection on remote import
The source cluster has to shut down an instance before it can beexported. Doing so can take a while, but the default connection timeoutis only 60 seconds. Adding the shutdown timeout on the receiving cluster...
Use IPv6 for import/export
Move compilation of some regexes to init time
I have found a few regexes which are static and thus can be moved toload time, rather than run time, creation.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
RPC call_node_info: change protocol
Currently, the call_node_info RPC does always check both the VG freespace and the hypervisor information. However, in ⅔ of the uses, we onlycare about one or the other. Therefore, we change it so that if any ofthe passed parameters is None, we don't perform the respective check. We...
Cluster rename: skip offline nodes
This only tries to upload the ssh_known_hosts_file to the online nodes,eliminating a timeout and warning for offline nodes.
Fix missed CheckArguments on ndparams for SetNodeParams
In the previous patch where I modified LUSetNodeParams to take ndparamsinto account I missed this additional check of parameters in the LogicalUnit. This patch adds ndparams to the recognized parameter lists which...
Fix per-vg checks in instance disk conversion
Since we now have just two possibilities (plaint to drbd or drbd toplain), we can assume (+an assert) that we come from LVM and accessdirectly logical_id0 for the VG on which it is stored.
Signed-off-by: Iustin Pop <iustin@google.com>...
Removed _CheckNodesFreeDisk function
Was substituted by _CheckNodesFreeDiskPerVG.
Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Make instance creation VG-aware
Also should work disk growing, instance moving and prerequisite checks.
Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>[iustin@google.com: small style fixes]Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Introduced VG-aware disk space checks
Implemented _CheckNodesFreeDiskPerVG and _ComputeDiskSizePerVG functionsfor VG-aware iterations.
Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>[iustin@google.com: some style fixes (long lines, etc.)]Signed-off-by: Iustin Pop <iustin@google.com>...
Adding ndparams to their OpCodes and LU calls
cmdlib: Use _POutputFields where possible
Basic stuff to allocate disks on different VGs
Extend allocation functions to be aware of different vg names. Suppose,vg_name is helded in disk.physical_id0 (already was) LUCreateInstanceis modified to be aware of new "vg" argument of the disk specification....
Reinstall instance: disallow offline secondaries
Currently, reinstallation of a DRBD instance with the secondary node offline does:
node1# gnt-instance reinstall -f instance1Waiting for job 139053 for instance1...Thu Nov 18 01:36:09 2010 - WARNING: Could not prepare block device disk/0 on node node3 (is_primary=False, pass=1): Node is marked offline...
Fix breakage in OS state modify
I was using the feedback_fn function incorrectly (it doesn'tautomatically expand the arguments).
Merge branch 'devel-2.2' into devel-2.3
Conflicts: lib/cmdlib.py (reverted & applied manually the change)
LUSetClusterParms: fix validation of beparams
Since the contents of the dict is validated via the ForceDictType, we cansimply require that it is a dict here. The previous check was wrong, as it wascopied from the HV checks (which also doesn't verify the leaf dict type)....
Add group, group.uuid fields in node list
This is needed to at least see the current group configuration.
Fix disk checks in “gnt-cluster verify”
Tests have shown that the changes in commit b8d26c6e5 don't work aswanted. If any disk wasn't found on the node, all disks located on thesame node would show as faulty. The cause was incorrect exceptionhandling on the node....
Remove private ip mention in error message
There is no "private" ip in Ganeti, we only have primary and secondaryones. Whether they are public or private is a per-installation detail.
Add -s option to gnt-node modify
We can now change a nodes' secondary ip.
LUExportInstance: Accept instance already shut down
To remove the instance after an export it needs to be stopped. This canbe achived using the parameter “shutdown”, or by explicitly shuttingdown the instance before exporting. The latter would still require the...
Prevent onlining a node without working noded
This is just a basic check, plus a warning. In the future, we might domore checks, or prevent simple onlining (without readd) if --force isnot passed.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Yet another rework in LUSetNodeParms
We will need the new role in CheckPrereq, so move its computation thereand save the new role to self.
Prevent moving/creating instances on non-vm nodes
This small patch modifies LUCreateInstance, LUReplaceDisks andLUMoveInstance to not use non-vm_capable nodes.
Add vm_capable to LUSetNodeParams
And also do some cleanup: we only run the role changed actions if thenode has actually changed roles.
Add support for vm_capable in cluster verify
The method to make vm_capable integrate easily into cluster verify is as follows:
- we add a new NV_VMNODES that represents nonvm-capable nodes the LU populates this list (it's expected that non-vm_capable nodes...
Add an UploadHelper to cmdlib
This is used in two places already, and will be needed in a third, solet's abstract it.
Add support for vm_capable in file distribution
Add the master/vm_capable flags in node add
Add a CheckNodeVmCapable helper in cmdlib
Also changes the error code for the other CheckNode* helpers toECODE_STATE, not ECODE_INVAL: ECODE_INVAL is for requests that areinvalid (e.g. create drbd instance with one node), whereas ECODE_STATEdenote requests that are not satisfiable due to cluster/node/instance...
LUClusterVerify: Complain if disk is marked faulty
This will show a warning if, for example, one side of a DRBDdisk becomes unavailable. The data is collected separatelyfrom the other verification data.
Example output:
Implement the master_capable flag in node modify
Export the capability flags in query, rapi, ialloc
Add the master/vm_capable flags to objects
This adds the flag and some initial handling. The rest of the changes,for cmdlib, come in a separate patch.