Hi,
I'm polishing my storage provider and I want to discuss policy when the provider deletes or overwrites something.
I propose:
A block device can *not* be deleted or overwritten (added to MD RAID, formatted with a filesystem, formatted as physical volume etc) if and only if: - There is a filesystem on the device and the filesystem is mounted. - Or, any other block device depends on it (Blivet knows this): - The device is member of a running MD RAID. - The device is member of a running volume groups. - The device is formatted as LUKS and the LUKS is opened. - (I haven't tested, but I suppose) The device is path of running multipath device.
In these cases OpenLMI storage provider returns an exception (ERR_FAILED), with description that 'Device %s is still used.'
All other devices can be deleted or overwritten. That includes (but is not limited to): - Device with unknown filesystem. - Device with MD RAID metadata, which is not running. - Device with physical volume metadata, but not part of any running VG. - Device with a filesystem, which is not mounted.
Does this make sense?
Jan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 04/03/2013 07:03 AM, Jan Safranek wrote:
Hi,
I'm polishing my storage provider and I want to discuss policy when the provider deletes or overwrites something.
I propose:
A block device can *not* be deleted or overwritten (added to MD RAID, formatted with a filesystem, formatted as physical volume etc) if and only if: - There is a filesystem on the device and the filesystem is mounted. - Or, any other block device depends on it (Blivet knows this): - The device is member of a running MD RAID. - The device is member of a running volume groups. - The device is formatted as LUKS and the LUKS is opened. - (I haven't tested, but I suppose) The device is path of running multipath device.
On a related note, should the network provider also prevent changing an interface that is actively engaged in a storage connection (NAS, SAN, iSCSI, FCoE, etc.)?
In these cases OpenLMI storage provider returns an exception (ERR_FAILED), with description that 'Device %s is still used.'
All other devices can be deleted or overwritten. That includes (but is not limited to): - Device with unknown filesystem. - Device with MD RAID metadata, which is not running. - Device with physical volume metadata, but not part of any running VG. - Device with a filesystem, which is not mounted.
Does this make sense?
Looks good to me.
I don't understand all that about storage, but I agree there should be some warning/fail if device is used.
RR
On 04/03/2013 01:03 PM, Jan Safranek wrote:
Hi,
I'm polishing my storage provider and I want to discuss policy when the provider deletes or overwrites something.
I propose:
A block device can *not* be deleted or overwritten (added to MD RAID, formatted with a filesystem, formatted as physical volume etc) if and only if:
- There is a filesystem on the device and the filesystem is mounted.
- Or, any other block device depends on it (Blivet knows this):
- The device is member of a running MD RAID.
- The device is member of a running volume groups.
- The device is formatted as LUKS and the LUKS is opened.
- (I haven't tested, but I suppose) The device is path of running
multipath device.
In these cases OpenLMI storage provider returns an exception (ERR_FAILED), with description that 'Device %s is still used.'
All other devices can be deleted or overwritten. That includes (but is not limited to):
- Device with unknown filesystem.
- Device with MD RAID metadata, which is not running.
- Device with physical volume metadata, but not part of any running VG.
- Device with a filesystem, which is not mounted.
Does this make sense?
Jan _______________________________________________ openlmi-devel mailing list openlmi-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/openlmi-devel
openlmi-devel@lists.fedorahosted.org