Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
0c7ba3e3
Commit
0c7ba3e3
authored
Jan 23, 2014
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: display pool usage information
parent
252d499d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
3 deletions
+43
-3
Ceph.pm
PVE/API2/Ceph.pm
+17
-1
pveceph
bin/pveceph
+2
-2
Ceph.js
www/manager/node/Ceph.js
+24
-0
No files found.
PVE/API2/Ceph.pm
View file @
0c7ba3e3
...
...
@@ -1094,7 +1094,18 @@ __PACKAGE__->register_method ({
PVE::CephTools::
check_ceph_inited
();
my
$rados
=
PVE::
RADOS
->
new
();
my
$res
=
$rados
->
mon_command
({
prefix
=>
'
osd dump
'
});
my
$stats
=
{};
my
$res
=
$rados
->
mon_command
({
prefix
=>
'
df
'
});
my
$total
=
$res
->
{
stats
}
->
{
total_space
}
||
0
;
$total
=
$total
*
1024
;
foreach
my
$d
(
@
{
$res
->
{
pools
}})
{
next
if
!
$d
->
{
stats
};
next
if
!
defined
(
$d
->
{
id
});
$stats
->
{
$d
->
{
id
}}
=
$d
->
{
stats
};
}
$res
=
$rados
->
mon_command
({
prefix
=>
'
osd dump
'
});
my
$data
=
[]
;
foreach
my
$e
(
@
{
$res
->
{
pools
}})
{
...
...
@@ -1102,9 +1113,14 @@ __PACKAGE__->register_method ({
foreach
my
$attr
(
qw(pool pool_name size min_size pg_num crush_ruleset)
)
{
$d
->
{
$attr
}
=
$e
->
{
$attr
}
if
defined
(
$e
->
{
$attr
});
}
if
(
my
$s
=
$stats
->
{
$d
->
{
pool
}})
{
$d
->
{
bytes_used
}
=
$s
->
{
bytes_used
};
$d
->
{
percent_used
}
=
(
$d
->
{
bytes_used
}
*
100
)
/
$total
if
$total
;
}
push
@$data
,
$d
;
}
return
$data
;
}});
...
...
bin/pveceph
View file @
0c7ba3e3
...
...
@@ -117,9 +117,9 @@ my $cmddef = {
lspools
=>
[
'
PVE::API2::Ceph
',
'
lspools
',
[]
,
{
node
=>
$nodename
},
sub
{
my
$res
=
shift
;
printf
("
%-20s %10s %10s
\n
",
"
Name
",
"
size
",
"
pg_num
");
printf
("
%-20s %10s %10s
%20s
\n
",
"
Name
",
"
size
",
"
pg_num
",
"
used
");
foreach
my
$p
(
sort
{
$a
->
{
pool_name
}
cmp
$b
->
{
pool_name
}}
@$res
)
{
printf
("
%-20s %10d %10d
\n
",
$p
->
{
pool_name
},
$p
->
{
size
},
$p
->
{
pg_num
});
printf
("
%-20s %10d %10d
%20d
\n
",
$p
->
{
pool_name
},
$p
->
{
size
},
$p
->
{
pg_num
},
$p
->
{
bytes_used
});
}
}],
createpool
=>
[
'
PVE::API2::Ceph
',
'
createpool
',
['
name
'],
{
node
=>
$nodename
}],
...
...
www/manager/node/Ceph.js
View file @
0c7ba3e3
...
...
@@ -165,6 +165,28 @@ Ext.define('PVE.node.CephPoolList', {
width
:
50
,
sortable
:
false
,
dataIndex
:
'
crush_ruleset
'
},
{
header
:
gettext
(
'
Used
'
),
columns
:
[
{
xtype
:
'
numbercolumn
'
,
header
:
'
%
'
,
width
:
80
,
sortable
:
true
,
align
:
'
right
'
,
format
:
'
0.00
'
,
dataIndex
:
'
percent_used
'
},
{
header
:
gettext
(
'
Total
'
),
width
:
100
,
sortable
:
true
,
renderer
:
PVE
.
Utils
.
render_size
,
align
:
'
right
'
,
dataIndex
:
'
bytes_used
'
}
]
}
],
listeners
:
{
...
...
@@ -185,6 +207,8 @@ Ext.define('PVE.node.CephPoolList', {
{
name
:
'
size
'
,
type
:
'
integer
'
},
{
name
:
'
min_size
'
,
type
:
'
integer
'
},
{
name
:
'
pg_num
'
,
type
:
'
integer
'
},
{
name
:
'
bytes_used
'
,
type
:
'
integer
'
},
{
name
:
'
percent_used
'
,
type
:
'
number
'
},
{
name
:
'
crush_ruleset
'
,
type
:
'
integer
'
}
],
idProperty
:
'
pool_name
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment