History | View | Annotate | Download (176.5 kB)
Export the number of cpus to iallocator scripts
Now that we have the number of cpus available from the hypervisors, wecan export this to the iallocator scripts.
Reviewed-by: ultrotter
Add node cpu count to gnt-node list
This patch adds the backend and frontend changes needed for being ableto list the cpu count.
Add cluster-verify hooks
Only post-hooks are run on cluster verify, and then their output is sent backto the LU, which upon failure displays it to the user and changes the result ofthe execution to a failure.
Reviewed-by: iustinp
Add a LU Hooks notification function
Previously LUs could be failed by pre-hooks, and post-hooks just had effects bythemselves. This patch allows a LU to define the HooksCallBack function if itwants to know about its hooks' results and alter its results in response....
Remove NoHooksLU.BuildHooksEnv
Since NoHooksLU defines HPATH as None, BuildHooksEnv will never be called (asthe LogicalUnit.BuildHooksEnv docstring correctly states). Removing thefunction altogether, to avoid having dead code lying around, and to make sure...
LogicalUnit.BuildHooksEnv, update docstring
The LogicalUnit.BuildHooksEnv docstring used to say that the node list shouldnot include the master node. This is obviously not the case checking therelevant code, and double-checking with iustin he confirmed it just document...
Raise PrereqError when exporting file-based instance
This patch adds a check to LUExportInstance.CheckPrereq to raise anerror when an instance with file disks is exported.
Convert cli.SubmitOpCode to use the master
This patch converts the cli.py SubmitOpCode method to use the unixprotocol and thus execute the opcodes via the master.
The patch allows a partial burnin to work with the master. Currently thequery opcodes, since they are executed via the SubmitOpCode, are...
Move iallocator script execution to ganeti-noded
Currently the iallocator execution takes place in the master, which is aviolation of the current architecture, and will create problems with athreaded master daemon.
This patch moves the execution to the backend, similar to the hooks...
Fix iallocator instance info
The commit "IAllocator: some more info exported" broke the instance listgeneration due to a wrong index variable. This patch fixes that.
IAllocator: some more info exported
This patch adds the following information to the exported info: - hypervisor type (in the main dict) - total memory used by primary instances (in each node dict) (can be computed from the node+instance dicts, but it's cheap to compute...
IAllocator: simplify node info computation
Currently we try to convert the values returned by call_node_info toints, and if all succeed, we actually do the conversion. Simplify thisby doing it in one step.
The patch also adds exporting of node memory as 'reserved_memory'....
Style fixes for trunk
This small patch fixes: - wrong indentation in two places - use of 'os' variable that hides global scope os module
Reviewed-by: imsnah
Implement replace secondary via the iallocator
This patch implements secondary replace via the iallocator. The newopcode parameter 'iallocator' behaves like this: if passed, it willalways compute and assign a new secondary, behaving in effect as if the...
Fix generalized relocate mode of IAllocator
The patch which generalized the IAllocator was half-true: it actuallyput the selection of the node inside the IAllocator, so callers were notable to specify replace primary node.
This patch does: - split the arguments to the constructor in three sets: mode and name...
Add gnt-backup remove functionality
This patch also fixes the LUExportInstance Prereq docstring.
Generalize the replace_secondary mode in iallocator
Currently the replace_secondary mode is too restrictive. This patchchanges this to a general 'relocate' mode where the node(s) to bechanged are specified via a new key in the request dict ('nodes') so...
Send required_nodes field to the iallocator scripts
This patch adds the 'required_nodes' field in the request dict for theiallocator.
This means that the handmade-checks in the create instance can besimplified, and that the dumb allocator can be made simple. Therefore...
Move all iallocator functions into a class
This patch moves all the iallocator function into a separate class thatis then somewhat easier to use. It doesn't bring any new functionality.
The patch also changes the way the iallocator is called - theOpTestAllocator opcode is no longer needed, and all its parameters...
Abstract the json functions into a separate module
This simple patch adds a new module that holds the simplejson functionsfor serialization/deserialization. This reduces the amount of redundantcode.
The patch also adds some normalizations to the json output:...
Add --readd option to “gnt-node add”
This allows us to readd a node after it failed and required areinstallation or replacement.
IAllocator part 3: LUCreateInstance changes
This (final) patch allows the instance's nodes to be selectedautomatically based on the passed allocator algorithm.
The patch changes the pnode opcode parameter from required to optional,now either the pnode or the iallocator must be passed....
Reorder checks in instance create
This patch reorders the checks in the instance create prereq so that allchecks and normalisations that are not node-dependent are done beforethe node dependent checks.
This is done so that, after the instance-related opcode parameters are...
Implement 'out' direction on allocator tests
This patch adds the paths for searching for instance allocators andmakes the LUTestAllocator code run the allocator and return the resultsif the direction specified is 'out'. 'out' means that the opcode will...
Allocator framework, 1st part: allocator input generation
In preparation for the introduction of automatic instance allocator,this patch adds an allocator simulation opcode, that based on the inputparameters, will return either the input message to the allocator...
Fix two pylint uninitialized variable errors
Bugfix: wrong identifier in CheckPrereq message
Move the disk size computation to its own function
This is currently hard-coded for the two drive case and will need to bereworked for multi-disk support.
The patch is needed to support passing the total required size to theiallocator interface.
Verify: make skipping checks possible
Add a general way to skip some checks at cluster-verify time and make the N+1memory redundancy check optional.
Verify: add N+1 Memory redundancy verification
For every node we check that we can host all the instances it's currentlysecondary for belonging to the same primary. This ensures that if a node failsall its instances can fit on their secondary node. The code only works when...
Verify: save instance config
Save the instance config after we queried it in an instance_cfg dict. This canbe used later by any function that wants it, without reloading it from theconfiguration module. It will be used for N+1 memory resilience checking....
Verify: add more instance information to node_info
The sisnt-by-pnode field contains all secondary instances of a node, grouped bytheir primary node. This information allows us to see quickly if when a nodedies some of its instances cannot be started on their secondary node....
Verify: add instance information to node_info
With this patch node_info is changed to store information about which primaryand secondary instances are configured on a node. This information is useful tocheck memory and disk allocation. A list of non-redundant instances is also...
Verify: Add and populate node_info dict
During information gathering we collect information from call_node_info, andthen when we cycle trough the nodes add it into a node_info dict containing anode's free memory and disk. This will be useful later to verify that the...
Rework the results of OpDiagnoseOS opcode
Currently, the opcode DiagnoseOS is the only opcode that return astructure of objects.OS (which is a custom class, and not a simplepython object) and furthermore all the processing of OS validity acrossnodes is left to the clients of this opcode....
Verify: remove useless check in _VerifyInstance
The list of instances passed to _VerifyInstance is the one coming fromself.cfg.GetInstanceList(). So there's no point, inside that function, inchecking whether the current instance is a member of that list. Moreover...
Verify: instance verification cleanup
The instance configuration is grabbed both in the _VerifyInstance function andin the loop that calls it. Clean this up by passing the configuration as aparameter.
Verify: fix crash when a node is down
Currently if ganeti-noded doesn't respond on a node gnt-cluster verify will diewhen verifying primary instances for that node. Fix this by just emitting anerror message if no information about running instances is returned from the...
Verify: fix ERROR message indentation
All ERROR messages in cluster verify are indented by four spaces, this one isindented by two. Fixing this skew.
Reviewed-by: imsnah, iustinp
Small code style fix
Bugfix instance create when file-storage-dir None
os.path.join does not like None as argument and fails withAttributeError: 'NoneType' object has no attribute 'startswith'.
This patch makes sure the passed argument is a string in any case.
Two small code style fixes
Modify LURenameInstance to support file backend
This patch does two things:- Modify LURenameInstance.Exec to rename directory when a file-based instance is renamed- Modify config.RenameInstance() to replace the directory name in config.data for file devices...
Modify LUCreateInstance to support file backend
- Modfiy _GenerateDiskTemplate to support file-based disk template- Modify _CreateDisks to create directory needed for file-based instances before creating the actual files- Modify _RemoveDisks to delete directory for file-based instances...
Improve disk consistency error message again
This new version includes all the possible failure options.
Fix misleading error message when checking disks
_CheckDiskConsistency outputs "Can't get any data from node NODE" when no drbdis found on the target node. This causes a misleading error message to beoutput for example on failover (when the primary node is down, or the instance...
Handle better failing over non-running instances
Right now if you try to failover an instance which is not marked as up theoperation will fail unless you pass the --ignore-consistency flag because thedisks won't be considered to be consistent. Allow them to be if we know the...
Improve export and fix export-on-norun bug
Currently gnt-backup export chains the ShutdownInstance and StartupInstanceopcodes to itself. This works but (a) it's suboptimal, because there's no needto deactivate the instance's disks as we are about to restart it anyway, and...
failover: only start instance if we should
gnt-instance failover on an instance marked as down will mistakenly bring itup. The watcher will then shut it down again, but it's a lot better (and safer)not to start it at all.
Change the 'gnt-cluster command' execution order
This patch makes the command execute last on the master (if the masteris selected). The order for the other nodes is unchanged.
The patch also updates the man page with some explanations and anexample....
parms->params Refactoring
- Substitute all occurences of name 'parms' with 'params'- Small codestyle fix
Skip HasValidVG when --no-lvm-storage on cluster init
This patch does two things:- Remove "vg_name" from _OP_REQP due to the introduction of --no-lvm-storage. Since vg_name option has as default now None and is only set to the DEFAULT_VG if lvm_storage is enabled, this is needed...
Add LUSetClusterParams to cmdlib
Add LUSetClusterParams, which is the LU to modify cluster options.This includes checks:- not to disable lvm storage when it's already disabled- not to enable lvm storage when it is already enabled- not to disable lvm when lvm-based instances are present...
Add lvm-storage check when creating instances
This adds a check to fail instance creation if lvm-storage is disabled(cluster-wide). If lvm-storage is disabled (by initializing the clusterwith --no-lvm-storage) only instances with disk template in frozenset...
Change the order of config updates in some LUs
In the start and stop instance LUs, the configuration update is doneright at the end. This means that if, for example, the instance shutdownsucceeds, but the drive deactivation fails, the next run of the watcher...
Return first parameter of console command only once
Remove the option to create md/drbd7 instances
This patch removes the options that allow to create local_raid1 orremote_raid1 instances. It also modifies the documentation and removesthese disk templates from burnin and from qa.
Remove the add/remove mirror operations
These two operations are related to md/drbd7 code (remote_raid1). Removethem as part of the md/drbd7 removal.
Modify cluster-init to create file-storage-dir
This patch adds three things:- it normalizes the file storage directory path passed to gnt-cluster init- if the file-storage-path doesn't exist on the master node, ganeti tries to create it- adds additional check if the passed file-storage-dir is not a directory...
Add support for file_storage_dir to LUInitCluster
Author: manuel.franceschiniReviewed-by: iustinp
Use new ssh.WriteKnownHostsFile function
This replaces very old code.
Use new cluster alias in known_hosts file
Use new “tty” parameter on SshRunner.BuildCmd for “gnt-instance console”
Move SSH functions into a class
This renames some functions and does some minor codestyle cleanup.
Disable cluster init with a reachable IP
Make the cluster init fail if the IP to which the cluster name resolvedis already reachable by the master node. This is not a foolproofsolution, but it allows a cheap method of detecting simple mistakes.
It will also disallow using the master node name as cluster name (which...
Modify utils.TcpPing to make source address optional
This patch modifies TcpPing and its callers to make the source addressselection optional. Usually, the kernel will know better whatsource address to use, just in some cases we want to enforce a given...
Codestyle fixes: adding a few empty lines
Fix master role stop on cluster destroy
Currently the cluster destroy doesn't remove the master role, whichmeans that the IP address of the cluster remains assigned to the masternode.
This patch fixes this and also a docstring in backend.StopMaster()....
Fix cluster rename operation
This one-liner fixes the cluster rename operation. As a side note, weshould have a QA test for this too.
Don't allow renaming to an existing instance
Even if the target instance is down or we are not checking for IP conflictschanging an instance name to a new one which is already in the cluster isdoomed to fail, because in a lot of places (among which figures the mind of...
Use constants.ETC_HOSTS instead of string for /etc/hosts
This patch replaces some hardcoded strings with their corresponding constant in `_GenerateDiskTemplate()`.
Fixes small spell mistakes and comments
Fix gnt-instance info i1 i2 ...
Due to an indentation error only the last instance queried got returned byLUQueryInstanceData. Moving the append() call inside the for cycle to fix thisissue.
This is a one-liner targeted at 1.2.3
Further fixes for the 'export MAC in hooks' change
QA suite which tests gnt-instance modify has uncovered another issue related tomac export.
Modify the default output of gnt-instance list
This patch adds a new field available for selection in gnt-instance listnames "status" which represents the combined value of "admin_state" and"oper_state". Since this is much easier to parse (e.g. gnt-instance list...
Add a test opcode that sleeps for a given duration
This can be used for testing purposes.
Reviewed-by: ultrotter,imsnah
Reduce the chance of DRBD errors with stale primaries
This patch is a first step in reducing the chance of causing DRBDactivation failures when the primary node has not-perfect data.
This issue is more seen with DRBD8, which has an 'outdate' state (inwhich it can get more often). But it can (and before this patch, usually...
Fix some indendation issues
Fix incomplete mac address export to hooks
This patch completes the change introduced in r566 (trunk) and r568(branch-1.2).
Give mac information to instance hooks
Currently just the bridge and ip address are passed. Add an environmentvariable for the mac address.
Add option for the number of VCPUs in instance listing
Fix "gnt-instance modify --initrd"
The new QA tests for instance modify uncovered a bug in the modifyinitrd operation when setting the initrd to none.
Fix checking of node free disk in CreateInstance
This patch does two things: - checks that the result values from call_node_info are valid integer values and aborts otherwise - skips disk space computation for the DT_DISKLESS case
The most important point of the patch is the verification of results...
Abstract node memory checking into a separate function
The checking of a node's free memory (via rpc.call_node_info) is done inboth start instance an failover. This patch abstracts this call,together with the appropriate error handling, into a separate function...
Show the HVM boot order in instance info
This is a merge from the 1.2 branch
Fix some misspellings
This patch fixes two name typos and a style issue (which makes pylintcomplain).
Fix CreateInstance new optional parameters
Some new paramenters of the CreateInstance opcode are optional (namelykernel_path, initrd_path and hvm_boot_order) but their absence makes the codecrash. Fix this by initializing them to a default value if they're not present....
Support selecting the boot device order for HVM.
This patch adds support for specifying and changing the boot device order forHVM instances. The boot device order specification is ignored for non HVMinstances.
Fix gnt-instance modify breakage introduced in r462
Reviewed-by: schreiberal
Make ‘gnt-instance info’ show kernel/initrd paths
This patch changes the info subcommand to nicely show the kernel andinitrd paths.
Allow defining the kernel/initrd at creation time
This patch adds support for defining the kernel/initrd at instancecreation time, using the same interface as in instance modify.
Add support for modifying the kernel/initrd path
This patch adds support in ‘gnt-instance modify’ to set the kernel andinitrd paths. The user can pass either 'default' or 'none' (none is notvalid for kernel).
Improve verify-disks: broken/missing LV detection
This patch improves the ‘gnt-cluster verify-disks’ command by addingsupport for detecting broken volume groups and missing logical volumenames.
As such, we don't try anymore to activate disks for instances that are...
Allow instance MAC address to be set.
Allow the MAC address of an instance to be specified optionally duringinstance creation and later to be changed via instance modify.
Proof-of-Concept HVM support for Ganeti.
This patch implements a first proof-of-concept for HVM support in Ganeti.Due to the nature of this patch, it is intended for test environmentsonly.
Internal API change for instance console access.
Change the internal hypervisor API for GetShellCommandForConsole, wenow call it with the instance instead of just the instance name.
This is a prep patch for HVM, since HVM needs more than just the instance...
cleanup for hypervisor constants
Move constant definitions for hypervisor into constants.py
Specify hint as a named argument
hint is declared as a named argument for the LogWarning function. Make itscaller pass it naming it.
Add instance port support.
Extends the instance object by adding a port item, also adds changesto print this port via gnt-instance info.