all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage 1/3] volume export/import: allow uppercase letters
@ 2021-04-12 11:37 Fabian Ebner
  2021-04-12 11:37 ` [pve-devel] [PATCH guest-common 2/3] partially fix 3111: snapshot rollback: fix removing replication snapshots Fabian Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabian Ebner @ 2021-04-12 11:37 UTC (permalink / raw)
  To: pve-devel

Bug reported in the community forum[0].

Currently, it's possible to break replication by:
1. have an existing snapshot whose name contains an uppercase letter
2. set up a replication job and run it
3. rollback to the existing snapshot
4. replicate again -> fails

The failure occurs, because after step 3, the most recent common snapshot is the
previously existing one and currently no uppercase letters are allowed for
export/import.

The pve-snapshot-name option uses the CONFIGID_RE
    qr/[a-z][a-z0-9_-]+/i
so it cannot be used here, because it would not allow for e.g. '__migrate__'.
Simply allow uppercase letters, to be backwards compatible and allow all
possible pve-snapshot-name values.

There is still an issue if there also was state volume, but that's a different
bug[1].

[0]: https://forum.proxmox.com/threads/solved-migration-error-base-value-does-not-match-the-regex-pattern.85946/
[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=3111

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/CLI/pvesm.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/CLI/pvesm.pm b/PVE/CLI/pvesm.pm
index 3594774..7b46897 100755
--- a/PVE/CLI/pvesm.pm
+++ b/PVE/CLI/pvesm.pm
@@ -244,14 +244,14 @@ __PACKAGE__->register_method ({
 	    base => {
 		description => "Snapshot to start an incremental stream from",
 		type => 'string',
-		pattern => qr/[a-z0-9_\-]{1,40}/,
+		pattern => qr/[a-z0-9_\-]{1,40}/i,
 		maxLength => 40,
 		optional => 1,
 	    },
 	    snapshot => {
 		description => "Snapshot to export",
 		type => 'string',
-		pattern => qr/[a-z0-9_\-]{1,40}/,
+		pattern => qr/[a-z0-9_\-]{1,40}/i,
 		maxLength => 40,
 		optional => 1,
 	    },
@@ -321,7 +321,7 @@ __PACKAGE__->register_method ({
 	    base => {
 		description => "Base snapshot of an incremental stream",
 		type => 'string',
-		pattern => qr/[a-z0-9_\-]{1,40}/,
+		pattern => qr/[a-z0-9_\-]{1,40}/i,
 		maxLength => 40,
 		optional => 1,
 	    },
@@ -335,7 +335,7 @@ __PACKAGE__->register_method ({
 	    'delete-snapshot' => {
 		description => "A snapshot to delete on success",
 		type => 'string',
-		pattern => qr/[a-z0-9_\-]{1,80}/,
+		pattern => qr/[a-z0-9_\-]{1,80}/i,
 		maxLength => 80,
 		optional => 1,
 	    },
-- 
2.20.1





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

end of thread, other threads:[~2021-04-12 12:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12 11:37 [pve-devel] [PATCH storage 1/3] volume export/import: allow uppercase letters Fabian Ebner
2021-04-12 11:37 ` [pve-devel] [PATCH guest-common 2/3] partially fix 3111: snapshot rollback: fix removing replication snapshots Fabian Ebner
2021-04-12 11:37 ` [pve-devel] [RFC guest-common 3/3] fix 3111: replicate guest on rollback if there are replication jobs for it Fabian Ebner
2021-04-12 12:54 ` [pve-devel] applied: [PATCH storage 1/3] volume export/import: allow uppercase letters Thomas Lamprecht

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