Skip to content
  • Iustin Pop's avatar
    Fix bug in drbd8 replace disks on current nodes · db8e5f1c
    Iustin Pop authored
    
    
    Currently the drbd8 replace-disks on the same node (i.e. -p or -s) has
    a bug in that it does modify the instance disk temporarily before
    changing it back to the same value. However, we don't need to, and
    shouldn't do that: what this operation do is simply change the LVM
    configuration on the node, but otherwise the instance disks keep the
    same configuration as before.
    
    In the current code, this change back-and-forth is fine *unless* we
    fail during attaching the new LVs to DRBD; in which case, we're left
    with a half-modified disk, which is entirely wrong.
    
    So we change the code in two ways:
    
    - use temporary copies of the disk children in the old_lvs var
    - stop updating disk.children
    
    Which means that the instance should not be modified anymore (except
    maybe for SetDiskID, which is a legacy and unfortunate decision that
    will have to cleaned up sometime).
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    db8e5f1c