Merge branch 'stable-2.8' into master
Merge branch 'stable-2.7' into stable-2.8
Conflicts: doc/iallocator.rst...
kvm: Use -uuid to set system UUID
Use kvm '-uuid' option to set guest's system UUID to instance's UUID.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Ensure the queue socket has the right permissions
RAPI needs to be able to perform queries as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Export connected networks to IAllocator
IAllocators should not put instances on nodes in nodegroups which arenot connected to the network the instance should be connected to.Therefore, export the networks a node group is connected to to theIAllocator, so it can account for this restriction....
Add generic daemon options support binding to interfaces
In some situations, it is desirable to bind one of our servers only toa particular interface, like eth0, instead of an IP address. Therefore,add an option -i to specify an interface; its address will then be bound...
Re-activate previously active disks in watcher
The watcher process previously (incorrectly) examined the admin_statefield to figure out if the disks of an instance should be activatedafter a node reboot. This is changed to use the disks_active field of...
Make the disks_active flag queryable
gnt-instance list now also supports the disks_active field.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Consider disks_active in UpgradeConfig
The disks_active flag is updated when masterd reads the configuration.Also, cfgupgrade now removes the disks_active flag during downgrades.
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....
Report missing spindles in the configuration
cfgupgrade and cluster-verify run a check for missing spindles in diskconfiguration when exclusive storage is enabled. The check in cfgupgrademay give false positives due to the complexity of getting the correct value...
Adapt striping to the requested number of spindles
Otherwise LVM may use a smaller number of PVs (spindles) to accommodate forthe default stripes.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
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.
gnt-cluster repair-disk-sizes repairs spindles too
When exclusive storage is active, any wrong or missing spindles informationin disks gets updated too.
New RPC to get size and spindles of disks
This RPC replaces the existing one that only returned disk size.
New BlockDev methods to get spindles
Two new methods are created to get the number of spindles, one alone, andone together with size. For devices that don't support spindles, None isreturned.
Attaching a logical volume builds a list of PVs
When an LV gets attached, the list of the PVs used by the LV is built. Thiswill be used to count spindles for exclusive_storage, but it could also beuseful to optimize disk growing and snapshotting.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Refactor code for attaching a logical volume
The parsing of "lvs" output is moved into private methods. The code isslightly more readable and testable. The split in two methods is usefulfor the following patches. Unit tests for the new functions areprovided....
Merge branch 'stable-2.8'
gnt-instance info prints information about spindles
For each disk, the number of requested spindles (if present) is shown.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Spindles are used in creating new disks
The requested number of spindles is used to allocate PVs when creating newLVs.
Document disk device Create() functions
Document all the arguments and return values of bdev.Create() andbdev.BlockDev.Create().
Add spindles field to disk object
The field is filled with the value provided on the command line.
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.
Add "spindles" option to instance disk creation commands
The option is parsed but ignored, for the moment.
Workaround missing SO_PEERCRED
This bug happens in a few new distributions, so we workaround it bydefining the constant ourselves, if it's missing.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Add debugging clause to _ExpandCheckDisks error
This has been reported by users, so we should have the extra debuggingavailable.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michele Tartara <mtartara@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...
Stash Xen config file after a failed startup
This is a fix for a minor bug.Currently, a failed Xen VM start results in a stale config file leftbehind on the filesystem.This change introduces a new log directory, where the Xen VM configfile is moved after a failed startup....
Fix owner of the OS log dir
The OS log dir is used by noded, not masterd.
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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.
Reformat and define exports in cmdlib/__init__.py
cmdlib/__init__.py now simply defines the interface of the cmdlib moduleby importing all classes which should be visible to clients.
Also don't ignore C0302 (Too many lines in module) any more.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Extract miscellaneous logical units from cmdlib
All remaining classes in init.py are extracted to misc.py.
Extract os related logical units from cmdlib
All LUOs* classes are extracted to operating_system.py.
Extract query related logical units from cmdlib
All LUQuery* classes are extracted to query.py.
Extract backup related logical units from cmdlib
All LUBackup* classes are extracted to backup.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...
Extract node related logical units from cmdlib
All LUNode* classes are extracted to node.py. Common functions are movedto common.py if used by non-node logical units as well.
Extract group related logial units from cmdlib
All LUGroup* classes are moved to group.py. Common functions areextracted to common.py.
Extract cluster related logical units from cmdlib
All LUCluster* classes are extracted to cluster.py. Shared functions areextracted to common.py, helper functions only used by LUCluster* areextracted to cluster.py.
Extract test logical units from cmdlib
LUTest* are moved to test.py.
Extract network related logical units from cmdlib
LUNetwork* and associated helper functions are extracted to network.py.
Extract tags related logical units from cmdlib
LUTags* and their base class, TagsLU, are extracted to tags.py. Anadditional shared function, _ShareAll, is extracted to common.py forshared usage.
Extract base classes from cmdlib
Base classes holding common functionality is extracted into base.py.Utility functions used by both base classes and subclasses is moved tocommon.py.
Use os.statvfs to determine free disk space
This simplifies my previous commit (820bade90) by using os.statvfsinstead of parsing the output of 'df'.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Backend function for file storage space reporting
This adds functionality to retrieve disk space informationfor file storage. It calls the 'df' tool and parses itsoutput to extract the total and free amount of disk spaceon the disk where the given path is located....
Remove extra newline
Also, properly set the date of the last modification.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add MonD to the watcher
The monitoring daemon should always be alive, therefore it's added to thewatcher.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Start the monitoring and node daemons together
Add the monitoring daemon to the command starting the node daemon, given thatthey both have to be started on all nodes.
Note that daemon-util only supports starting one daemon at the time, so theactual command has to be composed as a sequence of two different daemon-util...
Add a constant stating whether monitoring is enabled
Clean up when "gnt-instance modify" fails to create a disk
cmdlib.LUInstanceSetParams now uses helper functions to create and wipedisks, so that when the creation of a disk fails, any leftover device iscleaned up. As a bonus, exceptions raised by _CreateBlockDev() are caught...
recreate-disks honors the prealloc_wipe_disks flag
Now even recreate-disks wipes the newly-created disks, if the flag is set.
Introduce wrapper for cmdlib._WipeDisks()
The wrapper handles errors by logging them and cleaning up freshly-createddisks.
Also, the correct disk is used in the error message when an error happensin cmdlib._CreateDisks() and the resulting disk clean-up fails....
Don't catch an exception that cannot be raised
Since 9b221ea4, _CreateBlockDev() doesn't raise OpExecError any more. Yetsome code was left in place to catch it. By removing that code we have twoadvantages:1. Dead code is removed.2. If for whatever reason _CreateBlockDev() raises OpExecError, the...
Wipe disks added through "gnt-instance modify"
In issue 353 Sascha Lucas reported that disks are not wiped when addedthrough “gnt-instance modify”. This patch adds this functionality andupdates the docstring for “_WipeDisks”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Move 'container.py' to storage directory
Moving 'container.py' to the storage directory.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Rename dir 'block' to 'storage'
Renaming the 'block' directory to 'storage', because I plan toplace code there that is related to file storage and leavingit named 'block' would be misleading.
Rename storage.py to container.py
Renaming 'storage.py' to 'container.py'. It will be moved into the new'storage' directory, which will come in later patches to avoid clashes ofnotation.
Move cmdlib.py to cmdlib/__init__.py
cmdlib.py has grown really too much. Move it into its own package toallow splitting it further.
Signed-off-by: Guido Trotter <ultrotter@google.com>Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Refactor check for exclusive_storage in LUInstanceCreate
The order of evaluation of the conditions is changed, so it's easier to addmore (foreseen) checks for exclusive_storage.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Refactor disk checks in LUInstanceSetParams
Prereq checks relative disks are grouped together and moved in a separatemethod. This reduces the clutter in CheckPrereq().
Fix `drbdsetup show` parsing for DRBD 8.4
In DRBD 8.4, Ganeti does no longer use indexed external meta data butflexible external metadata. Therefore, there is no longer a meta dataindex in the output of `drbdsetup show`.
Split DRBD8Dev into DRBD8 and DRBD8Dev
All functionality specific to a single DRBD8 devide is now in DRBD8Dev,whereas functionality which is valid for the whole DRBD "installation" on a device is collected in DRBD8.
This makes it possible to remove a couple of FIXME's and clarifies the...
Check for uniform DRBD version in node group
This check is performed during gnt-cluster verify and outputs warningsif at least two different DRBD versions are found within a node group.In such a case, all nodes with their installed DRBD version aredisplayed....
Rename DRBD8 to DRBD8Dev
Right now the DRBD8 class has multiple responsibilities: a) itreprensents a device which can be set up, grown, etc. and b) itrepresents the whole DRBD system on a node which has a usermode helper,which knows how to shut down all devices, etc. Therefore, the DRBD8Dev...
Make DRBD version queryable from noded
gnt-cluster verify should issue a warning if there are multiple DRBDversions present in a node group. In order to do so, the DRBD versionhas to be queryable from noded.
Merge remote-tracking branch 'origin/stable-2.8'
Conflicts: lib/bdev.py lib/cmdlib.py
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Disk templates are "allowed" and not "enabled" in ipolicies
The way disk templates were displayed in instance policies became confusingsince the introduction of the enabled_disk_templates cluster parameter.
Fix issue 440.
gnt-job list: deal with non-ascii encoding in jobs
This fixes issue 432. If a job summary contained a non-ascii character,gnt-job list crashed badly so far. This patch fixes the crash and makesgnt-job list display unicode characters properly.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Merge stable-2.7 into stable-2.8
Conflicts: INSTALL NEWS configure.ac src/Ganeti/Query/Group.hs test/hs/Test/Ganeti/Objects.hs test/hs/Test/Ganeti/Query/Query.hs
Support DRBD 8.4.3 command syntax
DRBD 8.4.3 does not support specifying volume ids directly whilecreating the meta device. It requires a slightly different syntax (usingflex-external as volume id) which is fortunately also supported by (atleast) DRBD 8.4.2....
gnt-cluster modify: check vg name only on vm-capable nodes
This fixes issue 432: when setting the volume group name, the presenceof the volume group was checked on all nodes. This patch now restrictsthe check only to the vm-capable ones.
Improve error message for file instance creation
Currently, when creating an instance with file storage fails,the error message is rather general. This patch adds a hinton what to do as a possible fix.
kvm: use -machine type,accel= for newer qemu
-enable-kvm and -disable-kvm are deprecated in favor of accel=kvm passedas a machine specification. This fixes compatibility with newer qemuversions.
kvm: Move parameter validation before use
We had parameter validation when the runtime is generated, but in themiddle of the function. Move up, before any parameter is accessed.
kvm: Use -display none rather than -nographic
Newer versions of kvm (from 1.4) don't support -nographic with-daemonize. When -display exists, use -display none instead.
This fixes Issue 389.
gnt-instance: new hypervisor parameter 'vif_type'
This patch fixes issue 247. It empowers the user to specifyexplicitly the vif type of a nic configuration of a Xen HVMinstance. This includes the option of setting it to '' on thecommandline, causing Ganeti to leave out the 'type' parameter...
Add command generator for DRBD 8.4
The DRBD84CmdGenerator class, which generates commands suited for DRBD8.4, is added. A common baseclass for DRBD83CmdGenerator andDRBD84CmdGenerator is introduced as well.
Extract command generation logic from DRBD8
In order to easily support the DRBD 8.4 command syntax, this patchextracts all command generation logic (i.e. where calls to `drbdsetup`are assembled) into a new class DRBD83CmdGenerator.
Use DRBD84ShowInfo based on DRBD version
Now the DRBD8 class actually checks which version of DRBD is running onthe system and chooses the right class to parse the `drbdsetup show`output.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Signed-off-by: Michele Tartara <mtartara@google.com>...
Add `drbdsetup show` parser for DRBD 8.4
Common functionality between the DRBD 8.3 and DRBD 8.4 parser has beenextracted into BaseShowInfo. A test which verifies the behaviour isincluded, but the DRBD84ShowInfo class is not yet used within the DRBD8class....
Extract DRBD info parsing into drbd_info.py
Parsing the status (/proc/drbd) and `drbdsetup show` output takes quitea bit of code, which has to be augmented by even more with the DRBD 8.4support. So extract all the related classes into their own file.
Extract DRBD8ShowInfo class
This class parses the `drbdsetup show` output and represents it in aneasily accessible format. It got extracted so that 1) the DRBD8 classcan focus more on DRBD logic rather than parsing and 2) it's easier toadapt the parser to new formats....
Rename _JoinProcDataPerMinor to _JoinLinesPerMinor
In the new context of the DRBD8Info class, the name_JoinProcDataPerMinor doesn't fit any more. _JoinLinesPerMinor reflectsmore precisely what's done, and doesn't imply that the data comes from/proc/drbd....
Extract /proc/drbd parsing code into DRBD8Info
As the DRBD8 class got bigger due to the previous merge of BaseDRBD, nowparts of it are ripped out into DRBD8Info. This new class parses/proc/drbd and exposes the information in an easily accessible way. This...
Remove BaseDRBD
BaseDRBD was probably useful when DRBD 0.7 and DRBD 8 were supported.However, there is only one subclass of BaseDRBD remaining (DRBD8), andthe separation of responsibilities between those two classes was ratherrandomly chosen.
The unification into one class also eases the introduction of...
Rename _MassageProcData to _JoinProcDataPerMinor
That's what the method actually does, so there is no reason why weshould use a funny but unreadable name.
Add command-line support for multiple specs in ipolicy
Command line options accept multiple min/max specifications in instancepolicies. The output of show-ispecs-cmd is updated accordingly.
Add multiple min/max specs in instance policy
Now instance policies can contain more than one min/max specs. This is themain element of the "Constrained instance sizes" section in the"Partitioned Ganeti" design doc.
This is a big patch, but changing the type of a configuration item requires...
Separate checks for std spec compliance
This is needed to be able to validate the std spec against multiple min/maxspec pairs (appearing in next patches).
Fix unclear error when replacing a nic's ip
The current error message ends up saying something like'192.168.5.5' != 'network1', which is sort of non-intuitive (yes, ofcourse they are different). Fix this by explaining better what theerroneous condition actually is....
Make DEFAULT_ENABLED_DISK_TEMPLATES a list
This patch makes the constant DEFAULT_ENABLED_DISK_TEMPLATESa list instead of a set, because the order of the elements actually mattersas the first one is planned to be the default disk template for instancecreation. Also, this constant is always used like a list and thus providing it...