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
config.py, objects.py: more node group support
In particular:
- add AddNodeGroup and RemoveNodeGroup in config.py
- refactor _UpgradeConfig to make use of _UnlockedAddNodeGroup
- add support for objects.NodeGroup in ConfigWriter.Update; add missing...
Adding new OpCode for OOB
Register OpCode and Logical Unit in mcpu.py
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adding new Logical Unit for OOB
cmdlib: Don't sort list of nodes if names are given
This makes _GetWantedNodes consistent wit _GetWantedInstances.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
utils: Add function to find duplicates in sequence
hv_kvm.py: fix some lint issues introduced in 4b784cf
- break as couple lines that were longer than 80 characters - fix a couple "comma not followed by a space" - fix an unused variable warning
Signed-off-by: Adeodato Simo <dato@google.com>...
locking: add nodegroup lock level
This also changes masterd to initialize the ganeti's manager with thecurrent list of nodegroup uuids, and updates unittests
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Remove bridge NIC slot
This has been deprecated and unused since 2.1.
kvm: Make _GetKVMVersion() return integers
The current code returns the major, minor and rev portions of the version ofKVM as strings. Returning them as integers makes it easier to compare.
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>...
kvm: Improve network syntax and tests
The current syntax when defining a NIC uses a pair of arguments, like this:
-net tap,vlan=0 -net nic,vlan=0,model=virtio
When using this pair, internally KVM will create a VLANState structure to sendethernet frames between the guest NIC and the host tap device. This is...
Merge branch 'devel-2.3'
Conflicts: NEWS: Trivial
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Make snapshots multi-vg aware
Currently, the Snapshot() function of LogicalVolume returns only thelogical volume path, with the assumption that we only have one VG. Butwith the recent changes, it makes more sense to return the full data (vgand lv) from it, so as to not require computing it in the master....
config.py: add error code to OpPrereqError
This adds a errors.ECODE_NOENT for OpPrereqError in LookupNodeGroup.
Signed-off-by: Adeodato Simo <dato@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
config.py: replace "node group" with "nodegroup"
Though code uses "nodegroup" as data member name, strings that will beread by the user should use "node group" (with a space), since "nodegroup" is not a word.
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
opcodes: document OP_DSC_FIELD in OpCode and OpCode.Summary()
Signed-off-by: Adeodato Simo <dato@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
locking: Clarify message for removed locks
Just being told that a lock doesn't exist can be confusing. One casewere this happens is when a job (e.g. instance modify) waits for a jobremoving the instance (e.g. export with remove).
Querying node groups: add luxi.REQ_QUERY_GROUPS
This also updates masterd.py.
Querying node groups: add client/gnt_group.py
This implements `gnt-group list`.
Querying node groups: RAPI support
This implements /groups and /groups/%s RAPI end points.
Querying node groups: LU/Opcode
This adds opcodes.OpQueryGroups and cmdlib.LUQueryGroups.
impexpd: Disable OpenSSL compression in socat if possible
This uses an option only available in patched socat versions. Moreinformation is available from the INSTALL update included in thispatch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>...
Adding RPC infrastructure to call oob
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Adding backend functionality to call oob helper
Adding ndparams to gnt-cluster init|modify and man page
This is reverting the revert and adaption to fix the issue which causedthe revert
Conflicts: Makefile.am
config.py: need explicit %-formatting in errors.OpPrereqError.
Trivial style fixes
Add missing closing brackets and fix a typo.
cmdlib: Add base for query classes
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
LUQueryNodes: Convert to new query model
Add OpQuery opcode
Add node query definition
This includes a bunch of helper functions which can be helpful for otherqueries, too. Unittests are included.
Add query constants
Add utility class for definition-based data queries
While not immediately visible, using definition-based queries will allowfor a number of optimizations and simplifications. This patch justcontains the utility class used for executing queries.
Add simple query filter parser
This parser reads only the format described by the query2design document: either an empty filter or an OR operatorwith equality checks as operands.
bootstrap: Set master node's {c,m}time on cluster init
RAPI: Implement OS parameters for instance reinstallation
Dictionaries are hard to encode into query strings, therefore the“/2/instances/[instance_name]/reinstall” resource is changed to acceptits parameters via the request body. The old query string parameters are...
Revert "InitCluster support for ndparams"
This reverts commit fd7f5b411ca61be2e4eff638773ba6c0fac7eb32.
Revert "Adding ndparams to gnt-cluster init|modify and man page"
This reverts commit cb1ef9736dec68d6786359bc7d019f0bbee48c61. QA wasbroken by this commit.
Move “rapi_users” file into separate directory
This reduces the number of notifications in “ganeti-rapi”. Until now itwas notified for every change in …/lib/ganeti and had to check whetherthe users file was affected. A symlink is always created in cfgupgrade...
objects: Add QueryFieldDefinition
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
backend: Add support for IPv6 in import/export
impexpd: Implement support for IPv6
Adding ndparams to gnt-node add|modify and man page
InitCluster support for ndparams
Fix typo in _ANS1_TIME_REGEX
Thanks Balasz!
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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.
Add missing paramter and unittests for this case
While git-am'ing the blockdev_prefix patch, I modified the hv_xen.pyfile but forgot to amend the patch :(, so here it is.
Furthermore, to detect such inconsistencies in the future, a unittest isadded that cross-checks the default parameters in constants.py and the...
Adding blockdev_prefix to hypervisor options
Allows to install Red Hat based systems, for example Oracle Linux.Tested with OEL.
The hypervisor by default offers a device named 'sda'. If the SCSImodule is already loaded, the disk device can't be created due to naming...
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.
The default value for ndparams should be None not {}
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>...
Added "vg" argument to the --disk syntax
Added "vg" argument to the "gnt-instance ... --disk" syntax specification.Now is ok to write:
gnt-instance add ... --disk N:size=NNg,vg=VG_NAME ...
But not all internal structures are ready to handle this yet....
Adding --node-parameters command line flag
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....
Adding convenience getter for ndparams
RAPI: implement no_install during instance creation
Signed-off-by: Lance Albertson <ramereth@gmail.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
utils._RunCmdPipe: simplify the timeout logic
There are two issues: first, it's simpler to assign directly to ptinstead of via another local variable. Second, this code doesn't makesense: if lt < 0: break pt = max(0, lt)
If lt is indeed < 0, then the code will break. Otherwise, lt ≥ 0, and...
utils._RunCmdPipe: fix poller timeout usage
This patch makes a simple timeout test (e.g. testTimeoutKill) go from13K poll syscalls to just 6. The code didn't take into account thatRunningTimeout talks in seconds while the poller object expectsmilliseconds....
RAPI: export the node group UUID in the node query
Adding oob_program in the same style as beparams
Support timeouts in RunCmd
Further investigations have to be done for merging some of these bitstogether with import-export daemon which uses similiar logic.
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)....
Move locking.RunningTimeout to utils
As we need this functionality in other places than just locking it makessense to move it to utils rather than keeping it in locking
Add group, group.uuid fields in node list
This is needed to at least see the current group configuration.
Add unittests for TemporaryReservationManager
And fix an error message.
TempReservationManager: Reserved() doesn't work
Note: It appears this has been around since the initial checkin ofTemporaryReservationManager. I have no idea what this could break, sosomeone else may want to test this more thoroughly.
Signed-off-by: David Knowles <dknowles@google.com>...
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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 shebang line from ganeti.server.*
Some of then were forgotten.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Drop the -g shortcut for --vg-name
Changing the volume group is a lot less frequent than acting on a nodegroup. As such we drop the "-g" shortcut and require the long option tobe passed. In 2.3 the commands which used to accept the volume group as"-g" won't have any node group option, so no confusion will arise. Later...
Merge the common options between import and add
The "I always wanted to do this" commit.
Improve LookupNodeGroup's docstring
Add ConfigWriter.GetNodeGroup
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.
luxi: disable two lint errors
This is already disabled for the same type of request a couple of linesabove. The new code was introduced in e986f20c but didn't have thedisables.
Add -s option to gnt-node modify
We can now change a nodes' secondary ip.
config: Write ssconf after renaming instance
This fixes a bug where the ssconf_instance_list file wasnot updated after an instance rename.
Move ganeti-noded to ganeti.server.noded
Move ganeti-rapi to ganeti.server.rapi
Move ganeti-confd to ganeti.server.confd