-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stratis support v2 #952
Stratis support v2 #952
Conversation
5cf7ec4
to
89d6c7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Other than the inline comments, it does make me wonder if a LUKSMixin
class would be worthwhile (to enable sharing the existing LUKS format code between formats and devices).
space += sum(p.size for p in self.pool.parents) | ||
log.debug("size bumped to %s to include Stratis pool parents", space) | ||
|
||
space += self._get_free_disk_space() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could move this down as the implementation of _get_device_space
? It's a strange case for sure. One way or another it would be good to remove the FIXME from _get_device_space
, even if the implementation stays as it is now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. The FIXME
from _get_device_space
actually refers to missing support for checking used space in pools, I was waiting for a new stratis API for this and forgot to implement free space and metadata usage in pools and filesystems. This needs to be added to both devicefactory
and devices/stratis
.
89d6c7b
to
2141619
Compare
Currently only Stratis private devices are being ignored.
New StratisBlockdev format and two new devices StratisPoolDevice and StratisFilesystemDevice has been added. Stratis devices are populated using data from Stratis DBus API (cached in static_data.stratis_info).
We are ignoring a lot of stratis private device mapper devices now so we can no longer use libblockdev DM plugin to remove Stratis storage stack and we need to use Stratis DBus API instead.
devicelibs.stratis uses stratis_info so we can't import constants from it here without breaking Python.
This will allow us handling the XFS filesystem on Stratis in a better way to avoid creating and removing it separately (it should be created and removed automatically together with the Stratis filesystem block device).
Locked pools are tricky because Stratis uses LUKS but the "Stratis LUKS devices" can't be unlocked with cryptsetup, only with Stratis API. This implementation "hides" the LUKS device for locked pools and use the StratisBlockdev format for them instead. To unlock a locked pool, unlock_pool() function of the StratisBlockdev format must be used.
The internal private dm-crypt device is created and destroyed together with the pool so having it in the tree would make things even more complicated.
2141619
to
f3bbdd7
Compare
When creating a new filesystem we need to check whether the pool has enough free space for it.
New version of #915 I made some smaller changes in the code, the biggest difference are names of the Stratis devices, I've removed the underscore in
stratis pool
andstratis filesystem
to make it more consistent with our other names. This now includes support for both "normal" and encrypted pools.I've also moved this to 3.5-devel to make 3.4.0 release a little bit smaller and to have more time for testing and review here.
You can use blivet-gui for testing (everything except devicefactory support), I have a PR with experimental Stratis support here storaged-project/blivet-gui#277