History | View | Annotate | Download (397.4 kB)
Do the expanding of the node name in ExpandNames
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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.
Signed-off-by: Adeodato Simo <dato@google.com>...
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
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
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
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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....
Merge branch 'devel-2.3'
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).
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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.
Rework node role changes
There have been many bugs in gnt-node modify. Let's try to introducesome more.
This patch reworks the node role changes from tracking the flag changesto completely overwriting the flags based on the new role. This pavesthe way for (in 2.4 or later) moving to a single attribute for nodes....
Merge branch 'devel-2.2'
Allow remote imports without checked names
By default all names are checked (LUCreateInstance, name_check). In somecases it can be useful to disable this check, but doing so was notallowed for remote imports. One should be aware, however, that usingthis feature can lead to rename script failures when importing a remote...
Support modify of prealloc_wipe_disks config value
Export a node's group information in iallocator
Rename node.nodegroup to node.group
In the context of a node, its group has (at least today) only onemeaning, that is the node's node group. As such, we renamenode.nodegroup to just node.group.
Note: if we want to keep node in there, it should be at least...
Export node group data in iallocator
Split IAllocator._ComputeClusterData
The node and instance computations were all in this big function; weseparate them out for more clarity.
Putting the pieces together and invoke the wipe in cmdlib
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
LUSetInstanceParams: Remove unused attribute
“os_new” is not used anywhere, removing it.
Fix remote imports
A simple typo…
Fix typo introduced in 8d8c4ef
Commit 8d8c4ef broke instance reinstall with different OS, due to anattribute typo.
Fix clearing of the default iallocator
And also update the man page.
gnt-instance reinstall: Allow overriding OS parameters
This allows OS installation scripts to make use of special parameters,e.g. to retain some data on reinstallation.
The RAPI resource is not updated as it takes all parameters via thequery string and encoding arbitrary data in a query string is tricky....
Add option to ignore offline node on instance start/stop
In some cases it can be useful to mark as an instance as startedor stopped while its primary node is offline. With this patch,a new option, “--ignore-offline”, is introduced to “gnt-instancestart” and “… stop”....
Let gnt-cluster support prealloc_wipe_disks
This includes a new option gnt-cluster init and approriate outputon gnt-cluster info. Though gnt-cluster modify is not yet prepared.
Move the parameter types to their own module
This is for cleanup, and for later reuse in other parts of the code(outside of LUs).
Export more information via LUQueryInstances/RAPI
Currently, the custom instance parameters (hv, be, nicp) are onlyqueryable via LUQueryInstanceData. LUQueryInstance returns only thefilled parameters, thus its users (especially RAPI) have no way to know...
Show instance state in instance console failures
The current message is not entirely clear, as it doesn't show the reasonwhy the instance is not running.
Export VG name via LUQueryConfigValues
This will be used by LUXI client programs to display the VG name.
LUGetTags: Acquire locks in shared mode
Retrieving tags can be done while the lock is shared. Only writingneeds to be exclusive.
Also add a FIXME for cluster tags, where the code currently doesn'tuse any locks except the config lock.
LUDelTags: Improve formatting of error message
Use utils.CommaJoin to add spaces after comma, clean up code a bit.
Before: Tag(s) 'bar','baz','foo','moo' not foundAfter: Tag(s) 'bar', 'baz', 'foo', 'moo' not found
Conflicts: lib/objects.py (trivial, strange that this one, and only this one, conflicted)
Rename the _oss cluster vars to _os
Per the mailing list discussion, rename _oss to _os, both in cluster parametersand in the rest of the code.
This is just an s/_oss/_os, with the exception of a small bit of cleanuparound the helper_os function in cmdlib.py....
Fix instance rename regression from 3fe11ba3
Committ 3fe11ba3 broke the instance rename as we don't use the FQDNanymore. This fixes it.
Sort OS names and variants in LUDiagnoseOS
The OS list and variants as returned from LUDiagnoseOS is not sorted,and gnt-instance reinstall doesn't sort it either. This means that itthe menu that users are present with is inconsistent across clusters,and that is confusing....
Change behaviour of OpDiagnoseOS w.r.t. 'valid'
This patch changes the behaviour of OpDiagnoseOS with regards to the'valid' field to be similar to the one for the hidden/blacklistedfields: unless this field is requested, invalid OSes are filtered out....
Allow gnt-os modify to change the new OS params
Add two more _T-type tests
These are useful for more in-depth checking of some kinds of arguments.
Add blacklisted/hidden OS support in LUDiagnoseOS
This changes the behaviour of LUDiagnoseOS significantly.
The addition of hidden/blacklisted OSes would mean that each user-facingclient would have to filter intentionally such OSes from display, whichis not a good choice. Rather, the patch makes LUDiagnoseOS not return...
Restrict blacklisted OSes in instance installation
Abstract OS name/variant functions
Currently, the computation of the 'pure' name or the variant ishardcoded and spread around the functions that need it. This is notnice, and in the future we'd spread it even more with more usage ofvariants/pure os names....