History | View | Annotate | Download (148.4 kB)
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.
Reviewed-by: iustinp
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.
Reviewed-by: imsnah
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
Reviewed-by: ultrotter
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.
Fix _UpdateEtcHosts to understand empty lines.
Change the signature of some methods of mcpu.Processor
This patch moves the passing of the feedback_fn argument from the(Exec|Chain)OpCode to the initialization of the Processor instance.
Implement replace-disks for drbd8 devices
This patch adds three modes of disk replacement for drbd8: - replace the disk on the primary node - replace the disk on the secondary node - replace the secondary node
It also adds some debugging code to backend.py and increments the...
Modify two mirror-device related rpc calls
The two calls mirror_addchild and mirror_removechild take only one childfor addition/removal. While this is enough for our md usage, for localdisk replacement in drbd8, we need to be able to specify both the data...
Initial implementation of drbd8 template type
This is a partially working drbd8 template type. It does: - add/remove - startup/failover/shutdown
Not working is replace disks, which needs custom code for this template.
Fix a disk handling bug triggered by failover
This leaves an instance's disks configured for the primary node as afterdisk activation we want to start the instance anyway. As such,_GatherBlockDevs in backend.py will need the disks configured for theprimary....
Abstract more strings values into constants
Currently, the disk types are defined using constants in the code.Convert those into constants so that we can easily find them and checktheir usage.
Note that we don't rename the values of the constants as they are used...
Patch series for reboot feature, part 2
This patch series implements the reboot command for gnt-instance. Itsupports three types of reboot: soft (hypervisor reboot), hard (instanceconfig rebuild and reboot) and full (full instance shutdown and startupagain)....
Make “gnt-cluster verify” exit 0 if there's no problem with instances.
Add the number of VCPUs in gnt-instance info
Allow force removal of instances
This patch adds a new option to the instance removal command"--ignore-failures" that forces the removal of the instance from theconfiguration even if the removal process encounters errors.
In order to be able to do this when the remote node(s) is(are) down, we...
Replace more ssh paths with proper constants
The node's ssh keys filenames are now provided as constants; this shouldallow easier customization.
Also, the user's ssh key computing has been abstracted into ssh.py
Some small improvements to the hooks environment
For the configuration update hook, it's useful to have a consistent namefor the target of the operation. As such, the LU code is modified toinclude an GANETI_OP_TARGET that points either to the cluster (name),...
Split the hooks env building in two parts
This patch moves some of the environment processing from _BuildEnv to anew _RunWrapper command which does the stringification and adds thesstore variables.
The reasoning is that the sstore can be fresher than before the...
Remove fping as a dependency for Ganeti.
This patch completely gets rid of fping - replace all fping invocations with TcpPing calls - update documentation accordingly. - associated cleanups (use constant for localhost IP, use more sensible defaults for TcpPing and use those)...
Remove the shebang from modules
Since modules are not directly executables, remove the shebang fromthem. This helps with lintian warnings.
Also make the autogenerated _autoconf.py contain two comment lines atthe beginning, like the other modules.
Add boot id to “gnt-node list”.
Change tags add/remove to process multiple tags
This patch changes the tags opcodes to work with multiple tags at onceinstead of only one. As such, the opcodes and some parameters arerenamed.
Fix tags operations for instances
Remove requirement that host names are FQDN
We currently require that hostnames are FQDN not short names(node1.example.com instead of node1). We can allow short names as longas: - we always resolve the names as returned by socket.gethostname() - we rely on having a working resolver...
Allow 'add instance' to not start the new instance
This patch allows 'gnt-instance add' to not start the newly-createdinstance. It also allow 'gnt-instance add' and 'gnt-backup import' tonot check for IP conflicts (only when not starting the instance)....