public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file
@ 2024-08-21 13:57 Daniel Kral
  2024-08-21 13:57 ` [pve-devel] [PATCH storage 1/2] esxi: fix #5587: add support for older version of vmx storage filepaths Daniel Kral
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Kral @ 2024-08-21 13:57 UTC (permalink / raw)
  To: pve-devel

Compatibility for an older naming convention of the "fileName" property
of mounted storage device images in vmx configuration files was
requested at [1].

Previously, it was only possible to import ESXi VMs, where the mentioned
property name was camelcased (e.g. "scsi0:0.fileName"). This patch
allows this property name to also be flatcased for compatibility with
older vmx versions (e.g. "scsi0:0.filename").

===

I could reproduce the issue by creating an ESXi VM in ESXi 8.0.2 with
the dialog and _manually_ renaming the property name to "filename". This
caused the disk to not show up in PVE's Import Guest wizard.

I could not reproduce the flatcased property name mentioned above by
using the VMWare creation dialog alone, even when I tried to create a
ESXi 4.x-compatible .vmx file (the oldest option available in VMvisor
ESXi 8.0).

===

I tested the patch on two different PVE nodes (1 patched & 1 unpatched):

1. Creating two different ESXi VMs (Debian 6 and 12),
2. I imported them with the camelcased "fileName" successfully.
3. I changed the property name to "filename" in the vmx config files for
   both ESXi VMs and imported them on the patched PVE node successfully
   and could not import the disk image on the unpatched PVE node.
4. pve-storage passed all previous tests.

[1] https://bugzilla.proxmox.com/show_bug.cgi?id=5587

storage:

Daniel Kral (1):
  esxi: fix #5587: add support for older version of vmx storage
    filepaths

 src/PVE/Storage/ESXiPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

esxi-import-tools:

Daniel Kral (1):
  fix #5587: add support for older version of vmx storage filepaths

 src/vmx.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.39.2



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


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

* [pve-devel] [PATCH storage 1/2] esxi: fix #5587: add support for older version of vmx storage filepaths
  2024-08-21 13:57 [pve-devel] [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file Daniel Kral
@ 2024-08-21 13:57 ` Daniel Kral
  2024-08-21 13:57 ` [pve-devel] [PATCH esxi-import-tools 2/2] " Daniel Kral
  2024-09-06 15:36 ` [pve-devel] applied-series: [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Kral @ 2024-08-21 13:57 UTC (permalink / raw)
  To: pve-devel

Allow the ESXi storage disk entry property "fileName" to be flatcased
("filename") in addition to being camelcased ("fileName"). This adds
compatibility with older ESXi .vmx configuration files.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
 src/PVE/Storage/ESXiPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Storage/ESXiPlugin.pm b/src/PVE/Storage/ESXiPlugin.pm
index a35693d..e99b54c 100644
--- a/src/PVE/Storage/ESXiPlugin.pm
+++ b/src/PVE/Storage/ESXiPlugin.pm
@@ -754,7 +754,7 @@ sub manifest { $_[0]->{'pve.manifest'} }
 # (Also used for the fileName config key...)
 sub is_disk_entry : prototype($) {
     my ($id) = @_;
-    if ($id =~ /^(scsi|ide|sata|nvme)(\d+:\d+)(:?\.fileName)?$/) {
+    if ($id =~ /^(scsi|ide|sata|nvme)(\d+:\d+)(:?\.file[nN]ame)?$/) {
 	return ($1, $2);
     }
     return;
-- 
2.39.2



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


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

* [pve-devel] [PATCH esxi-import-tools 2/2] fix #5587: add support for older version of vmx storage filepaths
  2024-08-21 13:57 [pve-devel] [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file Daniel Kral
  2024-08-21 13:57 ` [pve-devel] [PATCH storage 1/2] esxi: fix #5587: add support for older version of vmx storage filepaths Daniel Kral
@ 2024-08-21 13:57 ` Daniel Kral
  2024-09-06 15:36 ` [pve-devel] applied-series: [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Kral @ 2024-08-21 13:57 UTC (permalink / raw)
  To: pve-devel

Allow the ESXi storage disk entry property "fileName" to be flatcased
("filename") in addition to being camelcased ("fileName"). This adds
compatibility with older ESXi .vmx configuration files.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
 src/vmx.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vmx.rs b/src/vmx.rs
index 31cd52d..e1fa45b 100644
--- a/src/vmx.rs
+++ b/src/vmx.rs
@@ -6,7 +6,7 @@ use regex::Regex;
 use tokio::io::AsyncRead;
 
 static DISK_RE: Lazy<Regex> = Lazy::new(|| {
-    Regex::new(r#"^((?:scsi|ide|sata|nvme)\d+:\d+)\.fileName$"#)
+    Regex::new(r#"^((?:scsi|ide|sata|nvme)\d+:\d+)\.file[nN]ame$"#)
         .expect("failed to create disk key regex")
 });
 
-- 
2.39.2



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


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

* [pve-devel] applied-series: [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file
  2024-08-21 13:57 [pve-devel] [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file Daniel Kral
  2024-08-21 13:57 ` [pve-devel] [PATCH storage 1/2] esxi: fix #5587: add support for older version of vmx storage filepaths Daniel Kral
  2024-08-21 13:57 ` [pve-devel] [PATCH esxi-import-tools 2/2] " Daniel Kral
@ 2024-09-06 15:36 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2024-09-06 15:36 UTC (permalink / raw)
  To: Proxmox VE development discussion, Daniel Kral

Am 21/08/2024 um 15:57 schrieb Daniel Kral:
> Compatibility for an older naming convention of the "fileName" property
> of mounted storage device images in vmx configuration files was
> requested at [1].
> 
> Previously, it was only possible to import ESXi VMs, where the mentioned
> property name was camelcased (e.g. "scsi0:0.fileName"). This patch
> allows this property name to also be flatcased for compatibility with
> older vmx versions (e.g. "scsi0:0.filename").
> 
> ===
> 
> I could reproduce the issue by creating an ESXi VM in ESXi 8.0.2 with
> the dialog and _manually_ renaming the property name to "filename". This
> caused the disk to not show up in PVE's Import Guest wizard.
> 
> I could not reproduce the flatcased property name mentioned above by
> using the VMWare creation dialog alone, even when I tried to create a
> ESXi 4.x-compatible .vmx file (the oldest option available in VMvisor
> ESXi 8.0).

such information part can be fine to have in the commit message too, but
no biggie, especially as you referenced the bug report where the info is
present.

> 
> ===
> 
> I tested the patch on two different PVE nodes (1 patched & 1 unpatched):
> 
> 1. Creating two different ESXi VMs (Debian 6 and 12),
> 2. I imported them with the camelcased "fileName" successfully.
> 3. I changed the property name to "filename" in the vmx config files for
>    both ESXi VMs and imported them on the patched PVE node successfully
>    and could not import the disk image on the unpatched PVE node.
> 4. pve-storage passed all previous tests.
> 
> [1] https://bugzilla.proxmox.com/show_bug.cgi?id=5587
> 
> storage:
> 
> Daniel Kral (1):
>   esxi: fix #5587: add support for older version of vmx storage

I only noticed it now, but we normally prefix the `fix #ID` part always
at the very start.

Albeit I'm pondering over if it would be better to move the reference to
a bug in the commit message, which avoids having to decide between placing
the subsystem tag first or the fix reference.. anyhow I digress.

>     filepaths
> 
>  src/PVE/Storage/ESXiPlugin.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> esxi-import-tools:
> 
> Daniel Kral (1):
>   fix #5587: add support for older version of vmx storage filepaths
> 
>  src/vmx.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 


applied both patches, thanks!


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


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

end of thread, other threads:[~2024-09-06 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-21 13:57 [pve-devel] [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file Daniel Kral
2024-08-21 13:57 ` [pve-devel] [PATCH storage 1/2] esxi: fix #5587: add support for older version of vmx storage filepaths Daniel Kral
2024-08-21 13:57 ` [pve-devel] [PATCH esxi-import-tools 2/2] " Daniel Kral
2024-09-06 15:36 ` [pve-devel] applied-series: [PATCH storage/esxi-import-tools 0/2] fix #5587: compatibility for flatcased 'filename' property in vmx file Thomas Lamprecht

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