History | View | Annotate | Download (163.6 kB)
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
Reviewed-by: iustinp
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.
Reviewed-by: ultrotter
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.
Reviewed-by: imsnah
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.
Add LUVerifyDisks
This patch adds a new LUVerifyDisks that implements the OpVerifyDisks.The algorithm is that by determining not-used logical volumes forinstances that are supposed to be running, we presume from there thatthe DRBD devices are not online and therefore one should...
Various code style fixes for strings.
- When line wrapping is needed, move spaces to the next line.- Remove embedded line breaks from error messages.
Fix logging of some checks in LUClusterVerify
Currently, the results of ConfigWriter.VerifyConfig() are lost. Makesure we log them too in cluster verify.
Split the change of peer in secondary replace in two operations
This patch splits the single operation of replace peer into two distinctphases, in order to make a single change to the instance configuration: - detach from network - if at least one drbd device succeeded, make one change to the...
Replace disk template drbd8 with drbd where missing.
Fix a typo in a warning message
Don't remove master's hostname from /etc/hosts on cluster destroy.
This fixes issue #13.
Fix functions for /etc/hosts.
- Combine hostname and aliases on one line- Fix bug with wrongfully removed newline characters- Use wrapper for SetEtcHostsEntry in cmdlib
Reviewed-by: iustin
Relax replace_disks_all meaning for drbd8
In order to make the replace secondary action to be done via the sameopcode parameters for both remote_raid1 and drbd, we must allow theLUReplaceDisks to change replace_disks_all for drbd with non-emptyremote_node into replace_disks_sec....
Use new functions to modify /etc/hosts.
Changes related to logging
This patch modifes: - mcpu.Processor.LogWarning to have its 'hint' parameter as optional and only log it if not None - cmdlib._WaitForSync to not log directly to stdout/stderr but via the proc.Log(Info|Warning) methods...
Enhance secondary node replace for drbd8
This (big) patch does two things: - add "local disk status" to the block device checks (BlockDevice.GetSyncStatus and the rpc calls that call this function, and therefore cmdlib._CheckDiskConsistency) - improve the drbd8 secondary replace operation using the above...
Check whether init.d script is executable.
Enhance DBRD8 disk replacement (same nodes)
This patch adds enhanced reporting and much more checks to the diskreplacement (when not switching the secondary).
Handle missing init script at cluster init
This patch adds a check in the prereq of LUInitCluster for the existenceof the init script. This allows a clean abort instead of a stack dump.
Based on a report by admin@steibei.net
Miscellaneous style fixes
This patch fixes some minor pylint warnings (unused variables, wrongindentation, etc.) and a real bug in the recovery for drbd8 renameprocedure.
Convert os_get to use OS rather than InvalidOS
In order to do this for simplicity we leave the OSFromDisk function as-is andwe convert the eventual exception to an OS object in ganeti-noded. Theunmangling gets simplified and so does the code for checking whether the OS is...
Make call_os_get a single node function
call_os_get is never called with a real list of nodes, so there's no point init being multi-node. Making it single-node till a usage for multi-node call isfound.
Reviewed-By: iustinp
Implement tag searching
This patch adds a search command for locating tags on all objects of thecluster using a regex pattern.
Reviewed-by: aat
Implement device to instance mapping cache
Currently, troubleshooting DRBD problems involves a manual process of goingbackwards from the DRBD device to the instance that owns it.
This patch adds a weak (i.e. not guaranteed to be correct or up-to-date)cache of device to instance. The cache should be, in normal operation,...
More sane handling of errors during failover
Currently we ignore errors on instance shutdown (on the source node)during instance failover. We should do this only if the user gave acommand line options allowing this, as it's a dangerous thing to do.
This patch fixes this by using the same "--ignore-consistency" option...
Fix bridge checking in instance failover
The current code checks the bridge on the primary node of the instance,but we need to check it on the destination node.
This was caught by testing failover with a down primary node.