Add support for command aliases
Passing a new aliases dict to generic main we can easily support aliases forcompatibility reasons or simply useability.
Reviewed-by: iustinp
Fix VG listing broken by r510
LVM code sometimes adds an extra separator at the end of the field list.Make the code strip it if exists.
Reviewed-by: imsnah
Make backend._GetVGInfo check the validity of 'vgs'
Currently, the function backend._GetVGInfo only checks for errors viathe exit code of the 'vgs' command. However, there are other ways offailure so we need to also check for valid output before parsing....
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...
Change a hardcoded path into its proper constant
The function backend.UploadFile still uses "/etc/hosts" directly insteadof the existing constant; this patch fixes this.
Reviewed-by: ultrotter
Fix run directory for the fake hypervisor
Currently the fake hypervisor has hardcoded ‘/var/run’ as a basedirectory for its store. This patch adds a constant RUN_DIR that is usedfor both the fake hypervisor and for BDEV_CACHE_DIR.
Show the HVM boot order in instance info
This is a merge from the 1.2 branch
Two small style fixes
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.
Add boot_order entry to Instance object.
First step to support custom boot device order for HVM instances, add alocation to actually store that information for the instance.
Fix gnt-instance modify breakage introduced in r462
Reviewed-by: schreiberal
Change the Xen PVM to use the new kernel options
This patch changes the hypervisor to use the new kernel and initrdinstance attributes. They kernel is handled as expected (use the customor the default one), but the initrd is treated a little bit special, in...
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).
Add kernel/initrd paths to the instance object
This patch adds two new attributes to the instance object: - kernel_path - object_path
The code ignores them and the configuration handling is not broken bythis addition.
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...
Activate logical volumes at Assemble() time
This patch changes the Assemble() method for logical volumes from a noopto do a `lvchange -ay` on the logical volume; this ensures that if thelogical volume is not active, we are able to activate and use it....
Improve speed of activating block devs
This patch fixes the double attach operation in bdev.AttachOrAssemble,which was an indentation mistake in the first place.
Add unittest for DRBD8 drdbsetup show parser
This patch changes the bdev.DRBD8._GetDevInfo to take a string insteadof a minor, separates the `drbdsetup show` invocation into a newseparate method (bdev.DRBD8._GetShowData) and modifies the rest of theDRBD8 class to make the appropriate calls....
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.
Error handling for instance config file creation
Wrap error handling around creating the instance config file.
Use a generic Xen hypervisor interface.
Abstract the parts of the Xen hypervisor interface shared by both PVM andHVM into a generic interface, subclass the special case PVM from that.
Prepatch for adding HVM support.
Make utils.RunCmd() deal with interleaved stdout/stderr
Currently, RunCmd is written with the assumption that programs will havea small stderr output, therefore we read the child's stdout (which canbe big, so we don't want to block the child) and then the stderr (which...
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.
Handle ^C while trying to acquire the lock
When waiting for the lock and pressing ^C, the user will get a backtraceas the KeyboardInterrupt exception is not handled. The patch adds asimple method of handling it.
Note that this is not about ^C in any other place....
Add the ‘gnt-cluster verify-disks’ command
This patch adds the OpVerifyDisks handling in mcpu.py and theverify-disks command in the gnt-cluster script, which for every instancecomputed by LUVerifyDisks submits a new OpActivateInstanceDisks request.
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...
Add a new OpVerifyDisks opcode
This patch adds the definition of a new opcode that will be used tocompute the list of instances with not-online disks.
Return more data in rpc.call_volume_list
Currently, the volume_list call returns only the volume size. However,it is useful to also have two other things: the 'inactive' state of thevolume (which might trigger a ‘vgchange -a y’ on the volume group) and...
On OS creation errors, write logfile path to ganeti-noded's logfile.
Output reading fix for backend.NodeVolumes()
Use result.stdout instead of result.output to avoid potential confusionby merged in error messages from stderr.
Log instance startup errors correctly
Currently, the Hypervisor error raised on ‘xm create’ failure doesn'tcontain the actual output from the command, thus what we log to the nodedaemon log is not helpful enough. This patch fixes that.
Modify GetVolumeList so output on stderr from lvs doesn't break it.
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 parsing of drbdsetup show output
This fixes the parsing of integers in the drbdsetup show output withnewer pyparsing versions.
Basically, the convert-to-int action that we use was taken from theexample documentation of an older pyparsing version that automatically...
Replace hardcoded lock dir
This patch replaces the hardcoded ‘/var/lock/’ directory with one based onLOCALSTATEDIR.
Make utils.RunCmd log failures when using debug
This patch adds logging of command failures to the debug log in case theuser either started the command (gnt-*) or the node daemon with thedebug flag.
Fix logging of some checks in LUClusterVerify
Currently, the results of ConfigWriter.VerifyConfig() are lost. Makesure we log them too in cluster verify.
Drop the Rename method of DRBD8 devices
Since we now do changes of remote peers in two steps (Attach with nonetwork information and then Attach with the new peer's data), we don'tneed this operation anymore.
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...
Relax even more the identification of DRBD8 devices
This patch adds a new success condition for identifying DRBD8 devices:if the local device is correct, but the network peer is not, we shutdownthe network and attach to the correct one (this also handles going to...
Add support for DRBD8 devices to work standalone
This patch adds a check in _AssembleNet so that if we are passed Nonevalue in the unique_id, we instead switch to standalone mode.
Sort list returned by ListVisibleFiles.
If we didn't sort this list, files would be in arbitrary order.
Replace disk template drbd8 with drbd where missing.
Fix logging in drbd _ShutdownNet method
We didn't test for failure, just always logged the output.
Make sure aliases written to /etc/hosts are unique.
Add function to return list with unique elements.
Fix a typo in a warning message
Don't remove master's hostname from /etc/hosts on cluster destroy.
This fixes issue #13.
When an assembly error occurs log it too
Right now an assembly error produces an exception but not a log message. Thisis bad because the exception suggests looking at the log, but the log itselfhas a lot of errors which are not really a problem and only some which really...
Give more details on errors when trying to run “lvdisplay”.
Fix a wrong comparison in _RecursiveAssembleBD
We want to prevent sending too many 'None' children to a device.However, the test as it is today is wrong, as we want to test thesituation after adding a new child, and not before. This patch fixesthis by testing greater-or-equal instead of just greater....
Fix another breakage in SetEtcHostsEntry
The code assumes all lines have at least two elements which arewhitespace separated - i.e. it does not deal with empty lines or commentlines with no spaces. This patch fixes this.
Also, the patch replaces the blank between IP and the canonical name...
Call fsync() after modifying /etc/hosts.
This is a critical file. Breaking it would be very bad. Thus, if the systemcrashes before the data is synched to the disk, it should have the completefile afterwards.
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
Rollback commit 356.
Add functions for known_hosts files.
Reviewed-by: TODO
Add missing descriptions to {Add,Remove}EtcHostsEntry.
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....
Soften the requirements for hooks execution
Currently, an unreachable node (or one that return undetermined failure)in the hooks pre-phase will abort the curren operation. This is notgood, as a down node could prevent many operation on the cluster.
This patch changes a RPC-level failure (and not a hook execution...
Use new functions to modify /etc/hosts.
Add functions to modify /etc/hosts.
Cleanup temporary file in RemoveAuthorizedKey.
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.
Remove --secondary-node option.
Replace --secondary-node option with an optional parameter for --node.
Enhance DBRD8 disk replacement (same nodes)
This patch adds enhanced reporting and much more checks to the diskreplacement (when not switching the secondary).
Implement degraded status for logical volumes
Logical volumes can be 'degraded' in a similar way to mirrored devices,when their underlying storage has gone away (i.e. after a physical diskfailure and 'vgreduce --removemissing'). If we can detect this, we can...
Add better error logging functions for LUs
Currently, some LUs use logger.Error, others just feedback_fn, etc. Thispatch adds three functions to mcpu.Processor than can be used to logmessages to both the log and to the user.
These function will be used to enhance the output of replace-disks for...
Enhance mirror operations for DRBD8
Currently, the mirror operations (add and remove children) test againstthe instance's attributes. This patch changes the check tests to workagainst the actual status of the device (i.e. live data) which is morerealistic....
Allow DRBD8 operation without backing storage
This patch adds the following functionality: - DRBD8 devices can assemble without local storage (done by allowing None in the list of children, and making DRBD8 to ignore all children if any is None)...
Make DRBD8 disks show 'degraded' status if diskless
This patch enables the bdev.DRBD8 class report a degraded status if thelocal disk is missing. This allows `gnt-instance info` to report theactual situation in this case.
Note that DRBD7 should also behave like this, however the diskless case...
Change the way remove children is called in bdev
For some cases, we don't have to have access to the children of a devicein order to remove them (e.g. md over lvs, or drbd over lvs). In orderto ease the removal process, skip over finding the child if it provides...
Add a support function to objects.Disk
This patch adds a function returning the device path if it is computablefrom the disk object (and we don't need to instantiate a bdev object onthe target node in order to compute this). Only LVs support this.
Small cleanup for error formatting
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
Fix a unhandled error case in device creation
The block device creation process is the following: - device create - device assembly (on primary or depending on dev_type, on secondary too) - set sync speed - return
The problem is that device assembly after creation was not checked for...
Miscellaneous style fixes
This patch fixes some minor pylint warnings (unused variables, wrongindentation, etc.) and a real bug in the recovery for drbd8 renameprocedure.
Rename utils.GetUUID to utils.NewUUID.
Bump protocol version up
The OS cleanup patches change the wire protocol. Increment the protocol numberby one.
Reviewed-By: iustinp
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...
Simplify diagnose mangling/unmangling functions
The functions in ganeti-noded and rpc.py still deal with the fact that anInvalidOS error could be returned by DiagnoseOS. As this is not the caseanymore simplify their code for the current behavior.
Make DiagnoseOS use the modified OS objects
Modify backend.py so that DiagnoseOS only returns OS objects rather thanInvalidOS errors, and make sure gnt-os understands the new objects. Also deletethe deprecated helper functions from gnt-os.
Create OS from an InvalidOS error
Add a new FromInvalidOS static function to objects.OS that makes it easy tocreate an object representing a broken OS starting from the relevant exception.
Make the OS object able to represent broken OSes
Till now the OS object just represents a correct OS instance. Change it so itcan represent a broken one too, by adding a "status" field: if this field isdifferent from the OS_VALID_STATUS constant the object is considered to be an...
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.
Fix two typos in a doc string
Remove a wrong "i" and add a missing ")" to the DiagnoseOS function doc string.
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,...
Update the dev_path on LVs on rename
When renaming a logical volume, we should change the dev_path (and otherinternal variables) in order to be consistent.
Revision 302 is broken, this fixes it
I forgot a pair of parentheses in that revision which break the commoncase. This patch adds them.