chef-ruby-lvm-attrib 0.2.8 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.expeditor/config.yml +50 -0
- data/.expeditor/run_linux_tests.sh +16 -0
- data/.expeditor/update_version.sh +12 -0
- data/.expeditor/verify.pipeline.yml +19 -0
- data/.github/CODEOWNERS +3 -5
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +41 -1
- data/Gemfile +1 -0
- data/README.md +3 -1
- data/Rakefile +10 -5
- data/VERSION +1 -0
- data/bin/generate_field_data +63 -41
- data/chef-ruby-lvm-attrib.gemspec +1 -1
- data/lib/lvm/attributes.rb +4 -4
- data/lib/lvm/attributes/2.02.186(2)/lvs.yaml +328 -0
- data/lib/lvm/attributes/2.02.186(2)/lvsseg.yaml +138 -0
- data/lib/lvm/attributes/2.02.186(2)/pvs.yaml +113 -0
- data/lib/lvm/attributes/2.02.186(2)/pvsseg.yaml +16 -0
- data/lib/lvm/attributes/2.02.186(2)/vgs.yaml +140 -0
- data/lib/lvm/attributes/2.02.187(2)/lvs.yaml +328 -0
- data/lib/lvm/attributes/2.02.187(2)/lvsseg.yaml +138 -0
- data/lib/lvm/attributes/2.02.187(2)/pvs.yaml +113 -0
- data/lib/lvm/attributes/2.02.187(2)/pvsseg.yaml +16 -0
- data/lib/lvm/attributes/2.02.187(2)/vgs.yaml +140 -0
- data/lib/lvm/attributes/2.03.05(2)/lvs.yaml +328 -0
- data/lib/lvm/attributes/2.03.05(2)/lvsseg.yaml +138 -0
- data/lib/lvm/attributes/2.03.05(2)/pvs.yaml +113 -0
- data/lib/lvm/attributes/2.03.05(2)/pvsseg.yaml +16 -0
- data/lib/lvm/attributes/2.03.05(2)/vgs.yaml +140 -0
- data/lib/lvm/attributes/2.03.07(2)/lvs.yaml +348 -0
- data/lib/lvm/attributes/2.03.07(2)/lvsseg.yaml +214 -0
- data/lib/lvm/attributes/2.03.07(2)/pvs.yaml +113 -0
- data/lib/lvm/attributes/2.03.07(2)/pvsseg.yaml +16 -0
- data/lib/lvm/attributes/2.03.07(2)/vgs.yaml +140 -0
- data/lib/lvm/attributes/2.03.08(2)/lvs.yaml +364 -0
- data/lib/lvm/attributes/2.03.08(2)/lvsseg.yaml +214 -0
- data/lib/lvm/attributes/2.03.08(2)/pvs.yaml +113 -0
- data/lib/lvm/attributes/2.03.08(2)/pvsseg.yaml +16 -0
- data/lib/lvm/attributes/2.03.08(2)/vgs.yaml +140 -0
- data/lib/lvm/attributes/2.03.10(2)/lvs.yaml +364 -0
- data/lib/lvm/attributes/2.03.10(2)/lvsseg.yaml +214 -0
- data/lib/lvm/attributes/2.03.10(2)/pvs.yaml +113 -0
- data/lib/lvm/attributes/2.03.10(2)/pvsseg.yaml +16 -0
- data/lib/lvm/attributes/2.03.10(2)/vgs.yaml +140 -0
- metadata +38 -3
- data/.github/lock.yml +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 280e6c6c472a19708eb58979b3f270fcb863d88333d1622ae46463dee32e9d4d
|
|
4
|
+
data.tar.gz: 1eb3a82830f9ff18ce293fd92ef92f22496aed0e58498cae6ae3ac2bf168bd35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b77329263b40403cca3a38b5d7ac9fa0ea3d627d5718a8958ff973afa2699c4caaccdfd546ab4c899035c49f0e1f4a09230839fa5f0e31d0b5c51e78ee438131
|
|
7
|
+
data.tar.gz: f935c6348b4842eb0c814898953e5bc4bb7153ea1dc1358c1d032d26f79d3aa6b39b1ed684e97fd7f89dd3a1483b6de24a40af0c1e3c58b14a6c8d9cdcca0fb1
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Documentation available at https://expeditor.chef.io/docs/getting-started/
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
# Slack channel in Chef Software slack to send notifications about build failures, etc
|
|
5
|
+
slack:
|
|
6
|
+
notify_channel: chef-infra-notify
|
|
7
|
+
|
|
8
|
+
# This publish is triggered by the `built_in:publish_rubygems` artifact_action.
|
|
9
|
+
rubygems:
|
|
10
|
+
- chef-ruby-lvm-attrib
|
|
11
|
+
|
|
12
|
+
github:
|
|
13
|
+
# This deletes the GitHub PR branch after successfully merged into the release branch
|
|
14
|
+
delete_branch_on_merge: true
|
|
15
|
+
# The tag format to use (e.g. v1.0.0)
|
|
16
|
+
version_tag_format: "v{{version}}"
|
|
17
|
+
# allow bumping the minor release via label
|
|
18
|
+
minor_bump_labels:
|
|
19
|
+
- "Expeditor: Bump Version Minor"
|
|
20
|
+
# allow bumping the major release via label
|
|
21
|
+
major_bump_labels:
|
|
22
|
+
- "Expeditor: Bump Version Major"
|
|
23
|
+
|
|
24
|
+
changelog:
|
|
25
|
+
rollup_header: Changes not yet released to rubygems.org
|
|
26
|
+
|
|
27
|
+
# These actions are taken, in order they are specified, anytime a Pull Request is merged.
|
|
28
|
+
merge_actions:
|
|
29
|
+
- built_in:bump_version:
|
|
30
|
+
ignore_labels:
|
|
31
|
+
- "Expeditor: Skip Version Bump"
|
|
32
|
+
- "Expeditor: Skip All"
|
|
33
|
+
- bash:.expeditor/update_version.sh:
|
|
34
|
+
only_if: built_in:bump_version
|
|
35
|
+
- built_in:update_changelog:
|
|
36
|
+
ignore_labels:
|
|
37
|
+
- "Expeditor: Skip Changelog"
|
|
38
|
+
- "Expeditor: Skip All"
|
|
39
|
+
- built_in:build_gem:
|
|
40
|
+
only_if: built_in:bump_version
|
|
41
|
+
|
|
42
|
+
pipelines:
|
|
43
|
+
- verify:
|
|
44
|
+
description: Pull Request validation tests
|
|
45
|
+
public: true
|
|
46
|
+
|
|
47
|
+
promote:
|
|
48
|
+
actions:
|
|
49
|
+
- built_in:rollover_changelog
|
|
50
|
+
- built_in:publish_rubygems
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# This script runs a passed in command, but first setups up the bundler caching on the repo
|
|
4
|
+
|
|
5
|
+
set -ue
|
|
6
|
+
|
|
7
|
+
export USER="root"
|
|
8
|
+
export LANG=C.UTF-8 LANGUAGE=C.UTF-8
|
|
9
|
+
|
|
10
|
+
echo "--- bundle install"
|
|
11
|
+
|
|
12
|
+
bundle config --local path vendor/bundle
|
|
13
|
+
bundle install --jobs=7 --retry=3
|
|
14
|
+
|
|
15
|
+
echo "+++ bundle exec task"
|
|
16
|
+
bundle exec $@
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# After a PR merge, Chef Expeditor will bump the PATCH version in the VERSION file.
|
|
4
|
+
# It then executes this file to update any other files/components with that new version.
|
|
5
|
+
#
|
|
6
|
+
|
|
7
|
+
set -evx
|
|
8
|
+
|
|
9
|
+
sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" lib/lvm/attributes.rb
|
|
10
|
+
|
|
11
|
+
# Once Expeditor finshes executing this script, it will commit the changes and push
|
|
12
|
+
# the commit as a new tag corresponding to the value in the VERSION file.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
expeditor:
|
|
3
|
+
cached_folders:
|
|
4
|
+
- vendor
|
|
5
|
+
defaults:
|
|
6
|
+
buildkite:
|
|
7
|
+
retry:
|
|
8
|
+
automatic:
|
|
9
|
+
limit: 1
|
|
10
|
+
timeout_in_minutes: 30
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- label: lint-chefstyle
|
|
14
|
+
command:
|
|
15
|
+
- .expeditor/run_linux_tests.sh "rake style"
|
|
16
|
+
expeditor:
|
|
17
|
+
executor:
|
|
18
|
+
docker:
|
|
19
|
+
image: ruby:2.7-buster
|
data/.github/CODEOWNERS
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Order is important. The last matching pattern has the most precedence.
|
|
2
2
|
|
|
3
|
-
*
|
|
4
|
-
.expeditor
|
|
5
|
-
|
|
6
|
-
RELEASE_NOTES.md @chef/docs-team
|
|
7
|
-
.github/ISSUE_TEMPLATE/** @chef/docs-team
|
|
3
|
+
* @chef/chef-infra-reviewers @chef/chef-infra-approvers @chef/chef-infra-owners
|
|
4
|
+
.expeditor/ @chef/jex-team
|
|
5
|
+
*.md @chef/docs-team
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
+
# chef-ruby-lvm-attrib Changelog
|
|
2
|
+
|
|
3
|
+
<!-- latest_release 0.3.5 -->
|
|
4
|
+
## [v0.3.5](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.5) (2020-10-01)
|
|
5
|
+
|
|
6
|
+
#### Merged Pull Requests
|
|
7
|
+
- Add 2.02.187(2) attributes [#30](https://github.com/chef/chef-ruby-lvm-attrib/pull/30) ([gyanendra-choudhary](https://github.com/gyanendra-choudhary))
|
|
8
|
+
<!-- latest_release -->
|
|
9
|
+
<!-- release_rollup since=0.3.3 -->
|
|
10
|
+
### Changes not yet released to rubygems.org
|
|
11
|
+
|
|
12
|
+
#### Merged Pull Requests
|
|
13
|
+
- Add 2.02.187(2) attributes [#30](https://github.com/chef/chef-ruby-lvm-attrib/pull/30) ([gyanendra-choudhary](https://github.com/gyanendra-choudhary)) <!-- 0.3.5 -->
|
|
14
|
+
- Misc Chefstyle fixes [#29](https://github.com/chef/chef-ruby-lvm-attrib/pull/29) ([tas50](https://github.com/tas50)) <!-- 0.3.4 -->
|
|
15
|
+
<!-- release_rollup -->
|
|
16
|
+
|
|
17
|
+
<!-- latest_stable_release -->
|
|
18
|
+
## [v0.3.3](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.3) (2020-07-21)
|
|
19
|
+
|
|
20
|
+
#### Merged Pull Requests
|
|
21
|
+
- Added v2_03_07 attributes [#28](https://github.com/chef/chef-ruby-lvm-attrib/pull/28) ([bottleneko](https://github.com/bottleneko))
|
|
22
|
+
<!-- latest_stable_release -->
|
|
23
|
+
|
|
24
|
+
## [v0.3.2](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.2) (2020-05-27)
|
|
25
|
+
|
|
26
|
+
#### Merged Pull Requests
|
|
27
|
+
- Added v2_03_08 attributes [#27](https://github.com/chef/chef-ruby-lvm-attrib/pull/27) ([gaelik](https://github.com/gaelik))
|
|
28
|
+
|
|
29
|
+
## [v0.3.1](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.1) (2020-04-15)
|
|
30
|
+
|
|
31
|
+
#### Merged Pull Requests
|
|
32
|
+
- Add 2.03.10 data [#25](https://github.com/chef/chef-ruby-lvm-attrib/pull/25) ([tas50](https://github.com/tas50))
|
|
33
|
+
|
|
34
|
+
## [v0.3.0](https://github.com/chef/chef-ruby-lvm-attrib/tree/v0.3.0) (2019-10-18)
|
|
35
|
+
|
|
36
|
+
#### Merged Pull Requests
|
|
37
|
+
- Wire up Expeditor and Buildkite [#22](https://github.com/chef/chef-ruby-lvm-attrib/pull/22) ([tas50](https://github.com/tas50))
|
|
38
|
+
- Added v2_02_186 attributes [#18](https://github.com/chef/chef-ruby-lvm-attrib/pull/18) ([b-dean](https://github.com/b-dean))
|
|
39
|
+
- Add the gem badge to the readme + resolve chefstyle warnings [#23](https://github.com/chef/chef-ruby-lvm-attrib/pull/23) ([tas50](https://github.com/tas50))
|
|
40
|
+
|
|
1
41
|
# 0.2.8 (2019-08-09)
|
|
2
42
|
|
|
3
43
|
- Added 2.02.185
|
|
@@ -152,4 +192,4 @@
|
|
|
152
192
|
|
|
153
193
|
- Added LVM attributes for version 2.02.111
|
|
154
194
|
- Added MIT license to the Gemspec
|
|
155
|
-
- Gemspec now properly loads the version from the lib/attributes.rb file
|
|
195
|
+
- Gemspec now properly loads the version from the lib/attributes.rb file
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# chef-ruby-lvm-attrib
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/chef-ruby-lvm-attrib)
|
|
4
|
+
|
|
3
5
|
This is a list of attributes for lvm objects. They are generated from the source code and broken down by version. See ADDING ATTRIBUTES below to contribute.
|
|
4
6
|
|
|
5
7
|
At their core these files exist to determine which arguments to pass lvs/vgs/pvs and the subsequent type conversions.
|
|
@@ -21,7 +23,7 @@ Currently this is split from the main ruby-lvm gem since these files require upd
|
|
|
21
23
|
## Installation
|
|
22
24
|
|
|
23
25
|
```bash
|
|
24
|
-
sudo gem install ruby-lvm-attrib
|
|
26
|
+
sudo gem install chef-ruby-lvm-attrib
|
|
25
27
|
```
|
|
26
28
|
|
|
27
29
|
## Updating for new LVM releases
|
data/Rakefile
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
require "bundler/gem_tasks"
|
|
2
2
|
|
|
3
|
-
task :
|
|
3
|
+
task default: :style
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
require "
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
begin
|
|
6
|
+
require "chefstyle"
|
|
7
|
+
require "rubocop/rake_task"
|
|
8
|
+
desc "Run Chefstyle tests"
|
|
9
|
+
RuboCop::RakeTask.new(:style) do |task|
|
|
10
|
+
task.options += ["--display-cop-names", "--no-color"]
|
|
11
|
+
end
|
|
12
|
+
rescue LoadError
|
|
13
|
+
puts "chefstyle gem is not installed. bundle install first to make sure all dependencies are installed."
|
|
9
14
|
end
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.3.5
|
data/bin/generate_field_data
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
#
|
|
6
6
|
# ./generate_field_data ~/LVM2.2.02.38
|
|
7
7
|
|
|
8
|
-
require "fileutils"
|
|
9
|
-
require "yaml"
|
|
8
|
+
require "fileutils" unless defined?(FileUtils)
|
|
9
|
+
require "yaml" unless defined?(YAML)
|
|
10
10
|
|
|
11
|
-
VERSION_FILE = "/VERSION"
|
|
12
|
-
COLUMNS_FILE = "/lib/report/columns.h"
|
|
11
|
+
VERSION_FILE = "/VERSION".freeze
|
|
12
|
+
COLUMNS_FILE = "/lib/report/columns.h".freeze
|
|
13
13
|
|
|
14
14
|
debug = false
|
|
15
15
|
|
|
@@ -70,7 +70,6 @@ TYPE_CONVERSION_MAP = {
|
|
|
70
70
|
"raidminrecoveryrate" => "Integer",
|
|
71
71
|
"raidmaxrecoveryrate" => "Integer",
|
|
72
72
|
"segsizepe" => "Integer",
|
|
73
|
-
"thinid" => "Integer",
|
|
74
73
|
# New fields for caching
|
|
75
74
|
"cache_total_blocks" => "Integer",
|
|
76
75
|
"cache_used_blocks" => "Integer",
|
|
@@ -92,7 +91,29 @@ TYPE_CONVERSION_MAP = {
|
|
|
92
91
|
"seg_new_data_offset" => "Integer",
|
|
93
92
|
"seg_parity_chunks" => "Integer",
|
|
94
93
|
"cachemetadataformat" => "Integer",
|
|
95
|
-
|
|
94
|
+
|
|
95
|
+
# these seems to be integers
|
|
96
|
+
"vdo_used_size" => "Integer",
|
|
97
|
+
"vdo_saving_percent" => "Integer",
|
|
98
|
+
"writecache_total_blocks" => "Integer",
|
|
99
|
+
"writecache_free_blocks" => "Integer",
|
|
100
|
+
"writecache_writeback_blocks" => "Integer",
|
|
101
|
+
"writecache_error" => "Integer",
|
|
102
|
+
"vdo_minimum_io_size" => "Integer",
|
|
103
|
+
"vdo_block_map_cache_size" => "Integer",
|
|
104
|
+
"vdo_block_map_era_length" => "Integer",
|
|
105
|
+
"vdo_index_memory_size" => "Integer",
|
|
106
|
+
"vdo_slab_size" => "Integer",
|
|
107
|
+
"vdo_ack_threads" => "Integer",
|
|
108
|
+
"vdo_bio_threads" => "Integer",
|
|
109
|
+
"vdo_bio_rotation" => "Integer",
|
|
110
|
+
"vdo_cpu_threads" => "Integer",
|
|
111
|
+
"vdo_hash_zone_threads" => "Integer",
|
|
112
|
+
"vdo_logical_threads" => "Integer",
|
|
113
|
+
"vdo_physical_threads" => "Integer",
|
|
114
|
+
"vdo_max_discard" => "Integer",
|
|
115
|
+
"vdo_header_size" => "Integer",
|
|
116
|
+
}.freeze
|
|
96
117
|
|
|
97
118
|
lvm_source = ARGV[0]
|
|
98
119
|
|
|
@@ -105,12 +126,13 @@ pvssegs = []
|
|
|
105
126
|
vgs = []
|
|
106
127
|
File.readlines(lvm_source + COLUMNS_FILE).each do |line|
|
|
107
128
|
# eg: FIELD(LVS, lv, STR, "LV UUID", lvid.id[1], 38, uuid, "lv_uuid", "Unique identifier")
|
|
108
|
-
next unless line =~
|
|
129
|
+
next unless line =~ /^FIELD\((.*)\)$/
|
|
130
|
+
|
|
109
131
|
fields = $1.split(", ")
|
|
110
|
-
fields.each { |f| f.gsub!(
|
|
132
|
+
fields.each { |f| f.gsub!(/^"/, ""); f.gsub!(/"$/, "") }
|
|
111
133
|
p fields if debug
|
|
112
|
-
app
|
|
113
|
-
general_type
|
|
134
|
+
app = fields[0]
|
|
135
|
+
general_type = fields[2]
|
|
114
136
|
specific_type = fields[6]
|
|
115
137
|
column = fields[7]
|
|
116
138
|
method = fields[7].dup
|
|
@@ -133,24 +155,24 @@ File.readlines(lvm_source + COLUMNS_FILE).each do |line|
|
|
|
133
155
|
# with issues (seg_start).
|
|
134
156
|
case app
|
|
135
157
|
when "LVS", "LVSINFOSTATUS", "LVSSTATUS"
|
|
136
|
-
method.sub!(
|
|
158
|
+
method.sub!(/^lv_/, "")
|
|
137
159
|
when "SEGS"
|
|
138
|
-
method.sub!(
|
|
160
|
+
method.sub!(/^seg_/, "")
|
|
139
161
|
when "LABEL"
|
|
140
|
-
method.sub!(
|
|
162
|
+
method.sub!(/^pv_/, "")
|
|
141
163
|
when "PVS"
|
|
142
|
-
method.sub!(
|
|
164
|
+
method.sub!(/^pv_/, "")
|
|
143
165
|
when "PVSEGS"
|
|
144
|
-
method.sub!(
|
|
166
|
+
method.sub!(/^pvseg_/, "")
|
|
145
167
|
when "VGS"
|
|
146
|
-
method.sub!(
|
|
168
|
+
method.sub!(/^vg_/, "")
|
|
147
169
|
end
|
|
148
170
|
|
|
149
171
|
attribute = {
|
|
150
|
-
:
|
|
151
|
-
:
|
|
152
|
-
:
|
|
153
|
-
:
|
|
172
|
+
method: method,
|
|
173
|
+
column: column,
|
|
174
|
+
type_hint: attribute_type,
|
|
175
|
+
description: description,
|
|
154
176
|
}
|
|
155
177
|
|
|
156
178
|
case app
|
|
@@ -170,27 +192,27 @@ File.readlines(lvm_source + COLUMNS_FILE).each do |line|
|
|
|
170
192
|
end
|
|
171
193
|
|
|
172
194
|
# we use vg_uuid as our crossover attribute that links vg->lv and vg->pv
|
|
173
|
-
attribute = { :
|
|
174
|
-
:
|
|
175
|
-
:
|
|
176
|
-
:
|
|
195
|
+
attribute = { method: "vg_uuid",
|
|
196
|
+
column: "vg_uuid",
|
|
197
|
+
type_hint: "String",
|
|
198
|
+
description: "For VolumeGroup to LogicalVolume relationship." }
|
|
177
199
|
lvs << attribute
|
|
178
|
-
attribute = { :
|
|
179
|
-
:
|
|
180
|
-
:
|
|
181
|
-
:
|
|
200
|
+
attribute = { method: "vg_uuid",
|
|
201
|
+
column: "vg_uuid",
|
|
202
|
+
type_hint: "String",
|
|
203
|
+
description: "For VolumeGroup to PhysicalVolume relationship." }
|
|
182
204
|
pvs << attribute
|
|
183
205
|
|
|
184
206
|
# and we link lv->lvsegment, pv->pvsegment
|
|
185
|
-
attribute = { :
|
|
186
|
-
:
|
|
187
|
-
:
|
|
188
|
-
:
|
|
207
|
+
attribute = { method: "lv_uuid",
|
|
208
|
+
column: "lv_uuid",
|
|
209
|
+
type_hint: "String",
|
|
210
|
+
description: "For LogicalVolume to LogicalVolumeSegment relationship." }
|
|
189
211
|
lvssegs << attribute
|
|
190
|
-
attribute = { :
|
|
191
|
-
:
|
|
192
|
-
:
|
|
193
|
-
:
|
|
212
|
+
attribute = { method: "pv_uuid",
|
|
213
|
+
column: "pv_uuid",
|
|
214
|
+
type_hint: "String",
|
|
215
|
+
description: "For PhysicalVolume to PhysicalVolumeSegment relationship." }
|
|
194
216
|
pvssegs << attribute
|
|
195
217
|
|
|
196
218
|
lvs.sort! { |x, y| x[:column] <=> y[:column] }
|
|
@@ -202,11 +224,11 @@ vgs.sort! { |x, y| x[:column] <=> y[:column] }
|
|
|
202
224
|
attributes_dir = "lib/lvm/attributes/#{version}"
|
|
203
225
|
FileUtils.mkdir(attributes_dir)
|
|
204
226
|
|
|
205
|
-
disclaimer =
|
|
206
|
-
# These are column to object attribute mappings
|
|
207
|
-
# generated by #{$0} based on
|
|
208
|
-
# #{lvm_source}/lib/report/columns.h
|
|
209
|
-
|
|
227
|
+
disclaimer = <<~GO
|
|
228
|
+
# These are column to object attribute mappings
|
|
229
|
+
# generated by #{$0} based on
|
|
230
|
+
# #{lvm_source}/lib/report/columns.h
|
|
231
|
+
GO
|
|
210
232
|
|
|
211
233
|
File.open("#{attributes_dir}/lvs.yaml", "w") { |f| f.write(disclaimer); f.write(lvs.to_yaml) }
|
|
212
234
|
File.open("#{attributes_dir}/lvsseg.yaml", "w") { |f| f.write(disclaimer); f.write(lvssegs.to_yaml) }
|
data/lib/lvm/attributes.rb
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
require "yaml"
|
|
1
|
+
require "yaml" unless defined?(YAML)
|
|
2
2
|
|
|
3
3
|
module LVM
|
|
4
4
|
module Attributes
|
|
5
|
-
VERSION = "0.
|
|
5
|
+
VERSION = "0.3.5".freeze
|
|
6
6
|
|
|
7
7
|
def load(version, name)
|
|
8
|
-
cwd =
|
|
8
|
+
cwd = __dir__
|
|
9
9
|
|
|
10
10
|
# was going to be symlinks, but rubygems didn't seem to want to package
|
|
11
11
|
# them
|
|
@@ -18,7 +18,7 @@ module LVM
|
|
|
18
18
|
file = File.join(cwd, "attributes", version, name)
|
|
19
19
|
|
|
20
20
|
begin
|
|
21
|
-
|
|
21
|
+
YAML.load_file(file)
|
|
22
22
|
rescue Errno::ENOENT => e
|
|
23
23
|
raise ArgumentError.new("Unable to load lvm attributes [#{name}] for version [#{version}]. " \
|
|
24
24
|
"The version/object may not be supported or you may need to upgrade the chef-ruby-lvm-attrib gem. Error [#{e.message}]")
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# These are column to object attribute mappings
|
|
2
|
+
# generated by ./bin/generate_field_data based on
|
|
3
|
+
# lvm2/lib/report/columns.h
|
|
4
|
+
---
|
|
5
|
+
- :method: cache_dirty_blocks
|
|
6
|
+
:column: cache_dirty_blocks
|
|
7
|
+
:type_hint: Integer
|
|
8
|
+
:description: Dirty cache blocks.
|
|
9
|
+
- :method: cache_read_hits
|
|
10
|
+
:column: cache_read_hits
|
|
11
|
+
:type_hint: Integer
|
|
12
|
+
:description: Cache read hits.
|
|
13
|
+
- :method: cache_read_misses
|
|
14
|
+
:column: cache_read_misses
|
|
15
|
+
:type_hint: Integer
|
|
16
|
+
:description: Cache read misses.
|
|
17
|
+
- :method: cache_total_blocks
|
|
18
|
+
:column: cache_total_blocks
|
|
19
|
+
:type_hint: Integer
|
|
20
|
+
:description: Total cache blocks.
|
|
21
|
+
- :method: cache_used_blocks
|
|
22
|
+
:column: cache_used_blocks
|
|
23
|
+
:type_hint: Integer
|
|
24
|
+
:description: Used cache blocks.
|
|
25
|
+
- :method: cache_write_hits
|
|
26
|
+
:column: cache_write_hits
|
|
27
|
+
:type_hint: Integer
|
|
28
|
+
:description: Cache write hits.
|
|
29
|
+
- :method: cache_write_misses
|
|
30
|
+
:column: cache_write_misses
|
|
31
|
+
:type_hint: Integer
|
|
32
|
+
:description: Cache write misses.
|
|
33
|
+
- :method: convert_lv
|
|
34
|
+
:column: convert_lv
|
|
35
|
+
:type_hint: String
|
|
36
|
+
:description: For lvconvert
|
|
37
|
+
- :method: convert_lv_uuid
|
|
38
|
+
:column: convert_lv_uuid
|
|
39
|
+
:type_hint: String
|
|
40
|
+
:description: For lvconvert
|
|
41
|
+
- :method: copy_percent
|
|
42
|
+
:column: copy_percent
|
|
43
|
+
:type_hint: String
|
|
44
|
+
:description: For Cache
|
|
45
|
+
- :method: data_lv
|
|
46
|
+
:column: data_lv
|
|
47
|
+
:type_hint: String
|
|
48
|
+
:description: For thin and cache pools
|
|
49
|
+
- :method: data_lv_uuid
|
|
50
|
+
:column: data_lv_uuid
|
|
51
|
+
:type_hint: String
|
|
52
|
+
:description: For thin and cache pools
|
|
53
|
+
- :method: data_percent
|
|
54
|
+
:column: data_percent
|
|
55
|
+
:type_hint: String
|
|
56
|
+
:description: For snapshot
|
|
57
|
+
- :method: kernel_cache_policy
|
|
58
|
+
:column: kernel_cache_policy
|
|
59
|
+
:type_hint: String
|
|
60
|
+
:description: Cache policy used in kernel.
|
|
61
|
+
- :method: kernel_cache_settings
|
|
62
|
+
:column: kernel_cache_settings
|
|
63
|
+
:type_hint: String
|
|
64
|
+
:description: Cache settings/parameters as set in kernel
|
|
65
|
+
- :method: kernel_discards
|
|
66
|
+
:column: kernel_discards
|
|
67
|
+
:type_hint: String
|
|
68
|
+
:description: For thin pools
|
|
69
|
+
- :method: kernel_metadata_format
|
|
70
|
+
:column: kernel_metadata_format
|
|
71
|
+
:type_hint: Integer
|
|
72
|
+
:description: Cache metadata format used in kernel.
|
|
73
|
+
- :method: active
|
|
74
|
+
:column: lv_active
|
|
75
|
+
:type_hint: String
|
|
76
|
+
:description: Active state of the LV.
|
|
77
|
+
- :method: active_exclusively
|
|
78
|
+
:column: lv_active_exclusively
|
|
79
|
+
:type_hint: String
|
|
80
|
+
:description: Set if the LV is active exclusively.
|
|
81
|
+
- :method: active_locally
|
|
82
|
+
:column: lv_active_locally
|
|
83
|
+
:type_hint: String
|
|
84
|
+
:description: Set if the LV is active locally.
|
|
85
|
+
- :method: active_remotely
|
|
86
|
+
:column: lv_active_remotely
|
|
87
|
+
:type_hint: String
|
|
88
|
+
:description: Set if the LV is active remotely.
|
|
89
|
+
- :method: allocation_locked
|
|
90
|
+
:column: lv_allocation_locked
|
|
91
|
+
:type_hint: String
|
|
92
|
+
:description: Set if LV is locked against allocation changes.
|
|
93
|
+
- :method: allocation_policy
|
|
94
|
+
:column: lv_allocation_policy
|
|
95
|
+
:type_hint: String
|
|
96
|
+
:description: LV allocation policy.
|
|
97
|
+
- :method: ancestors
|
|
98
|
+
:column: lv_ancestors
|
|
99
|
+
:type_hint: String
|
|
100
|
+
:description: LV ancestors ignoring any stored history of the ancestry chain.
|
|
101
|
+
- :method: attr
|
|
102
|
+
:column: lv_attr
|
|
103
|
+
:type_hint: String
|
|
104
|
+
:description: Various attributes - see man page.
|
|
105
|
+
- :method: check_needed
|
|
106
|
+
:column: lv_check_needed
|
|
107
|
+
:type_hint: String
|
|
108
|
+
:description: For thin pools and cache volumes
|
|
109
|
+
- :method: converting
|
|
110
|
+
:column: lv_converting
|
|
111
|
+
:type_hint: String
|
|
112
|
+
:description: Set if LV is being converted.
|
|
113
|
+
- :method: descendants
|
|
114
|
+
:column: lv_descendants
|
|
115
|
+
:type_hint: String
|
|
116
|
+
:description: LV descendants ignoring any stored history of the ancestry chain.
|
|
117
|
+
- :method: dm_path
|
|
118
|
+
:column: lv_dm_path
|
|
119
|
+
:type_hint: String
|
|
120
|
+
:description: Internal device-mapper pathname for LV (in /dev/mapper directory).
|
|
121
|
+
- :method: fixed_minor
|
|
122
|
+
:column: lv_fixed_minor
|
|
123
|
+
:type_hint: String
|
|
124
|
+
:description: Set if LV has fixed minor number assigned.
|
|
125
|
+
- :method: full_ancestors
|
|
126
|
+
:column: lv_full_ancestors
|
|
127
|
+
:type_hint: String
|
|
128
|
+
:description: LV ancestors including stored history of the ancestry chain.
|
|
129
|
+
- :method: full_descendants
|
|
130
|
+
:column: lv_full_descendants
|
|
131
|
+
:type_hint: String
|
|
132
|
+
:description: LV descendants including stored history of the ancestry chain.
|
|
133
|
+
- :method: full_name
|
|
134
|
+
:column: lv_full_name
|
|
135
|
+
:type_hint: String
|
|
136
|
+
:description: Full name of LV including its VG
|
|
137
|
+
- :method: health_status
|
|
138
|
+
:column: lv_health_status
|
|
139
|
+
:type_hint: String
|
|
140
|
+
:description: LV health status.
|
|
141
|
+
- :method: historical
|
|
142
|
+
:column: lv_historical
|
|
143
|
+
:type_hint: String
|
|
144
|
+
:description: Set if the LV is historical.
|
|
145
|
+
- :method: host
|
|
146
|
+
:column: lv_host
|
|
147
|
+
:type_hint: String
|
|
148
|
+
:description: Creation host of the LV
|
|
149
|
+
- :method: image_synced
|
|
150
|
+
:column: lv_image_synced
|
|
151
|
+
:type_hint: String
|
|
152
|
+
:description: Set if mirror/RAID image is synchronized.
|
|
153
|
+
- :method: initial_image_sync
|
|
154
|
+
:column: lv_initial_image_sync
|
|
155
|
+
:type_hint: String
|
|
156
|
+
:description: Set if mirror/RAID images underwent initial resynchronization.
|
|
157
|
+
- :method: layout
|
|
158
|
+
:column: lv_layout
|
|
159
|
+
:type_hint: String
|
|
160
|
+
:description: LV layout.
|
|
161
|
+
- :method: lockargs
|
|
162
|
+
:column: lv_lockargs
|
|
163
|
+
:type_hint: String
|
|
164
|
+
:description: Lock args of the LV used by lvmlockd.
|
|
165
|
+
- :method: major
|
|
166
|
+
:column: lv_major
|
|
167
|
+
:type_hint: String
|
|
168
|
+
:description: Persistent major number or -1 if not persistent.
|
|
169
|
+
- :method: merge_failed
|
|
170
|
+
:column: lv_merge_failed
|
|
171
|
+
:type_hint: String
|
|
172
|
+
:description: Set if snapshot merge failed.
|
|
173
|
+
- :method: merging
|
|
174
|
+
:column: lv_merging
|
|
175
|
+
:type_hint: String
|
|
176
|
+
:description: Set if snapshot LV is being merged to origin.
|
|
177
|
+
- :method: metadata_size
|
|
178
|
+
:column: lv_metadata_size
|
|
179
|
+
:type_hint: Integer
|
|
180
|
+
:description: For thin and cache pools
|
|
181
|
+
- :method: minor
|
|
182
|
+
:column: lv_minor
|
|
183
|
+
:type_hint: String
|
|
184
|
+
:description: Persistent minor number or -1 if not persistent.
|
|
185
|
+
- :method: modules
|
|
186
|
+
:column: lv_modules
|
|
187
|
+
:type_hint: String
|
|
188
|
+
:description: Kernel device-mapper modules required for this LV.
|
|
189
|
+
- :method: name
|
|
190
|
+
:column: lv_name
|
|
191
|
+
:type_hint: String
|
|
192
|
+
:description: Name. LVs created for internal use are enclosed in brackets.
|
|
193
|
+
- :method: parent
|
|
194
|
+
:column: lv_parent
|
|
195
|
+
:type_hint: String
|
|
196
|
+
:description: For LVs that are components of another LV
|
|
197
|
+
- :method: path
|
|
198
|
+
:column: lv_path
|
|
199
|
+
:type_hint: String
|
|
200
|
+
:description: Full pathname for LV. Blank for internal LVs.
|
|
201
|
+
- :method: profile
|
|
202
|
+
:column: lv_profile
|
|
203
|
+
:type_hint: String
|
|
204
|
+
:description: Configuration profile attached to this LV.
|
|
205
|
+
- :method: read_ahead
|
|
206
|
+
:column: lv_read_ahead
|
|
207
|
+
:type_hint: String
|
|
208
|
+
:description: Read ahead setting in current units.
|
|
209
|
+
- :method: role
|
|
210
|
+
:column: lv_role
|
|
211
|
+
:type_hint: String
|
|
212
|
+
:description: LV role.
|
|
213
|
+
- :method: size
|
|
214
|
+
:column: lv_size
|
|
215
|
+
:type_hint: Integer
|
|
216
|
+
:description: Size of LV in current units.
|
|
217
|
+
- :method: skip_activation
|
|
218
|
+
:column: lv_skip_activation
|
|
219
|
+
:type_hint: String
|
|
220
|
+
:description: Set if LV is skipped on activation.
|
|
221
|
+
- :method: snapshot_invalid
|
|
222
|
+
:column: lv_snapshot_invalid
|
|
223
|
+
:type_hint: String
|
|
224
|
+
:description: Set if snapshot LV is invalid.
|
|
225
|
+
- :method: tags
|
|
226
|
+
:column: lv_tags
|
|
227
|
+
:type_hint: String
|
|
228
|
+
:description: Tags
|
|
229
|
+
- :method: time
|
|
230
|
+
:column: lv_time
|
|
231
|
+
:type_hint: String
|
|
232
|
+
:description: Creation time of the LV
|
|
233
|
+
- :method: time_removed
|
|
234
|
+
:column: lv_time_removed
|
|
235
|
+
:type_hint: String
|
|
236
|
+
:description: Removal time of the LV
|
|
237
|
+
- :method: uuid
|
|
238
|
+
:column: lv_uuid
|
|
239
|
+
:type_hint: String
|
|
240
|
+
:description: Unique identifier.
|
|
241
|
+
- :method: when_full
|
|
242
|
+
:column: lv_when_full
|
|
243
|
+
:type_hint: String
|
|
244
|
+
:description: For thin pools
|
|
245
|
+
- :method: metadata_lv
|
|
246
|
+
:column: metadata_lv
|
|
247
|
+
:type_hint: String
|
|
248
|
+
:description: For thin and cache pools
|
|
249
|
+
- :method: metadata_lv_uuid
|
|
250
|
+
:column: metadata_lv_uuid
|
|
251
|
+
:type_hint: String
|
|
252
|
+
:description: For thin and cache pools
|
|
253
|
+
- :method: metadata_percent
|
|
254
|
+
:column: metadata_percent
|
|
255
|
+
:type_hint: String
|
|
256
|
+
:description: For cache and thin pools
|
|
257
|
+
- :method: mirror_log
|
|
258
|
+
:column: mirror_log
|
|
259
|
+
:type_hint: String
|
|
260
|
+
:description: For mirrors
|
|
261
|
+
- :method: mirror_log_uuid
|
|
262
|
+
:column: mirror_log_uuid
|
|
263
|
+
:type_hint: String
|
|
264
|
+
:description: For mirrors
|
|
265
|
+
- :method: move_pv
|
|
266
|
+
:column: move_pv
|
|
267
|
+
:type_hint: String
|
|
268
|
+
:description: For pvmove
|
|
269
|
+
- :method: move_pv_uuid
|
|
270
|
+
:column: move_pv_uuid
|
|
271
|
+
:type_hint: String
|
|
272
|
+
:description: For pvmove
|
|
273
|
+
- :method: origin
|
|
274
|
+
:column: origin
|
|
275
|
+
:type_hint: String
|
|
276
|
+
:description: For snapshots and thins
|
|
277
|
+
- :method: origin_size
|
|
278
|
+
:column: origin_size
|
|
279
|
+
:type_hint: Integer
|
|
280
|
+
:description: For snapshots
|
|
281
|
+
- :method: origin_uuid
|
|
282
|
+
:column: origin_uuid
|
|
283
|
+
:type_hint: String
|
|
284
|
+
:description: For snapshots and thins
|
|
285
|
+
- :method: pool_lv
|
|
286
|
+
:column: pool_lv
|
|
287
|
+
:type_hint: String
|
|
288
|
+
:description: For thin volumes
|
|
289
|
+
- :method: pool_lv_uuid
|
|
290
|
+
:column: pool_lv_uuid
|
|
291
|
+
:type_hint: String
|
|
292
|
+
:description: For thin volumes
|
|
293
|
+
- :method: raid_max_recovery_rate
|
|
294
|
+
:column: raid_max_recovery_rate
|
|
295
|
+
:type_hint: Integer
|
|
296
|
+
:description: For RAID1
|
|
297
|
+
- :method: raid_min_recovery_rate
|
|
298
|
+
:column: raid_min_recovery_rate
|
|
299
|
+
:type_hint: Integer
|
|
300
|
+
:description: For RAID1
|
|
301
|
+
- :method: raid_mismatch_count
|
|
302
|
+
:column: raid_mismatch_count
|
|
303
|
+
:type_hint: Integer
|
|
304
|
+
:description: For RAID
|
|
305
|
+
- :method: raid_sync_action
|
|
306
|
+
:column: raid_sync_action
|
|
307
|
+
:type_hint: String
|
|
308
|
+
:description: For RAID
|
|
309
|
+
- :method: raid_write_behind
|
|
310
|
+
:column: raid_write_behind
|
|
311
|
+
:type_hint: Integer
|
|
312
|
+
:description: For RAID1
|
|
313
|
+
- :method: seg_count
|
|
314
|
+
:column: seg_count
|
|
315
|
+
:type_hint: Integer
|
|
316
|
+
:description: Number of segments in LV.
|
|
317
|
+
- :method: snap_percent
|
|
318
|
+
:column: snap_percent
|
|
319
|
+
:type_hint: String
|
|
320
|
+
:description: For snapshots
|
|
321
|
+
- :method: sync_percent
|
|
322
|
+
:column: sync_percent
|
|
323
|
+
:type_hint: String
|
|
324
|
+
:description: For Cache
|
|
325
|
+
- :method: vg_uuid
|
|
326
|
+
:column: vg_uuid
|
|
327
|
+
:type_hint: String
|
|
328
|
+
:description: For VolumeGroup to LogicalVolume relationship.
|