public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 0/3] osd details: add created_at & created_version
@ 2023-05-05 13:11 Aaron Lauterer
  2023-05-05 13:11 ` [pve-devel] [PATCH manager 1/3] api: osd: details: add created_at and created_version Aaron Lauterer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Aaron Lauterer @ 2023-05-05 13:11 UTC (permalink / raw)
  To: pve-devel

OSDs created with ceph version 17.2.6 store these additional properties.

These patches will make it possible to also show them in the OSD Details
window.

No hurry, but once we make 17.2.6 available, this could be a nice
addition.

Aaron Lauterer (3):
  api: osd: details: add created_at and created_version
  ui: osd: details: add created_at and created_version
  ui: osd: details: move hostname to top

 PVE/API2/Ceph/OSD.pm            | 12 ++++++++++++
 www/manager6/ceph/OSDDetails.js | 25 +++++++++++++++++++++++--
 2 files changed, 35 insertions(+), 2 deletions(-)

-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH manager 1/3] api: osd: details: add created_at and created_version
  2023-05-05 13:11 [pve-devel] [PATCH manager 0/3] osd details: add created_at & created_version Aaron Lauterer
@ 2023-05-05 13:11 ` Aaron Lauterer
  2023-05-05 13:11 ` [pve-devel] [PATCH manager 2/3] ui: " Aaron Lauterer
  2023-05-05 13:11 ` [pve-devel] [PATCH manager 3/3] ui: osd: details: move hostname to top Aaron Lauterer
  2 siblings, 0 replies; 4+ messages in thread
From: Aaron Lauterer @ 2023-05-05 13:11 UTC (permalink / raw)
  To: pve-devel

OSDs created with Ceph version 17.2.6 or newer will store the date and
time they were created at, as well as the version at the time.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 PVE/API2/Ceph/OSD.pm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/PVE/API2/Ceph/OSD.pm b/PVE/API2/Ceph/OSD.pm
index ded35990..0222042b 100644
--- a/PVE/API2/Ceph/OSD.pm
+++ b/PVE/API2/Ceph/OSD.pm
@@ -645,6 +645,16 @@ __PACKAGE__->register_method ({
 			type => 'string',
 			description => 'Ceph version of the OSD service.',
 		    },
+		    version_when_created => {
+			type => 'string',
+			description => 'Ceph version of the OSD service when created. '.
+			    '(available since Ceph 17.2.6)',
+		    },
+		    created_at => {
+			type => 'string',
+			description => 'Date and time when the OSD was created. '.
+			    '(available since Ceph 17.2.6)',
+		    },
 		    front_addr => {
 			type => 'string',
 			description => 'Address and port used to talk to clients and monitors.',
@@ -718,6 +728,8 @@ __PACKAGE__->register_method ({
 		osd_objectstore => $metadata->{osd_objectstore},
 		pid => $pid,
 		version => "$metadata->{ceph_version_short} ($metadata->{ceph_release})",
+		version_when_created => "$metadata->{ceph_version_when_created}",
+		created_at => "$metadata->{created_at}",
 		front_addr => $metadata->{front_addr},
 		back_addr => $metadata->{back_addr},
 		hb_front_addr => $metadata->{hb_front_addr},
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH manager 2/3] ui: osd: details: add created_at and created_version
  2023-05-05 13:11 [pve-devel] [PATCH manager 0/3] osd details: add created_at & created_version Aaron Lauterer
  2023-05-05 13:11 ` [pve-devel] [PATCH manager 1/3] api: osd: details: add created_at and created_version Aaron Lauterer
@ 2023-05-05 13:11 ` Aaron Lauterer
  2023-05-05 13:11 ` [pve-devel] [PATCH manager 3/3] ui: osd: details: move hostname to top Aaron Lauterer
  2 siblings, 0 replies; 4+ messages in thread
From: Aaron Lauterer @ 2023-05-05 13:11 UTC (permalink / raw)
  To: pve-devel

Useful for OSDs created with at least Ceph version 17.2.6. For OSDs
created prior to that, we show "n/a".

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 www/manager6/ceph/OSDDetails.js | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/www/manager6/ceph/OSDDetails.js b/www/manager6/ceph/OSDDetails.js
index f0765d4f..43cf72d0 100644
--- a/www/manager6/ceph/OSDDetails.js
+++ b/www/manager6/ceph/OSDDetails.js
@@ -130,11 +130,32 @@ Ext.define('PVE.CephOsdDetails', {
 				    name: 'version',
 				    text: gettext('Version'),
 				},
+				{
+				    xtype: 'text',
+				    name: 'version_when_created',
+				    text: gettext('Version (created)'),
+				    renderer: function(value) {
+					// expects the following string format:
+					// ceph version 17.2.6 (995dec2cdae920da21db2d455e55efbc339bde24) quincy (stable)
+					if (value) {
+					    value = value.trim();
+					    let parts = value.split(' ');
+					    return `${parts[2]} (${parts[4]})`;
+					}
+					return gettext('n/a');
+				    },
+				},
 				{
 				    xtype: 'text',
 				    name: 'hostname',
 				    text: gettext('Hostname'),
 				},
+				{
+				    xtype: 'text',
+				    name: 'created_at',
+				    text: gettext('Creation time'),
+				    renderer: (v) => v ? Date(v).toLocaleString() : gettext('n/a'),
+				},
 				{
 				    xtype: 'text',
 				    name: 'osd_data',
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH manager 3/3] ui: osd: details: move hostname to top
  2023-05-05 13:11 [pve-devel] [PATCH manager 0/3] osd details: add created_at & created_version Aaron Lauterer
  2023-05-05 13:11 ` [pve-devel] [PATCH manager 1/3] api: osd: details: add created_at and created_version Aaron Lauterer
  2023-05-05 13:11 ` [pve-devel] [PATCH manager 2/3] ui: " Aaron Lauterer
@ 2023-05-05 13:11 ` Aaron Lauterer
  2 siblings, 0 replies; 4+ messages in thread
From: Aaron Lauterer @ 2023-05-05 13:11 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 www/manager6/ceph/OSDDetails.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/www/manager6/ceph/OSDDetails.js b/www/manager6/ceph/OSDDetails.js
index 43cf72d0..3251b40d 100644
--- a/www/manager6/ceph/OSDDetails.js
+++ b/www/manager6/ceph/OSDDetails.js
@@ -125,6 +125,11 @@ Ext.define('PVE.CephOsdDetails', {
 				enableTextSelection: true,
 			    },
 			    gridRows: [
+				{
+				    xtype: 'text',
+				    name: 'hostname',
+				    text: gettext('Hostname'),
+				},
 				{
 				    xtype: 'text',
 				    name: 'version',
@@ -145,11 +150,6 @@ Ext.define('PVE.CephOsdDetails', {
 					return gettext('n/a');
 				    },
 				},
-				{
-				    xtype: 'text',
-				    name: 'hostname',
-				    text: gettext('Hostname'),
-				},
 				{
 				    xtype: 'text',
 				    name: 'created_at',
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-05 13:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-05 13:11 [pve-devel] [PATCH manager 0/3] osd details: add created_at & created_version Aaron Lauterer
2023-05-05 13:11 ` [pve-devel] [PATCH manager 1/3] api: osd: details: add created_at and created_version Aaron Lauterer
2023-05-05 13:11 ` [pve-devel] [PATCH manager 2/3] ui: " Aaron Lauterer
2023-05-05 13:11 ` [pve-devel] [PATCH manager 3/3] ui: osd: details: move hostname to top Aaron Lauterer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal