- Dec 01, 2009
-
-
Iustin Pop authored
The DRBD driver can ignore dead disks but not dead meta devices (for which it refuses to configure the minor). To handle this case, we check that the meta device is readable and if not we ignore it (the same as when backend._RecursiveAssembleBD didn't find it). A needed change is the move of some checks and initialisers before this test (which is before the super().__init__ call), but that should be fine. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Nov 03, 2009
-
-
Iustin Pop authored
A newer version of pylint, more warnings… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
We will need to enumerate selectively the PVs of (possible) many VGs and not only the allocatable ones. For this we make the VG selection and the allocatable filtering optional. The two callers are modified for this new calling syntax. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
While ':' is not actually a supporte character in PV names (it has a special meaning for commands like lvcreate), we should throw specific errors for this case instead of generic “Can't create LV”. This patch does two things: - modifies the separator used when listing PVs to be '|' such that we can actually parse ':' as part of PV names - check if any of the discovered PVs have ':' in their name when creating LVs, and if so throw a specific error Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
Also replaces a hardcoded limit of 15 seconds with 1/4 of NET_RECONFIG_TIMEOUT. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 03, 2009
-
-
Michael Hanselmann authored
This survived QA, burnin and unittests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Luca Bigliardi <shammash@google.com>
-
- Aug 21, 2009
-
-
Iustin Pop authored
In case there are gaps in /proc/drbd related to the minors sequence, this can lead to empty lines (see the attached data file). In this case, we currently fail to parse the file correctly. The patch fixes this by skipping empty lines in bdev.BaseDRBD._MassageProcData and adds a data file and unittest for this condition. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 06, 2009
-
-
Michael Hanselmann authored
This allows us to report “uncertain” states (LDS_UNKNOWN) for cases where the code can't easily detect or report what's wrong with a block device. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 05, 2009
-
-
Michael Hanselmann authored
This patch changes the return type for backend.BlockdevFind to an object (objects.BlockDevStatus). Before a tuple was used. Adding more values to this tuple causes a lot of work. Converting the result to an object with properties will make this a bit simpler. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Aug 04, 2009
-
-
Iustin Pop authored
This patch adds a GetActualSize for block devices that returns the actual disk size. It is done using blockdev (and stat for file storage). While this could be done via reading /sys/block/N/size, that is not as simple as running blockdev, as the correspondence between an LV and its sys entry is not straightforward. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch changes the DRBD8 class (the only one to use the size in Assemble) to ignore the size in Assemble when a zero size is passed. This will allow activation of disks even when the size recorded in the configuration is wrong. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Jul 16, 2009
-
-
Iustin Pop authored
LVM has issues when growing stripped volumes, so it's best to specify the growth in exact multiples of the full stripe size (as precise as possible). For this we need to do a couple of changes: - in LVM Attach(), we query additionally the VG extent size and the LV stripe count; since this makes lvs return a (possibly) multi-line output, we now split it into lines and only take the last one - in LVM Grow(), we round up the increase in multiples of the full stripe size The patch also sets the correct target size in DRBD growth. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Olivier Tharan <olive@google.com>
-
- Jul 07, 2009
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 01, 2009
-
-
Iustin Pop authored
With the change to stripped LVs, the actual size of a meta device (which is small) can be more than we expected (for non-stripped LVs). This patch increases from 160MB to 1GB the accepted size, and updates the comment with the rationale behind this change. Note that we do want even meta devices stripped, since it can increase metadata update. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Olivier Tharan <olive@google.com>
-
- Jun 08, 2009
-
-
Iustin Pop authored
This patch enables stripped LVs, falling back to non-stripped if the stripped creation fails. If the configure-time lvm-stripecount is 1, this patch becomes a noop (with an insignificant python-level overhead, but no extra lvm calls). The effect of this patch is that new instances will get stripped LVs from the start, whereas old instances will have their LVs stripped as soon as replace-disks is run for them. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
Iustin Pop authored
This patch adds constants for the connection status, peer roles and disk status, and it changes the rules for when the disk is considered as “resyncing” - previously it was only for syncsource/synctarget, but there are many other transient statuses which could be misinterpreted as ‘degraded’ (because they where not considered as resyncing, but the disk is not consistent in these statuses). Furthermore, cmdlib.py:WaitForSync determines if a device is syncing or not based on sync_percent being not none. Not all DRBD resync statuses offer a percent done, so if we are syncing but don't have a sync percent, we'll report a zero sync percent (and no time estimate). The patch also removes a few unused variables (is_sync_target, peer_sync_target, is_resync) whose value doesn't make sense anymore with the new sync rules. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jun 03, 2009
-
-
Iustin Pop authored
This patch changes DRBD disk attachment to force the wanted size, as opposed to letting the device auto-discover its size. This should make the disks more resilient with regard to small differences in size (e.g. due to LVM rounding). This still works with regard to disk growth, but the instances needs to be fully restarted (including disks) in that case. This passes a full burning without problems, but it's still a tricky change - if the config.data is not synced with the reality, we might tell DRBD a wrong size. At least this will fail outright (and not introduce silent errors), as DRBD (per a quick check at the sources) tracks the size in the meta-dev and also does not allow shrinking consistent devices. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- May 28, 2009
-
-
Iustin Pop authored
This patch changes all the bdev.BlockDev constructors to take an additional ‘size’ parameter, all the backend functions that call those functions to pass it and also changes backend.BlocdevCreate() to not use the size passed via the rpc call but instead directly disk.size (this is the only way it's called). Note that this patch doesn't do anything with this parameter, just stores it on the blockdev objects. With the patch, we actually have a more uniform init sequence (before create had the parameter, but the other functions not). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- May 05, 2009
-
-
Iustin Pop authored
DRBD 8.3 changes two more things compared to 8.2: - /proc/drbd format changed in multiple ways; the part we're interested is the ‘st:’ to ‘ro:‘ change (in the changelog named as “Renamed 'state' to 'role'” - “drbdsetup /dev/drbdN show” changed the ‘device’ stanza from: device "/dev/drbd0"; to: device minor 0; This patch fixes these both and adds data files and unittests for DRBD 8.3.1. Signed-off-by:
Iustin Pop <iustin@google.com>
-
Karsten Keil authored
This patch adds (and suppresses) the extra ipv4/ipv6 words before the actual address that newer DRBD versions add. [iustin@google.com: slightly changed the patch to conform to style guide, and changed the commit message] Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Feb 16, 2009
-
-
Iustin Pop authored
If /proc/drbd can't be opened, this raises an IOError, but all the error-handling behaviour in backend treats only BlockDeviceErrors. This creates a plain failure in cluster verify and in other RPC calls. This patch simply converts EnvironmentErrors into BlockDeviceErrors, and also changes the RPC result for NV_DRBDLIST and its handling to be able to show the error. The other RPC calls work by default now, due the existing error handling. Reviewed-by: ultrotter
-
- Feb 11, 2009
-
-
Guido Trotter authored
In FileStorage there is a TODO: decide whether we should check for existing files and abort or not After Ganeti ate my instance data I decided. Let's abort. In general there is no reason we should overwrite existing files, and doing it can be very harmful for preexisting files on the host. Reviewed-by: iustinp
-
- Feb 10, 2009
-
-
Iustin Pop authored
Reviewed-by: imsnah
-
Iustin Pop authored
This patch converts the _CheckMetaSize method to raise exceptions instead of logging and returning False. This fits now in the new rpc return types, so it's a cheap change. Reviewed-by: ultrotter
-
Iustin Pop authored
This big patch converts the bdev Assemble() methods and the supporting functions to raise exceptions instead of returning False. This is a big patch, since the assembly functions touch other functions: add children, creation, etc. However, the patch does not add much new code, rather it reworks existing code. One of the biggest changes is in the rework of the DRBD8._SlowAssemble() method (one of the most complicated/ugly ones). Hopefully the new version is a little bit more readable. Reviewed-by: ultrotter
-
Iustin Pop authored
Currently, the Remove() methods of block devices return True/False. This doesn't permit any error detail reporting. This patch changes the return type to None for success, and raises BlockDeviceError in case of failure. This permits the details to be passed up the stack. The patch also simplifies a little the Remove method of file-based devices (no stat first, just try unlink). Reviewed-by: ultrotter
-
Iustin Pop authored
Currently, the Shutdown() methods of block devices return True/False. This doesn't permit any error detail reporting. This patch changes the return type to None for success, and raises BlockDeviceError in case of failure. This permits the details to be passed up the stack. For LVM and file-backed devices, this is a simple change. For DRBD, we first remove the shutdown of disks in case of network activation failures (since with static minors the minor is used anyway, we don't gain anything by clearing it), and the we simply change _ShutdownAll() to raise an exception. Reviewed-by: ultrotter
-
- Feb 09, 2009
-
-
Iustin Pop authored
This patch adds two utility functions for raising BlockDeviceError exceptions and for running functions while ignoring this error. Most of the manual “raise errors.BlockDeviceError” cases are converted to _ThrowError, as this makes the code clearer. We also change most of the DRBD error messages to include the minor number because with the parallel execution of commands it's not longer possible to identify the failed DRBD just from the timestamp, and the minor number can be mapped back to the instance easier. Reviewed-by: ultrotter
-
- Jan 23, 2009
-
-
Iustin Pop authored
Currently the DRBD code checks that the metadata devices are valid before creation, initial disk attachment and add children. However, the process for checking validity requires a free DRBD minor, and this conflict with parallel checking. There are at least three possible solutions: - serialize all checks, which means we reduce parallelism and need extra locks - don't pass a valid minor number, but one like “/dev/drbd256” (which is invalid); this works for current version of DRBD, but since it's not guaranteed to remain so it doesn't look nice - don't do the checking at all, and rely on “drbdsetup ... disk ...” to fail by itself The reason for checking metadata was that in 1.2, this was much cheaper than trying to activate devices (and the subsequent iteration over the minors). However, in 2.0, they have the same cost, so we can choose option 3: just remove the explicit checking and rely on drbdsetup and the kernel to fail. Since DRBD8._InitMeta still requires a minor number, the two places where this is run are handled as follows: - Create: we just use our own (unused currently) minor number - AddChildren: we keep using FindUnusedMinor, with the caveat that this function (used by replace-disks -n ...) cannot be yet parallelized Reviewed-by: ultrotter
-
- Jan 20, 2009
-
-
Iustin Pop authored
This patch adds support for verification of drbd minors space in cluster verify: minors which belong to running instances and should be online but are not, and minors which do not belong to any instace but are in use. The patch requires exposing some methods from bdev.DRBD8 and config.ConfigWriter which were until now private methods. Reviewed-by: ultrotter
-
Iustin Pop authored
In order to prevent errors with old, in-use DRBD minors, we check and abort at create time if our minor is already in use. For this we need to also modify DRBD8Status to be able to parse cs:Unconfigured devices. Reviewed-by: ultrotter
-
- Jan 19, 2009
-
-
Iustin Pop authored
Currently when creation LVM-based instances, we always get the extremely-confusing message "ERROR Can't find LV /dev/xenvg/..." which is actually expected. This behaviour was introduced before we had UUID-style LV names, since at that point it was not a unexpected to have such volumes laying around after a failed creation. Today, it's much more of an error to see existing volumes, and it's better to abort with a failure. Since bdev.LogicalVolume.Create() method will raise an error in case it exists, we can remove this check in backend before creating the device. The Create methods for DRBD and FileStorage currently don't raise exception, as behaviour is not very well defined here. We also change some exception types raised in bdev so that all exceptions raised by device creation are a subclass of GenericError. Reviewed-by: ultrotter
-
- Jan 13, 2009
-
-
Iustin Pop authored
This is a modified forward-port of DrbdNetReconfig and their associated RPCs. In Ganeti 2.0, these functions will be used for two things: - live migration (as in 1.2) - and for other network reconfiguration tasks, since DRBD8.Attach() doesn't do them anymore Because of the Attach() changes, we can now implement the AttachNet/DisconnectNet functions as independent entities, and we don't need the cache anymore. Note these functions are copies of the latest 1.2 code, and not cherry-picks of the (many) patches that went into 1.2. Reviewed-by: ultrotter
-
Iustin Pop authored
Since now the Assemble function is different than Attach, we rename this backend function to show that the intent is to fully assemble the device (and it's always allowed to modify the device). Reviewed-by: ultrotter
-
Iustin Pop authored
Currently, both the Attach and Assemble methods for DRBD8 devices will use and alter the device state. This is suboptimal, and it has been worked around in 1.2 via a special cache in the node daemon so that we don't need to call Attach() again in migration, for example. Since in 2.0 we have static minors, we can change these functions so that: - Attach() does not affect the device in any way, and only checks if the minor is already in use or not - Assemble() has two logic paths, one for startup from unused minor (the old Assemble, now renamed _FastAssemble) and one for re-checking/fixing an in-use minor (the old Attach, now renamed _SlowAttach) Basically Attach was renamed to _SlowAttach, Assemble to _FastAssemble, and we have a new, simple Assemble that calls one or the other based on the result of the new Attach. The LUReplaceDisks (with new secondary) is relying on the special semantics of Attach modifying the device and is broken until the end of the patch series. Reviewed-by: ultrotter
-
Iustin Pop authored
The caller of dev.Assemble() (backend._RecursiveAssembleBD) is doing an explicit recursion over all the children of the device, with better error reporting. As such, we don't need this repeated assembly inside the base BlockDev class. Reviewed-by: ultrotter
-
- Jan 09, 2009
-
-
Iustin Pop authored
This is modified forward-port of commit 1544 on the 1.2 branch: When DRBD is doing its dance to establish a connection with its peer, it also sends the synchronization speed over the wire. In some cases setting the sync speed only after setting up both sides can race with DRBD connecting, hence we set it here before telling DRBD anything about its peer. Reviewed-by: iustinp The modification we make is that we split SetSyncSpeed in two so that we don't need to modify our minor temporarily, and the fact that we call this function from within _AssembleNet (right before enabling network), instead of Assemble()/Attach(). Original-Author: imsnah
-
- Jan 08, 2009
-
-
Iustin Pop authored
This is plain copy of the 1.2 ReAttachNet and DisconnectNet methods on the DRBD8 device, with the logger to logging module changes and the ReAttachNet method renamed to AttachNet. These methods are not used anywhere right now, but will be used for migration and a simpler disk-replace. The code was originally committed on the 1.2 branch as revision numbers 1165 and 1204. Originally-Reviewed-by: imsnah, ultrotter
-
- Dec 11, 2008
-
-
Iustin Pop authored
This patch should fix all outstanding epydoc parsing errors; as such, we switch epydoc into verbose mode so that any new errors will be visible. Reviewed-by: imsnah
-
- Nov 27, 2008
-
-
Iustin Pop authored
We changed a while ago the protocol for opening block devices, but FileStorage was not changed. This patch makes it work again. Reviewed-by: imsnah
-