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 thin provisioning and setting poolmetadatasize #154
Conversation
@@ -110,7 +115,14 @@ def create | |||
args.push('--type', @resource[:type]) | |||
end | |||
|
|||
args << @resource[:volume_group] | |||
if @resource[:thin] |
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.
if @resource[:thin]
is :false
or 'false'
then this will be truthy. The type should either munge or only accept literal true
and false
values.
This commit fixes the comments raised in PR/154 and adds testing and documentation; * Inherit the thin attribute from Puppet::Parameter::Boolean * Conditionally add -n flag to provider args rather than drop later * Fixed hard tab spaces in provider * Added documentation for new attributes * Added rspec tests
@afalko : I've addressed the point made by @hunner , made some other tweaks and added tests and documentation. I've raised this as a PR against your branch.... afalko#1 ... yep, a PR to a PR, github is sweet. @afalko Can you review and merge the above PR and then it should make it through to this one - we are keen to see this PR merged. Thanks! |
Additional fixes and testing/docs
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.
This looks good to me.... @hunner ?
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.
and I think for --thin
you cant pass --extents
or -L
and you are required to pass --virtualsize
end | ||
|
||
newparam(:poolmetadatasize) do | ||
desc "Change the size of logical volume pool metadata" |
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.
it is only used in the creat method. so it is not possible to change it.
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 - lvresize
does support this so it can be added easily enough
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.
Summary from IRC discussion: This is better documented and changed to a property in the future.
args << @resource[:volume_group] | ||
if @resource[:thin] | ||
args.push('--thin') | ||
args << @resource[:volume_group] + "/" + @resource[:name] |
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.
according lvcreate --help
the syntax is lvceate ... --thin VolumeGroupName/PoolLogicalVolume
the :name
here is IMO the name of the lv to be created not the pool lv.
the -n (--name)
is IMO still required and should be set to :name
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'm not sure about this..... I'll test it
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.
as you quoted from the man page. --thin
seems to have multiple outcomes. but there is --thinpool
too. for me it seems like --thinpool
was introduced later to be specific what happens.
desc "Change the size of logical volume pool metadata" | ||
validate do |value| | ||
unless value =~ /^[0-9]+(\.[0-9]+)?[KMGTPE]/i | ||
raise ArgumentError , "#{value} is not a valid logical volume size" |
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.
wrong error text
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'll change that, well spotted.
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.
Changed in afalko#2
@vinzent your first point about
|
@vinzent and I had a long discussion on this over IRC - I'll summarize here... The terminology and documentation around thin pools and thin pool volumes (which are different things but both are logical volumes) is confusing. This PR enables the creation of thin pools. What it doesn't do is allow you to create thin pool volumes inside this thin pool. For that reason, and after a discussion about some future work that will be raised in separate tickets, we've changed the attribute So currently, to create a thin pool you declare # Create a thin pool
logical_volume { 'blah':
volume_group => 'foo',
thinpool => true,
} The logic behind this is that we would (in a future PR) introduce the # Create a thin pool *volume*
logical_volume { 'mythinvol':
thin => true,
pool => 'blah',
} I think I've summarized that properly! The changes reflecting this are in a PR to this PR (afalko#2) - if you are happy with the above @afalko could you please merge that into this PR? We'll create issues separate to this PR capturing:
|
@vinzent @crayfishx : I've resolved the merge conflicts. |
@@ -1,3 +1,5 @@ | |||
require 'puppet/parameter/boolean' |
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.
This was added in puppet 3.3.0 so the version in metadata should be bumped.
* readahead (Parameter) - The readahead count to use for the new logical volume. | ||
* region_size (Parameter) - A mirror is divided into regions of this size (in MB), the mirror log uses this granularity to track which regions are in sync. CAN NOT BE CHANGED on already mirrored volume. Take your mirror size in terabytes and round up that number to the next power of 2, using that number as the -R argument. | ||
* size (Property) - The size of the logical volume. Set to undef to use all available space | ||
* size_is_minsize (Parameter) Default value: `:false` - Set to true if the ‘size’ parameter specified, is just the minimum size you need (if the LV found is larger then the size requests this is just logged not causing a FAIL) | ||
* stripes (Parameter) - The number of stripes to allocate for the new logical volume. | ||
* stripesize (Parameter) - The stripesize to use for the new logical volume. | ||
* thinpool (Parameter) - Default value: `:false` - Set to true to create a thin pool |
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.
s/:false/false/
@crayfishx will fix in follow-up PR |
Just updated my environment to use LVM-0.8.0 and it appears to be incompatible with Satellite 6.1 and using Smart Class Parameter. This code worked with 0.7.0:
but fails with 0.8.0 with the following error:
|
@unixsanet you're probably facing the longstanding environment isolation problem with ruby types. See https://docs.puppet.com/puppet/latest/environment_isolation.html . If you have multiple environments with different versions of the same ruby types you'll can get into troubles like this. |
@unixsanet I ran into the exact same issue and a restart of puppetserver on the affected master resolved it. |
…tlabs#154) * Add support for thin provisioning and setting poolmetadatasize * Additional fixes and testing/docs This commit fixes the comments raised in PR/154 and adds testing and documentation; * Inherit the thin attribute from Puppet::Parameter::Boolean * Conditionally add -n flag to provider args rather than drop later * Fixed hard tab spaces in provider * Added documentation for new attributes * Added rspec tests * added thin and poolmetadatasize to lvm::volume_group defined type * Changed thin attribute to thinpool * changed error message for poolmetadatasize validation * Document that poolmetadatasize currently only sets on creation * changed $thin to $thinpool, ommitted after attribute rename (#3)
I was following this PR and was not sure if the PR for creating thin pool volumes(thin-provisioned lv) like the example @crayfishx gave like below or #159. I do know that creating a thin pool was implemented in the PR but want to know if thin pool volumes was also implemented. Could someone please confirm this for me?
Thanks. |
It appears the thinpool => true, doesn't work. I have setup the below and manually trying to create a thin LV using the command
What I'm I doing wrong? |
No description provided.