Comment 3 for bug 2025297

Revision history for this message
Facundo Ciccioli (fandanbango) wrote :

I'd add that some time ago we hit a very related issue to this. In essence I believe this bug should be about the fact that the charm is willing to zap disks all too carelessly. Such an action should have some safeguards.

What happened to us, tl/dr, was that we added a new device to the block-device config property. The new device was still being used as a bcache, and since the charm doesn't look for bcaches before preparing new devices it zapped it:

        if not is_lvm_physical_volume(device):
            # Unused device
            if overwrite is True or not has_partition_table(device):
                prepare_volume(device)
                new_devices.append(device)
        elif list_lvm_volume_group(device) != volume_group:
            # Existing LVM but not part of required VG or new device
            if overwrite is True:
                prepare_volume(device)
                new_devices.append(device)

The bcache device is not an LVM PV and has no partition table. So BAM, got prepared (ultimately zapped).