-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add support for creating and managing LVM cache volumes #235
Add support for creating and managing LVM cache volumes #235
Conversation
|
||
def _attach_cache(self): | ||
""" Create a new cache pool and attach it to the volume """ | ||
raise BlivetAnsibleError("adding cache to an existing volume is currently not supported") |
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.
Blivet unfortunately doesn't support creating a new cache pool. We can attach an existing cache pool to the LV, but we can't create it. I plan to add support for creating cache pools to blivet and I'll update this when the support is available.
b3a1d10
to
63500af
Compare
Question: How should I handle situation where user specifies incompatible volume type -- this uses LVM cache so it doesn't make sense to use |
There generally isn't any input validation in system roles. But in specific cases, if it is important to prevent data loss, security breaches, and other critical issues, you can add custom input validation and parameter checking. @japokorn is adding some input validation #223 but this is mostly a syntax check, not the deeper checking you are proposing. The more checking you can do at the ansible level, the better, although for your case, it might not be possible, and you'll have to do it in the python module. There isn't really a code template or best practices for this - I suppose you could look at some of the other roles to see what they do, or if you know of any external ansible modules that do something like what you want to do. |
46636e6
to
82a5f96
Compare
[citest commit:82a5f96a1405a759fe9b9f420dbfa903f5b5813f] |
82a5f96
to
150b1cd
Compare
[citest commit:150b1cddb23919095238379f5c1510aa1d17e556] |
@vojtechtrefny can you rebase this PR on top of the latest master branch? I'd like to make sure this PR is ready for ansible-core 2.12 |
150b1cd
to
f9be558
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 other than the one question about cache device specification.
#### `cache_mode` | ||
Mode for the cache. Supported values include `writethrough` (default) and `writeback`. | ||
|
||
#### `cache_devices` |
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.
PVs could be partitions or md as well as whole disks. Their names may be difficult to predict. Is it the case that, as of now, we cannot operate on non-existent PVs/VGs because blivet cannot yet create cache pools? If it is possible, is there a way to specify the cache devices in terms of which disks they are on in these cases?
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 point. I think we can allow specifying list of disks and look for PVs in their children. I'll update the PR.
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.
I've added new commit that adds support for using disks for cache_devices
instead of PVs.
This pull request introduces 1 alert when merging d7dbad5 into 6f6c598 - view on LGTM.com new alerts:
|
d7dbad5
to
8385d92
Compare
[citest commit:8385d92945de0c43748a57aab77968efe082b09a] |
8385d92
to
a2f14f0
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.
19ef2b6
to
904911e
Compare
Rebased to resolve conflict with #241 |
@vojtechtrefny any idea about the rhel-x (RHEL9) failure? Is there a problem with |
I was able to reproduce this locally (not with 100 % success, probably one of out ten runs fails) and it looks like another instance of "we can't trust data from udev". The array is created correctly with 2 devices and 1 spare
but udev doesn't show the filesystem type for the spare. This is what
and because we (blivet) don't see the
I'll try to thing about some workaround in blivet for these situations. We as well might to issue |
Does it work if you set |
Oh, I forgot you added this. It looks like it fixes the issue, out 50 runs none failed with |
fb9c127
to
ecd2c53
Compare
Rebased and added the LVM cache parameters to |
It might be hard for users to know names of the partitions we'll create as PVs so we should let them disk names and get the PVs on them ourselves when creating the cache.
ecd2c53
to
598a449
Compare
[citest bad] |
[citest pending] |
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 to me.
No description provided.