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
92e4d5fc
Commit
92e4d5fc
authored
Jan 23, 2014
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: display osd usage
parent
0c7ba3e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
17 deletions
+71
-17
Ceph.pm
PVE/API2/Ceph.pm
+22
-0
Ceph.js
www/manager/node/Ceph.js
+49
-17
No files found.
PVE/API2/Ceph.pm
View file @
92e4d5fc
...
@@ -40,6 +40,20 @@ my $get_osd_status = sub {
...
@@ -40,6 +40,20 @@ my $get_osd_status = sub {
return
$osdstat
;
return
$osdstat
;
};
};
my
$get_osd_usage
=
sub
{
my
(
$rados
)
=
@_
;
my
$osdlist
=
$rados
->
mon_command
({
prefix
=>
'
pg dump
',
dumpcontents
=>
[
'
osds
'
]})
||
[]
;
my
$osdstat
;
foreach
my
$d
(
@$osdlist
)
{
$osdstat
->
{
$d
->
{
osd
}}
=
$d
if
defined
(
$d
->
{
osd
});
}
return
$osdstat
;
};
__PACKAGE__
->
register_method
({
__PACKAGE__
->
register_method
({
name
=>
'
index
',
name
=>
'
index
',
path
=>
'',
path
=>
'',
...
@@ -69,6 +83,8 @@ __PACKAGE__->register_method ({
...
@@ -69,6 +83,8 @@ __PACKAGE__->register_method ({
my
$osdhash
=
&
$get_osd_status
(
$rados
);
my
$osdhash
=
&
$get_osd_status
(
$rados
);
my
$usagehash
=
&
$get_osd_usage
(
$rados
);
my
$nodes
=
{};
my
$nodes
=
{};
my
$newnodes
=
{};
my
$newnodes
=
{};
foreach
my
$e
(
@
{
$res
->
{
nodes
}})
{
foreach
my
$e
(
@
{
$res
->
{
nodes
}})
{
...
@@ -88,6 +104,12 @@ __PACKAGE__->register_method ({
...
@@ -88,6 +104,12 @@ __PACKAGE__->register_method ({
$new
->
{
in
}
=
$stat
->
{
in
}
if
defined
(
$stat
->
{
in
});
$new
->
{
in
}
=
$stat
->
{
in
}
if
defined
(
$stat
->
{
in
});
}
}
if
(
my
$stat
=
$usagehash
->
{
$e
->
{
id
}})
{
$new
->
{
total_space
}
=
(
$stat
->
{
kb
}
||
1
)
*
1024
;
$new
->
{
bytes_used
}
=
(
$stat
->
{
kb_used
}
||
0
)
*
1024
;
$new
->
{
percent_used
}
=
(
$new
->
{
bytes_used
}
*
100
)
/
$new
->
{
total_space
};
}
$newnodes
->
{
$e
->
{
id
}}
=
$new
;
$newnodes
->
{
$e
->
{
id
}}
=
$new
;
}
}
...
...
www/manager/node/Ceph.js
View file @
92e4d5fc
...
@@ -170,12 +170,11 @@ Ext.define('PVE.node.CephPoolList', {
...
@@ -170,12 +170,11 @@ Ext.define('PVE.node.CephPoolList', {
header
:
gettext
(
'
Used
'
),
header
:
gettext
(
'
Used
'
),
columns
:
[
columns
:
[
{
{
xtype
:
'
numbercolumn
'
,
header
:
'
%
'
,
header
:
'
%
'
,
width
:
80
,
width
:
80
,
sortable
:
true
,
sortable
:
true
,
align
:
'
right
'
,
align
:
'
right
'
,
format
:
'
0.00
'
,
renderer
:
Ext
.
util
.
Format
.
numberRenderer
(
'
0.00
'
)
,
dataIndex
:
'
percent_used
'
dataIndex
:
'
percent_used
'
},
},
{
{
...
@@ -446,6 +445,9 @@ Ext.define('PVE.node.CephOsdTree', {
...
@@ -446,6 +445,9 @@ Ext.define('PVE.node.CephOsdTree', {
fields
:
[
'
name
'
,
'
type
'
,
'
status
'
,
'
host
'
,
'
in
'
,
fields
:
[
'
name
'
,
'
type
'
,
'
status
'
,
'
host
'
,
'
in
'
,
{
type
:
'
integer
'
,
name
:
'
id
'
},
{
type
:
'
integer
'
,
name
:
'
id
'
},
{
type
:
'
number
'
,
name
:
'
reweight
'
},
{
type
:
'
number
'
,
name
:
'
reweight
'
},
{
type
:
'
number
'
,
name
:
'
percent_used
'
},
{
type
:
'
integer
'
,
name
:
'
bytes_used
'
},
{
type
:
'
integer
'
,
name
:
'
total_space
'
},
{
type
:
'
number
'
,
name
:
'
crush_weight
'
}],
{
type
:
'
number
'
,
name
:
'
crush_weight
'
}],
stateful
:
false
,
stateful
:
false
,
selModel
:
sm
,
selModel
:
sm
,
...
@@ -454,25 +456,13 @@ Ext.define('PVE.node.CephOsdTree', {
...
@@ -454,25 +456,13 @@ Ext.define('PVE.node.CephOsdTree', {
xtype
:
'
treecolumn
'
,
xtype
:
'
treecolumn
'
,
text
:
'
Name
'
,
text
:
'
Name
'
,
dataIndex
:
'
name
'
,
dataIndex
:
'
name
'
,
width
:
200
width
:
150
},
{
text
:
'
ID
'
,
dataIndex
:
'
id
'
,
align
:
'
right
'
,
width
:
60
},
{
text
:
'
weight
'
,
dataIndex
:
'
crush_weight
'
,
align
:
'
right
'
,
width
:
60
},
},
{
{
text
:
'
Type
'
,
text
:
'
Type
'
,
dataIndex
:
'
type
'
,
dataIndex
:
'
type
'
,
align
:
'
right
'
,
align
:
'
right
'
,
width
:
10
0
width
:
6
0
},
},
{
{
text
:
'
Status
'
,
text
:
'
Status
'
,
...
@@ -485,13 +475,55 @@ Ext.define('PVE.node.CephOsdTree', {
...
@@ -485,13 +475,55 @@ Ext.define('PVE.node.CephOsdTree', {
var
data
=
rec
.
data
;
var
data
=
rec
.
data
;
return
value
+
'
/
'
+
(
data
[
'
in
'
]
?
'
in
'
:
'
out
'
);
return
value
+
'
/
'
+
(
data
[
'
in
'
]
?
'
in
'
:
'
out
'
);
},
},
width
:
100
width
:
60
},
{
text
:
'
weight
'
,
dataIndex
:
'
crush_weight
'
,
align
:
'
right
'
,
renderer
:
function
(
value
,
metaData
,
rec
)
{
if
(
rec
.
data
.
type
!==
'
osd
'
)
{
return
''
;
}
return
value
;
},
width
:
60
},
},
{
{
text
:
'
reweight
'
,
text
:
'
reweight
'
,
dataIndex
:
'
reweight
'
,
dataIndex
:
'
reweight
'
,
align
:
'
right
'
,
align
:
'
right
'
,
renderer
:
function
(
value
,
metaData
,
rec
)
{
if
(
rec
.
data
.
type
!==
'
osd
'
)
{
return
''
;
}
return
value
;
},
width
:
60
width
:
60
},
{
text
:
gettext
(
'
Size
'
),
dataIndex
:
'
total_space
'
,
align
:
'
right
'
,
renderer
:
function
(
value
,
metaData
,
rec
)
{
if
(
rec
.
data
.
type
!==
'
osd
'
)
{
return
''
;
}
return
PVE
.
Utils
.
render_size
(
value
);
},
width
:
100
},
{
text
:
gettext
(
'
Used
'
)
+
'
%
'
,
dataIndex
:
'
percent_used
'
,
align
:
'
right
'
,
renderer
:
function
(
value
,
metaData
,
rec
)
{
if
(
rec
.
data
.
type
!==
'
osd
'
)
{
return
''
;
}
return
Ext
.
util
.
Format
.
number
(
value
,
'
0.00
'
);
},
width
:
80
}
}
],
],
listeners
:
{
listeners
:
{
...
...
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