When the Cinder volumes for tools-db-1 and tools-db-2 were created in T329970 and T329521, they were created using Cinder snapshots (which in turn use Ceph RBD snapshots). This means we now have a volume chain of copy-on-write layers that cannot be easily flattened:
tools-db-basevolume1 -> tools-db-basesnapshot1 -> tools-db-basevolume2 -> tools-db-basesnapshot2 -> ( tools-db-1 | tools-db-2 )
The volumes tools-db-1 and tools-db-2 are the ones currently in use, but they are both layers on top of tools-db-basesnapshot2 and its parent layers. All the parent layers cannot be deleted because they are part of the same copy-on-write volume chain.
This should not cause any issue, but it would be cleaner to remove this long layer hierarchy. The easiest way I can think of is as follows:
- Create a new snapshot of tools-db-1 and name it tools-db-1-tmpsnapshot
- Create a new volume based on that snapshot and name it tools-db-1-fromsnapshot
- Create two new empty volumes tools-db-3 and tools-db-4
- Rsync all data from tools-db-1-fromsnapshot to both tools-db-3 and tools-db-4
- Create two new instances tools-db-3 and tools-db-4 and attach the new volumes tools-db-3 and tools-db-4
- Set up tools-db-3 to replicate from tools-db-2, and set up tools-db-4 to replicate from tools-db-3
- When they are in sync, promote tools-db-3 to become the new primary
- Delete the old instances tools-db-1 and tools-db-2, and their entire volume chains
- Delete the snapshot tools-db-1-tmpsnapshot and the volume tools-db-1-fromsnapshot