Local file systems, both supported and unsupported, are represented by LMI_LocalFileSystem class and its subclasses.
Each LMI_LocalFileSystem instance of supported filesystems have associated one instance of LMI_FileSystemSetting representing its configuration (e.g. inode size).
Supported filesystems are: ext2, ext3, ext4, xfs, btrfs. Only supported filesystems can be created! Actual set of supported filesystems can be obtained from LMI_FileSystemConfigurationCapabilities instance associated to LMI_FileSystemConfigurationService.
Following instance diagram shows four block devices:
Note
Currently the filesystem support is limited:
These limitations will be addressed in future releases.
Destroys a file system (LMI_LocalFileSystem) or other metadata, such as Physical Volume metadata or MD RAID metadata present (LMI_DataFormat) on a device.
Only unmounted filesystems and unused metadata can be deleted.
Use LMI_CreateFileSystem method. Following example formats /dev/sda3 with ext3:
# Find the /dev/sda3 device
sda3 = ns.CIM_StorageExtent.first_instance({"Name": "/dev/sda3"})
# Format it
(ret, outparams, err) = filesystem_service.SyncLMI_CreateFileSystem(
FileSystemType=filesystem_service.LMI_CreateFileSystem.FileSystemTypeValues.EXT3,
InExtents=[sda3])
The resulting filesystem is the same as shown in diagram above.
Use the same LMI_CreateFileSystem method as above. Following example formats /dev/sda1 and dev/sda2 as one btrfs volume:
# Find the /dev/sda1+2 devices
sda1 = ns.CIM_StorageExtent.first_instance({"Name": "/dev/sda1"})
sda2 = ns.CIM_StorageExtent.first_instance({"Name": "/dev/sda2"})
# Format them
(ret, outparams, err) = filesystem_service.SyncLMI_CreateFileSystem(
FileSystemType=filesystem_service.LMI_CreateFileSystem.FileSystemTypeValues.BTRFS,
InExtents=[sda1, sda2])
The resulting filesystem is the same as shown in diagram above.
Use LMI_CreateFileSystem method:
sda1 = ns.CIM_StorageExtent.first_instance({"Name": "/dev/sda1"})
fs = sda1.first_associator(ResultClass='LMI_LocalFileSystem')
(ret, outparams, err) = filesystem_service.SyncDeleteFileSystem(
TheFileSystem = fs.path)
Note that with one btrfs on multiple block devices, the whole btrfs volume is destroyed.
In future, we might implement: