Skip to content
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

Make blivet aware of internal LVs #149

Merged
merged 9 commits into from Jun 18, 2015

Conversation

vpodzime
Copy link
Contributor

@vpodzime vpodzime commented Jun 4, 2015

This is really more a request for comments than a real pull request as I'd like to know your opinion on the chosen approach. Making blivet aware of internal LVs is one of the crucial steps towards creation and manipulation of thin/cache pools' metadata volumes and other things.

The internal LVs are not part of the DeviceTree, they are only referenced by their "parent" LVs as they should not be manipulated with directly and because there may be many of them (tens on quite simple setups). However, these LVs are still just LVs like any other as far as things like name, UUID, size, etc. go.

@dwlehman
Copy link
Contributor

dwlehman commented Jun 5, 2015

I think this is generally a good approach. The internal LVs are represented, but because they aren't in the devicetree they do not complicate things on its level.

@vpodzime vpodzime changed the title RFC: Make blivet aware of internal LVs Make blivet aware of internal LVs Jun 8, 2015
@vpodzime
Copy link
Contributor Author

vpodzime commented Jun 8, 2015

Pushed a version that should be close to the final revision of this change. I did some manual testing on a VM with quite nice setup (4 LVs + ~20 internal LVs) and all seems to work as expected.

@vpodzime
Copy link
Contributor Author

Changed order of the last two patches and improved the second one. Should be ready for a review now.

@dwlehman
Copy link
Contributor

Have you run pylint on the tree with your changes applied?

@vpodzime
Copy link
Contributor Author

Have you run pylint on the tree with your changes applied?

Yes, but I only run it from time to time because on my Fedora 21 I get quite many false positives and pylint runs for a long time. I'll definitely run it and take care of all real issues before I merge this. The review of the idea, approach and implementation strategy is what the first required step, I think.

Just ignore the unsupported "sub-LVs" and consider cached LVs normal LVs.
Those that are related to each other should be next to each other and titled.
Internal LVs are not going to be referenced by the DeviceTree instance and are
going to have no parents. Their "parent" LVs are going to be referenced as
'self.parent_lv' instead of 'self.parents[0]' because all the other devices use
the opposite logic for parent-children relations -- children are consisting of
or built on top of parents (whereas "parent" LVs are consisting of their
internal LVs).

This way internal LVs can easily override these methods.
@vpodzime
Copy link
Contributor Author

New version with the suggestions and comments addressed. Internal LVs now have their format attribute set to DeviceFormat instances and I also added some local disables for pylint so that it doesn't complain about bad super() calls (intentional, explained in the comments) etc.

Also rebased to current master.

@@ -32,7 +32,7 @@

from .. import errors
from .. import util
from ..formats import getFormat
from ..formats import getFormat, DeviceFormat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is unused.

@dwlehman
Copy link
Contributor

Looks good to me aside from the one unused import.

@dwlehman dwlehman added the ACK label Jun 18, 2015
Also make the LVMLogicalVolumeDevice class ready for managing internal LVs.
Instead of calculating static values for number of copies, log size and metadata
size of a given LV, we should use internal LVs assigned to their "parent"
(normal) LVs and calculate such values dynamically from those internal LVs.
These are both valid types for the self.parents attribute.
Thin pools and thin LVs are also LVs so they should be included in the
result. Also don't use the to-be-deprecated-soon getDevicesByType() method.
Thin/cache pools have internal data/metadata LVs the name of which can be
queried. Let's use this functionality to help determining the parent LV if name
matching fails.
Internal metadata LVs of thin pools can be resized so our representation should
also allow it.
vpodzime added a commit that referenced this pull request Jun 18, 2015
Make blivet aware of internal LVs
@vpodzime vpodzime merged commit 7afac66 into storaged-project:master Jun 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants