History | View | Annotate | Download (143.2 kB)
Check validity of the access protocol parameter
Use secondary IP when moving instances
All data traffic usually goes over the secondary network, butgnt-instance move didn't. This patch corrects this problem by using thetarget nodes secondary IP as move target.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Honor disks_active of instance when adding disks
Adding a disk to an instance used to leave the disk behind activated, nomatter how the disks_active flag of the instance was. This changes makesure that new disks are only active if the other disks of the instance...
Wait for disk sync when adding a disk
When creating an instance, gnt-instance waits for instance disks tosync. Inconsistently, this was not the case for adding a disk to aninstance. This patch changes the default behavior to wait for sync whenadding a disk, but honor the --no-wait-for-sync option which...
Remove physical_id field from disk object
The 'physical_id' field of disk objects is no longer used, so remove it.Also, all references are removed together with the code which made surethat the physical_id is up to date when transmitted over RPC.
Replace physical_id with dynamic_params
The disk field 'physical_id' has to be kept up to date whenever a diskobject is sent to a node via RPC. This is done with the SetDiskID methodmanually, which is a source of bugs.
This patch replaces the use of 'physical_id' with a new field names...
Merge branch 'stable-2.9' into master
Fix incorrect conflict resolution in lib/cmdlib/instance.py
Between the last two merges, nothing happened on stable-2.9. Theonly change on stable-2.8 that touched lib/cmdlib/instance.py isff34fb97. So make sure, the net change since the last merge tothis file is that of the said commit. This also fixes the doclint...
Merge branch 'stable-2.8' into stable-2.9
Add a default to file-driver when unspecified over RAPI
The file-driver value, used by file-based instances, had a default value whenan instance was being created over the CLI, but not when the instance wascreated through the RAPI.
This patch introduces a default value for the remote API and, while doing so,...
Use RpcResult.Warn where appropriate
Those two occurrences of warnings can be replaced the RpcResult.Warnmethod, which is done in this patch.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Remove unneeded except block
The validation of the opcodes already checks the size parameter for theright type, so this except block is not required.
Replace LD_* constants with DT_* constants
LD_* constants are basically like DT_* constants, exceptfor that both file and shared file were mapped to file.In order to not having to maintain three slightly differentsets of disk-related constants (DT, LD and ST), we merge...
Check right disk template in inst set params
While checking the parameters of the opcode for LUInstanceSetParams, thealready set disk_template was checked instead of the new one in theopcode. This patch fixes this bug.
Add unit tests for LUInstanceCreate and move tests
- Move instance related tests to instance_unittest.py- Adapt moved tests to the new test framework where appropriate- Add unit test coverage for LUInstanceCreate - Only instance creation is covered yet, no imports...
Allow instance mods if only osparams are given
osparams are now recognized as changes, so changing only those withoutother changes works too now.
(cherry picked from commit 5eae613c2e1e65101c5d5f7d2e8ffd7cc6edc7d5)
Use node UUIDs for locking instead of node names
LUInstanceMultiAlloc used node names instead of node UUIDs to lockrequired nodes. This patch fixes this bug.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Fix a node name vs. UUID bug in instance import
This patch fixes a bug where node names were incorrectly used as nodeUUID's.
Use node UUID for locking in LUInstanceMove
This LU (incorrectly) used the node name for locking. This patchcorrects this error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Merge branch 'stable-2.9'
Merge branch 'stable-2.7' into stable-2.8
Move constants to the appropriate module
Move constants ALLOCATABLE_KEY and FAILED_KEY to the constants module.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add predicates to test Python types in opcodes
Add helper functions to test Python types, which are used by opcodeparameters and return values.
Fix KeyErrors with network mode and vlan
This patch fixes some KeyErrors that were introduced by the vlan implementationand showed up when certain parameters were missing:gnt-cluster init without network modegnt-isntance add without vlan
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>...
Support VLAN parameter during instance creation
If VLAN parameter is present, check its format:either .<id>[:id], :id[:id...], or just id.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Opcodes: move storage type checks to cmdlib
So far, there was a static check whether or not a givenstorage type of an opcode was enabled. This check isno longer possibe at this layer, because the informationwhether or not file/shared file storage is enabled must...
cmdlib: remove usage of ENABLE_FILE_STORAGE
This patch removes all usages of the constant'ENABLE_FILE_STORAGE' from the cmdlib code andreplaces them by checking the cluster's configuration.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
backend: remove ENABLE_FILE_STORAGE
This patch removes the usage of the ENABLE_FILE_STORAGEconstant in the backend code. To avoid having to passit through various RPC calls, we instead move the checkto cmdlib.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Let instance creation fall back to default disk template
So far, the '-t' option of 'gnt-instance add' is mandatory.This patch makes it optional. In case, no disk template isspecified, the first of the list of enabled_disk_templatesis used.
LUInstanceCreate: factor out disk checks
The 'CheckArguments' method of 'LUInstanceCreate' is waytoo long and should be broken up in smaller pieces. Thispatch starts with that and factors out the disk checks.No functional changes whatsoever.
Extend RPC call 'node_info' by storage parameters
This patch extends the actual RPC call to accept storageparameters with each storage units. It adjusts all codewhich performs this code by integrating the 'exclusivestorage' flag into the lvm storage unit....
Index instances by their UUID
No longer index instances by their name but by their UUID in the clusterconfig. This change changes large parts of the code, as the followingadjustments were necessary: * Change the index key to UUID in the configuration and the...
Fix instance add for missing node specs
Don't pass None to cfg.GetNodeNames. Instead, only resolve the nodenames if it's sure that the UUID list is valid.
This fixes issue 495.
Merge branch 'stable-2.8' into 'master'
Use cluster's hvparams in LUInstSetParams
Since the instance does not have hvparams at that point,we have to use the cluster's hvparams here. This fixesa crash when using 'gnt-instance modify'.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Inline simple "alias" variables
Remove variables in the form "var = self.var" throughout all LU's. Those"alias" variables make it harder to read the code (it's no longerimmediately clear what's a field and what's a local variable), and canintroduce subtle bug (especially when not used consistently and when...
Index nodes by their UUID
No longer index nodes by their name but by their UUID in the clusterconfig. This change changes large parts of the code, as the followingadjustments were necessary: * Change the index key to UUID in the configuration and the ConfigWriter, including all methods....
Use hvparams in GetInstanceInfo
This patch extends the GetInstanceInfo function of thehypervisors by an hvparams parameters. This leads toan extension of the instance_info RPC call and theadjustmend of all classes using this call.
Adjust all callers of RPC 'call_node_info'
This patch contains all adjustments necessary to code thatuses the 'call_node_info' call. The adjustment is necessarybecause the call's signature changed from receiving a listof hypervisor names to a list of tuples...
Use RpcResult.Warn where appropriate the cmdlib
To avoid repetitive code, make use of the functionality factoredout to the Warn method of RpcResult.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Export device UUIDs to hooks and OS scripts
Export UUIDs and names of instance NICs and disks to the environmentof OS scripts and instance related hooks.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Merge branch 'stable-2.8' into master
Add disks_active to configuration
This flag tracks if the disks of an instace are supposed to be active.That's the case when an instance is running or when its disks gotactivated explicitly (and in a couple of other cases).It will be used by watcher to re-activate disks after a node reboot....
Spindles are mandatory with exclusive storage
If they are not specified in the command line an error is reported. Also,disk creation would fail without them.
QA has been updated.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Check that spindles are not given when they are not allowed
Masterd checks that specifications for new disks don't include spindleswhen exclusive storage is disabled.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
RPC 'node_info': <storage_type,key> instead of vg_names
This replaces the field 'vg_names' in the RPC call of 'node info' by'storage_units'. A storage unit is a tuple <storage_type,key>and a generalization of a vg_name. The list of vg names is replaced by...
cmdlib: Cleanup public/private functions
All functions/classes which are used outside of their defining module(with tests as an exception) no longer have a leading underscore.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
cmdlib: Extract instance query related functionality
Split instance.py further by extracting instance querying relatedlogical units and functions to instance_query.py.
cmdlib: Extract instance operation functionality
Split instance.py further by extracting instance operations(start/stop/reboot/etc.) related logical units and functions toinstance_operation.py.
The extracted operations have in common that they affect the operating...
cmdlib: Extract migration related functionality
Split instance.py further by extracting migration related logical unitsand functions to instance_migration.py.
cmdlib: Extract storage related functionality
Split instance.py further by extracting storage related logical unitsand functions to instance_storage.py.
Extract instance related logical units from cmdlib
All LUInstance* classes are extracted to instance.py. Common functionsare moved to common.py if used by non-instance logical units as well.Additionally, helper functions which are only used by LUBackup* and...