all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Demayl via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Demayl <denis.kanchev@storpool.com>
Subject: [pve-devel] [PATCH atomic snapshot 1/4] ui: snapshot: add atomic option
Date: Mon,  9 Jun 2025 10:32:09 +0300	[thread overview]
Message-ID: <mailman.304.1749454376.395.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20250609073214.7880-1-denis.kanchev@storpool.com>

[-- Attachment #1: Type: message/rfc822, Size: 7734 bytes --]

From: Demayl <denis.kanchev@storpool.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH atomic snapshot 1/4] ui: snapshot: add atomic option
Date: Mon,  9 Jun 2025 10:32:09 +0300
Message-ID: <20250609073214.7880-2-denis.kanchev@storpool.com>

Signed-off-by: Demayl <denis.kanchev@storpool.com>
---
 www/manager6/window/Snapshot.js | 43 +++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/www/manager6/window/Snapshot.js b/www/manager6/window/Snapshot.js
index 93ab61ec..902258b2 100644
--- a/www/manager6/window/Snapshot.js
+++ b/www/manager6/window/Snapshot.js
@@ -7,10 +7,14 @@ Ext.define('PVE.window.Snapshot', {
 	    isCreate: undefined,
 	    running: false,
 	    guestAgentEnabled: false,
+	    atomicPossible: false,
+	    atomicPreferred: false,
 	},
 	formulas: {
 	    runningWithoutGuestAgent: (get) => get('type') === 'qemu' && get('running') && !get('guestAgentEnabled'),
 	    shouldWarnAboutFS: (get) => get('isCreate') && get('runningWithoutGuestAgent') && get('!vmstate.checked'),
+	    atomicDisabled: (get) => !get('atomicPossible'),
+	    typeCheck: (get) => get('atomicPreferred') && get('atomicPossible') ? 'atomic' : 'sequential' ,
 	},
     },
 
@@ -55,6 +59,15 @@ Ext.define('PVE.window.Snapshot', {
 		    vm.set('guestAgentEnabled', !!PVE.Parser.parseBoolean(enabled.enabled));
 		},
 	    });
+	    Proxmox.Utils.API2Request({
+		url: `/nodes/${me.nodename}/${me.type}/${me.vmid}/status/current`,
+		method: 'GET',
+		success: function(response, options) {
+		    let snap = response.result.data.snapshots;
+		    vm.set('atomicPossible', !!PVE.Parser.parseBoolean(snap.atomic_possible.toString()));
+		    vm.set('atomicPreferred', !!PVE.Parser.parseBoolean(snap.atomic_preferred.toString()));
+		},
+	    });
 	}
 
 	me.items = [
@@ -85,6 +98,36 @@ Ext.define('PVE.window.Snapshot', {
 		checked: 1,
 		fieldLabel: gettext('Include RAM'),
 	    },
+	    {
+		xtype: 'radiogroup',
+		fieldLabel: gettext('Type'),
+		vertical: true,
+		hidden: !me.isCreate,
+		columns: 1,
+		reference: 'atomic',
+		items: [
+		    {
+			xtype: 'radiofield',
+			boxLabel: gettext('Sequential'),
+			name: 'type',
+			flex: 1,
+			inputValue: 'sequential',
+			bind: { value: '{typeCheck}' }
+		    },
+		    {
+			xtype: 'radiofield',
+			boxLabel: gettext('Atomic'),
+			name: 'type',
+			flex: 1,
+			inputValue: 'atomic',
+			disabled: true,
+			bind: {
+			    value: '{typeCheck}',
+			    disabled: '{atomicDisabled}',
+			}
+		    }
+		]
+	    },
 	    {
 		xtype: 'textareafield',
 		grow: true,
-- 
2.43.0



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

       reply	other threads:[~2025-06-09  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250609073214.7880-1-denis.kanchev@storpool.com>
2025-06-09  7:32 ` Demayl via pve-devel [this message]
2025-06-09  7:32 ` [pve-devel] [PATCH atomic_snapshot 2/4] snapshot api: add type option when making snapshots Demayl via pve-devel
2025-06-09  7:32 ` [pve-devel] [PATCH atomic snapshot 3/4] storage snapshot: add optional atomic snapshot creation in snapshot_create Demayl via pve-devel
2025-06-09  7:32 ` [pve-devel] [PATCH atomic snapshot 4/4] plugin: add optional atomic snapshot creation Demayl via pve-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.304.1749454376.395.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=denis.kanchev@storpool.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal