class TLReplaceDisks(Tasklet):
Replaces disks for an instance.
Note: Locking is not within the scope of this class.
Method | __init__ |
Initializes this class. |
Method |
|
Check prerequisites. |
Method |
|
Execute disk replacement. |
Instance Variable | disks |
Undocumented |
Instance Variable | early |
Undocumented |
Instance Variable | iallocator |
Undocumented |
Instance Variable | ignore |
Undocumented |
Instance Variable | instance |
Undocumented |
Instance Variable | instance |
Undocumented |
Instance Variable | instance |
Undocumented |
Instance Variable | mode |
Undocumented |
Instance Variable | new |
Undocumented |
Instance Variable | node |
Undocumented |
Instance Variable | other |
Undocumented |
Instance Variable | remote |
Undocumented |
Instance Variable | remote |
Undocumented |
Instance Variable | target |
Undocumented |
Static Method | _ |
Compute a new secondary node using an IAllocator. |
Method | _ |
Undocumented |
Method | _ |
Checks if the instance disks are activated. |
Method | _ |
Undocumented |
Method | _ |
Undocumented |
Method | _ |
Undocumented |
Method | _ |
Create new storage on the primary or secondary node. |
Method | _ |
Replace a disk on the primary or secondary for DRBD 8. |
Method | _ |
Replace the secondary node for DRBD 8. |
Method | _ |
Wrapper for FindFaultyInstanceDisks . |
Method | _ |
Undocumented |
Method | _ |
Update the configuration of disks to have a new secondary. |
Inherited from Tasklet
:
Instance Variable | cfg |
Undocumented |
Instance Variable | lu |
Undocumented |
Instance Variable | rpc |
Undocumented |
ganeti.cmdlib.base.Tasklet.__init__
Initializes this class.
ganeti.cmdlib.base.Tasklet.CheckPrereq
Check prerequisites.
This checks that the instance is in the cluster.
ganeti.cmdlib.base.Tasklet.Exec
Execute disk replacement.
This dispatches the disk replacement to the appropriate handler.
Checks if the instance disks are activated.
Parameters | |
instance | The instance to check disks |
Returns | |
True if they are activated, False otherwise |
Create new storage on the primary or secondary node.
This is only used for same-node replaces, not for changing the secondary node, hence we don't want to modify the existing disk.
Replace a disk on the primary or secondary for DRBD 8.
The algorithm for replace is quite complicated:
for each disk to be replaced:
- create new LVs on the target node with unique names
- detach old LVs from the drbd device
- rename old LVs to name_replaced.<time_t>
- rename new LVs to old LVs
- attach the new LVs (with the old names now) to the drbd device
- wait for sync across all devices
- for each modified disk:
- remove old LVs (which have the name name_replaces.<time_t>)
Failures are not very well handled.
Replace the secondary node for DRBD 8.
The algorithm for replace is quite complicated:
- for all disks of the instance:
- create new LVs on the new node with same names
- shutdown the drbd device on the old secondary
- disconnect the drbd network on the primary
- create the drbd device on the new secondary
- network attach the drbd on the primary, using an artifice: the drbd code for Attach() will connect to the network if it finds a device which is connected to the good local disks but not network enabled
- wait for sync across all devices
- remove all disks from the old secondary
Failures are not very well handled.