• Iustin Pop's avatar
    Implement conversion from plain to drbd · e29e9550
    Iustin Pop authored
    
    
    This patch adds a new mode to instance modify, the changing of the disk
    template. For now only plain to drbd conversion is supported, and the
    new secondary node must be specified manually (no iallocator support).
    
    The procedure for conversion works as follows:
    
    - a completely new disk template is created, matching the count, size
      and mode of the instance's current disks
    - we create manually (not via _CreateDisks) all the missing volumes
    - we rename on the primary the LVs to the new name
    - we create manually the DRBD devices
    
    Failures during the creation of volumes will leave orphan volumes.
    Failure during the rename might leave some disks renamed and some not,
    leading to an inconsistent instance.
    
    Once the disks are renamed, we update the instance information and wait
    for resync. Any failures of the DRBD sync must be manually handled (like
    a normal failure, e.g. by running replace-disks, etc.).
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    e29e9550
cmdlib.py 325 KB