History | View | Annotate | Download (615.4 kB)
Check for uniform DRBD version in node group
This check is performed during gnt-cluster verify and outputs warningsif at least two different DRBD versions are found within a node group.In such a case, all nodes with their installed DRBD version aredisplayed....
Rename DRBD8 to DRBD8Dev
Right now the DRBD8 class has multiple responsibilities: a) itreprensents a device which can be set up, grown, etc. and b) itrepresents the whole DRBD system on a node which has a usermode helper,which knows how to shut down all devices, etc. Therefore, the DRBD8Dev...
Merge remote-tracking branch 'origin/stable-2.8'
Conflicts: lib/bdev.py lib/cmdlib.py
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Merge stable-2.7 into stable-2.8
Conflicts: INSTALL NEWS configure.ac src/Ganeti/Query/Group.hs test/hs/Test/Ganeti/Objects.hs test/hs/Test/Ganeti/Query/Query.hs
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
gnt-cluster modify: check vg name only on vm-capable nodes
This fixes issue 432: when setting the volume group name, the presenceof the volume group was checked on all nodes. This patch now restrictsthe check only to the vm-capable ones.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Merge branch 'stable-2.8' into master
Add multiple min/max specs in instance policy
Now instance policies can contain more than one min/max specs. This is themain element of the "Constrained instance sizes" section in the"Partitioned Ganeti" design doc.
This is a big patch, but changing the type of a configuration item requires...
Fix unclear error when replacing a nic's ip
The current error message ends up saying something like'192.168.5.5' != 'network1', which is sort of non-intuitive (yes, ofcourse they are different). Fix this by explaining better what theerroneous condition actually is....
Fix lint error in cmdlib
Was accidentally introduced by commit 912737ba.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
gnt-cluster modify/init: deprecate --no-lvm-storage
This patch does three things:
1. It deprecates the option '--no-lvm-storage' of 'gnt-cluster modify'and 'gnt-cluster init'. Technically, it is not fully removed, but kept in orderto warn the user that it is no longer supported and that she should use...
In plain to drbd conversion, rename LVs back on failure
Currently, if converting an instance from plain to drbd fails afterrenaming the original LVs, the instance is left in an inconsistentstate. This commit tries to undo the renaming if a failure occurs...
Merge branch 'stable-2.7' into stable-2.8
Conflicts: NEWS doc/rapi.rst
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Reason trail implementation for "start"
Opcode-specific implementation of the reason trail for the instancestartup operation.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Reason trail implementation for "shutdown"
Opcode-specific implementation of the reason trail for the instance shutdownoperation.
Limit specs in instance policies are always complete
Specs used to specify limits in instance policies are always complete, evenat group level (only the whole limit set can be overridden). This is inpreparation for introducing multiple limits.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Reason trail implementation for instance reboot
This commits allows ganeti to correctly forward the reason trail informationregarding instance reboot.
Remove old "reason" implementation
Remove the useless parts of the old, partial, implementation of the support fortracking the reason of instances state change, before implementing the newreason trail support, as per the design document.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Allow proper cleanup of partially created disks
During the creation of an instance, if the creation of disks fails, somepartially created disks might remain lying around. There is an alreadyimplemented cleanup procedure, but it requires the disks to be listed in the...
Support quering for devices names and UUIDs
Extend instance queries to list 'uuid' and 'name' fields of instance'sDisks and NICs.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Check that device names are unique and valid
Extend the CheckArguments phase of LUInstanceCreate and CheckPrereqphase of LUInstanceSetParams to also check if the name parameters ofdisks and NICs are unique and valid.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>...
Implement renaming Disks and NICs
Implement renaming Disks and NICs in LUInstanceSetParams. Remove codethat checked that changing disk mode was the only disk modificationsupported. Also, handle case of 'None' value for 'name' parameter.
Support UUIDs and names when refering to a device
Modify _ApplyContainerMods function to lookup NICs/Disks not only by theirindex inside the container, but also by their UUID or name. Abstract thelookup code in new GetItemFromContainer function.
Make type of identifier in "opcode._TestInstSetParamsModList" to be...
Support UUIDs and names when handling NICs/Disks
Handle UUID and name fields when creating/managing NICs and Disks. Also,export NICs and Disks names to instance hooks environment.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>...
Add IDISK_NAME and INIC_NAME constants
Declare IDISK_NAME and INIC_NAME constants and add them to theIDISK_PARAMS_TYPE and INIC_PARAMS_TYPE.
Merge branch 'devel-2.7'
gnt-instance: no instance creation with disabled templates
This patch makes sure that no instances can be created which usedisk templates which are not enabled on the cluster.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtarara@google.com>
Removes obsolete 'enabled storage types'
Since managing of different storage units is now done usingdisk templates and not storage types, we remove the obsoleteenabled storage types.
gnt-cluster modify: verify instance's disk template usage
Adds a verification step to 'gnt-cluster modify' to make sure that nodisk template is disabled that is currently in use by at least one instance.
gnt-cluster modify: modify enabled disk templates
Adds setting of the list of enabled disk templates to 'gnt-cluster modify'.Note that this does not yet include any verification regarding disk templatescurrently used by instances.
Properly update iv_name of disks while changing templates
Trasforming the disk of an instance from DRBD to plain did not properlyupdate the iv_name of disks, leaving it to None.
This commit modifies _ConvertDrbdToPlain to properly set the iv_namevariables....
Postpone non-urgent TODO from 2.7 to 2.9
Restrict instance move to templates based on local files
Moving an instance is done by copying over the disks. Restrictthis to disk templates that are copyable. This avoids accidentaluse on, e.g., the sharedfile template.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Do not _RemoveDisks after failed _CreateDisks
Now that _CreateDisks cleans up after itself in case of failure,do not clean up at call sites, as there we have to overapproximatethus potentially causing data loss.
Make _CreateDisk clean up partially created disks on failure
_CreateDisk used to just throw an exception if _CreateBlockDev failedleaving the caller in the state that some disks were created, withoutprecise knowledge which. Usually, the clean up then overapproximated...
Make LUInstanceSetParams handle pnode parameter
If pnode is set LUInstanceSetParams now sets the primary nodeaccordingly. Unless force is set, it is verified that the instanceis no longer running on the old node.
Refactor ispecs in ipolicy structures
Minimum and maximum instance specs are put together into a single elementof the instance policy. This is in preparation for introducing multiplemin/max specs.
gnt-cluster modify: limit storage type consistency check
This fixes the currently broken Q&A. The consistency checkfor storage types is now only run when the 'enabled_storage_types'are actually changed by 'gnt-cluster modify'.
Check if instances use disk templates that get disabled
When disk templates get disabled via 'gnt-cluster modify', so farwe did not check if any instances still use a disk template of thattype. This patch adds the necessariy check.It also includes adding a map of disk templates to storage types...
gnt-cluster modify: dis/enabling storage types
This patch extends the 'gnt-cluster modify' command to manipulate the listof enabled storage types. Note that this currenlty does no validationwith respect to whether or not there are instances currently using a storage...
Trivial merge: no conflicts...
Fix migrate/failover -n for ext mirror storage
This fixes issue 396.
- Fix a wrong comment that mentions drbd8 when actually the code acts only on externally mirrored instances.- Fix a wrong assert that requires failover/migrate to acquire the NAL on externally mirrored instances: this is the case only when a...
Fix instance policy checks for default back-end parameters
Policy violations of back-end parameters that used the cluster defaultvalue were not reported in cluster-verify.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix restoring default instance specs in group policies
"default" was not accepted as a valid input value for instance specs ingroup policies, due to a bug introduced in 2cc673a3e (and released with2.6.0). Added QA for this and another similar case.
Fix policy check for disk templates
Instance disk template is checked against the policy, and disklessinstances aren't checked for the number of disks.
Fix merge 8e09e801 that resulted in duplicated code
A fragment in LUInstanceCreate.CheckPrereq() removed in commit ba147ff8 wasreintroduced in merge 8e09e801 due to a change in df28c49b.
Fix LUTestAllocator with instance alloc
This is similar to commit 8775e62a; the addition of node_whitelistbroke this LU as well.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Fix networks in _PrepareNicModifications()
Passing --net 0:add,ip=5.5.5.5 failed due to a referenceof a non initialized variable (new_net_obj). Reorder the checksand add some comments to be readable.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>...
Remove early returns in network LUs
Remove any early returns in LUNetworkDisconnect/LUNetworkConnectand replace them with if-else statements.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix locking in LUNetworkConnect()
Locks for group instances are aquired only if conflicts are checked.To this end we must _CheckNodeGroupInstances() only then otherwisethis check will always fail (owned_instances will be []).
Fix networks in LUInstanceSetParams()
Params passed in _CreateNewNic() are not yet evaluated and includethe value passed by user for the network. A lookup must be done firstin order to find the corresponding network UUID which should be storedin the newly created NIC object....
Wipe disks added through "gnt-instance modify"
In issue 353 Sascha Lucas reported that disks are not wiped when addedthrough “gnt-instance modify”. This patch adds this functionality andupdates the docstring for “_WipeDisks”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Locking fixes regarding Issue 324
LUNetworkConnect/LUNetworkDisconnect, in case locking is used, mightlock instances that exist in the requested node group. The acquiredlocks should be checked if they are correct at the beginning ofCheckPrereq() via _CheckNodeGroupInstances()....
Status change reason support for Reboot
Add support to the Reboot command for specifying the reason for the laststatus change.
Some features are implemented as functions, even if used only once, becausethey will be used by the future patches introducing reason support for all...
Implement network locking in Instance queries
This is needed in case more info than each nic's network uuid is tobe returned. We need to lock networks to get valid data. For nowonly the name is returned as an extra field. All other can be addedwith trivial effort....
Modify query LUs to supoprt nic.network as uuid
Make _InstanceQuery gather all network info related to instance'sNICs and in case of NETQ_INST in _NetworkQuery get all networkuuids directly from nic.network
cmdlib changes to support nic.network as uuid
Refactor Instance related LUs to support nic.network asa uuid. This removes all the unnecessary invocations toLookupNetwork().
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Helga Velroyen <helgav@google.com>
Force conflicts check in LUNetworkDisconnect
Until now if one disconnects a network with --no-conflicts-checkand then remove it, there is a possibility to leave instances with NICsreferencing non-existing networks. This causes network queries,instance removal and modification to fail....
If _UnlockedLookupNetwork() fails raise error
Make _UnlockedLookupNetwork() raise OpPrereqError (instead of returningNone) in case it does not find the requested network. Remove useless andduplicate code such as:
if net_uuid is None: raise...
This is a cherry-pick of commit 1cce2c4....
Improve reporting on errors.AddressPoolError exceptions
This patch improves the error messages given when a“errors.AddressPoolError” exception is caught. Includes some small stylefixes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Remove network_type slot (Issue 363)
This slot was not used by Ganeti so the same info can beprovided via tags. In order not to break configuration datawe add a FromDict() method in Network config object thatremoves the deprecated network_type (if found) and then invoke...
Remove family and size from network objects
This info is not used by Ganeti and therefore is removed.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Guido Trotter <ultrotter@google.com>
Make use of HooksDict() for networks
This can be used in hypervisor code as well. For consistencyexport *NETWORK_NAME and not *NETWORK throughout the code.
Moved uniformity check for exclusive_storage flag
Cluster-verify used to check that the value of exclusive_storage is uniformwithin node groups. Now, it's impossible to change the flag for a singlenode, so that check has been removed and an equivalent one has been added...
"exclusive_storage" cannot be changed on single nodes
There's never been support for a configuration where nodes in the same nodegroup have different values of the exclusive_storage flag. This patchdisables the possibility to change the flag for individual nodes....
OS environment: add network information
1) Move the hooks environment dict generator inside the object. Thisalso adds missing values such as network family and uuid.2) Use the same generator both for the os environment and for theinstance hooks.3) Update manpage and hooks documentation....
_VerifyErrors()._Error() and _ErrorIf() are now consistent
_Error() didn't contain the logic for demoting errors to warnings and formarking an operation as failed. Now _ErrorIf() is just a minimal wrapperfor _Error().
Unit tests included.
Fix type of 'node_whitelist' request parameter
If opportunistic_locking is used, then 'node_whitelist' parameter passedto the allocator is set to the LU's owned node locks. However, LU owned_lockshas type of 'set' while IReqInstanceAlloc expects type of...
Run pre-migrate hooks on primary node too
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>Reviewed-by: Guido Trotter <ultrotter@google.com>
Verify that templates are compatible with exclusive storage
cluster-verify reports instances with disk templates not compatible withexclusive storage but that are running on nodes with the exclusive storageflag set.
cluster-verify checks uniformity of PV sizes
When exclusive_storage is set, cluster-verify complains if the size of PVsis not uniform across a node group.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
add-node checks PVs
add-node now performs a few checks on LVM before adding a node to thecluster.
Moved checks within LUClusterVerifyGroup
Almost all instance-specific checks have been moved from the Exec method tothe _VerifyInstance method. This cleans up Exec, which was becoming too bigeven for pylint…
cluster-verify checks that PVs are not shared
When exclusive_storage is set, cluster-verify complains if PVs are sharedamong unrelated LVs.
cluster-verify checks uniformity of exclusive_storage flag
The value of the flag should be the same for nodes within the same group.
Add locking to _NetworkQuery
Make use of _GetNames() to get the final network UUIDs.Get networks info after having aquired the locks. Refactorthe code to use new local variables:
- "network_uuids" returned from _GetNames() - "all_networks" that are the latest network info...
Add "use_locking" parameter to network query opcode
This was extracted from a patch by Dimitris Aragiorgis with the subject“Add locking to _NetworkQuery”. The rest of the patch did no longerapply and will require more work.
Fix LUInstanceRecreateDisks with iallocator
Recent iallocator changes (commit fb60bc6a, “iallocator: Add nodewhitelist”) broke the parameter validation for LUInstanceRecreateDisks(the other LUs were manually fixed already):
$ gnt-instance recreate-disks -I hail --dry-run instance3...
Add the gnt-storage client
Add a new client called 'gnt-storage'.The client interacts with the ExtStorage interface, similarly tothe way gnt-os interacts with the OS interface.
For now, only two commands are supported: 'info' and 'diagnose'.
'diagnose' calculates the node status of each provider on each node,...
Merge branch 'devel-2.6'
Merge branch 'stable-2.6' into devel-2.6
No conflicts, really trivial.
LUs raise an error if they cannot handle exclusive_storage
This happens when the exclusive_storage flag is set, and the requestedoperation is incompatible with the flag or not yet supported.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Refactor checks for a new template in LUInstanceSetParams
All the checks have been moved to a private method, so as to makeCheckPrereq() smaller and more readable (pylint was complaining about it).
Call node_info RPCs with the exclusive_storage flag
The flag is read from the configuration and passed to the RPC.
Add exclusive_storage parameter to node_info RPC
The flag is passed to the low-level functions that need it, but it's notyet used. Also, RPCs get just a default value for now.
Improve assertion message in LUClusterVerifyGroup
In issue 240 this assertion fails. While reproducing was not possiblewith the master branch, having a more verbose message can't hurt.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Call blockdev_create RPCs with the exclusive_storage flag
Add exclusive_storage parameter to blockdev_create RPC
The flag is passed to the low-level functions that need it, but it's notyet used.
Added class to contain information about a PV
This makes the code more readable and easier to upgrade.bdev.LogicalVolume.GetPVInfo and the code that depends on it have beenrefactored to use the new class.
utils.CheckVolumeGroupSize() has been moved to lib/utils/lvm.py, where more...
Improve network query algorithm
Similar to commit 572a277. Directly iterate over “self.wanted” insteadof iterating through all networks and checking if they're wanted.
Change network error text
This error is thrown if a network name already exists, not if thenetwork itself (e.g. “1.2.3.0/24”) is defined.
Format network field "group_list" in client
The field is now a list of tuples containing the group name, mode andlink.
Adjust LUInstanceSetParams wrt the `ext' template
Initial support for the `ext' template in gnt-instance modify.Take care of all needed checks in CheckArguments and CheckPrereqswrt ExtStorage Providers and ext-params.
ExtStorage disk addition and specification of arbitrary ext-params...
Multiple ExtStorage Providers and ext-params
Add support for passing parameters to the ext template (ext-params).Take advantage of disk-params, that don't seem to make much sense inthis template (ExtStorage Providers are not predefined and we don'tknow their needs) and use them to pass the ext-params dynamically to...
Implement the External Storage Interface
With this commit we introduce the External Storage Interfaceto Ganeti, abbreviated: ExtStorage Interface.
The ExtStorage Interface provides Ganeti with the ability to interactwith externally connected shared storage pools, visible by all...