public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage v2] esxi: detect correct os type in 'other' family
@ 2024-03-21  9:07 Gabriel Goller
  2024-03-22 10:30 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Goller @ 2024-03-21  9:07 UTC (permalink / raw)
  To: pve-devel

This patch introduces the conversion table for all possible OS Types
that are in the VMWare 'other' family and sets the pve counterpart.
Our default OS Type is 'linux', so including mappings to 'other' makes
sense.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---

v2, thanks @sterzy:
 - removed perltidy output

 src/PVE/Storage/ESXiPlugin.pm | 43 +++++++++++++++++++++++++++++++----
 1 file changed, 39 insertions(+), 4 deletions(-)

diff --git a/src/PVE/Storage/ESXiPlugin.pm b/src/PVE/Storage/ESXiPlugin.pm
index b36cea8..6e80caa 100644
--- a/src/PVE/Storage/ESXiPlugin.pm
+++ b/src/PVE/Storage/ESXiPlugin.pm
@@ -849,7 +849,7 @@ sub is_windows {
     return;
 }
 
-my %guest_types = (
+my %guest_types_windows = (
     dos                     => 'other',
     winNetBusiness          => 'w2k3',
     windows9                => 'win10',
@@ -888,14 +888,49 @@ my %guest_types = (
     'winXPPro-64'           => 'wxp',
 );
 
+my %guest_types_other = (
+    'freeBSD11'    => 'other',
+    'freeBSD11-64' => 'other',
+    'freeBSD12'    => 'other',
+    'freeBSD12-64' => 'other',
+    'freeBSD13'    => 'other',
+    'freeBSD13-64' => 'other',
+    'freeBSD14'    => 'other',
+    'freeBSD14-64' => 'other',
+    'freeBSD'      => 'other',
+    'freeBSD-64'   => 'other',
+    'os2'          => 'other',
+    'netware5'     => 'other',
+    'netware6'     => 'other',
+    'solaris10'    => 'solaris',
+    'solaris10-64' => 'solaris',
+    'solaris11-64' => 'solaris',
+    'other'        => 'other',
+    'other-64'     => 'other',
+    'openserver5'  => 'other',
+    'openserver6'  => 'other',
+    'unixware7'    => 'other',
+    'eComStation'  => 'other',
+    'eComStation2' => 'other',
+    'solaris8'     => 'solaris',
+    'solaris9'     => 'solaris',
+    'vmkernel'     => 'other',
+    'vmkernel5'    => 'other',
+    'vmkernel6'    => 'other',
+    'vmkernel65'   => 'other',
+    'vmkernel7'    => 'other',
+    'vmkernel8'    => 'other',
+);
+
 # Best effort translation from vmware guest os type to pve.
 # Returns a tuple: `(pve-type, is_windows)`
 sub guest_type {
     my ($self) = @_;
-
     if (defined(my $guest = $self->{guestOS})) {
-	if (defined(my $known = $guest_types{$guest})) {
-	    return ($known, 1);
+	if (defined(my $known_windows = $guest_types_windows{$guest})) {
+	    return ($known_windows, 1);
+	} elsif (defined(my $known_other = $guest_types_other{$guest})) {
+	    return ($known_other, 0);
 	}
 	# This covers all the 'Mac OS' types AFAICT
 	return ('other', 0) if $guest =~ /^darwin/;
-- 
2.43.0





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

end of thread, other threads:[~2024-03-22 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-21  9:07 [pve-devel] [PATCH storage v2] esxi: detect correct os type in 'other' family Gabriel Goller
2024-03-22 10:30 ` [pve-devel] applied: " 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