[pve-devel] [PATCH installer] show multiple disks in ack screen when zfs is used

Oguz Bektas o.bektas at proxmox.com
Thu Jan 10 11:54:08 CET 2019


Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 proxinstall | 51 ++++++++++++++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 21 deletions(-)

diff --git a/proxinstall b/proxinstall
index ae4d1fe..1dfe84c 100755
--- a/proxinstall
+++ b/proxinstall
@@ -2187,6 +2187,26 @@ sub create_ipconf_view {
     $hostentry->grab_focus();
 }
 
+my $get_raid_devlist = sub {
+
+    my $dev_name_hash = {};
+
+    my $devlist = [];
+    for (my $i = 0; $i < @$hds; $i++) {
+	if (my $hd = $config_options->{"disksel$i"}) {
+	    my ($disk, $devname, $size, $model) = @$hd;
+	    die "device '$devname' is used more than once\n"
+		if $dev_name_hash->{$devname};
+	    $dev_name_hash->{$devname} = $hd;
+	    push @$devlist, $hd;
+	}
+    }
+
+    return $devlist;
+};
+
+
+
 sub create_ack_view {
 
     cleanup_view();
@@ -2195,7 +2215,7 @@ sub create_ack_view {
     my $ack_html = "${proxmox_libdir}/html/$steps[$step_number]->{html}";
     my $html_data = file_get_contents($ack_template);
 
-    my %config_values = (
+    my $config_values = {
 	__target_hd__ => $target_hd,
 	__target_fs__ => $config_options->{filesys},
 	__country__ => $cmap->{country}->{$country}->{name},
@@ -2208,9 +2228,16 @@ sub create_ack_view {
 	__netmask__ => $netmask,
 	__gateway__ => $gateway,
 	__dnsserver__ => $dnsserver,
-    );
+    };
 
-    while ( my ($k, $v) = each %config_values) {
+    if ($config_options->{filesys} =~ m/zfs/) {
+	my $raid_devlist = &$get_raid_devlist();
+        my @raid_disks = map { $_->[1] } @{$raid_devlist};
+        my $used_disks = join(' / ', @raid_disks);
+        $config_values->{__target_hd__} = $used_disks;
+    }
+
+    while ( my ($k, $v) = each %{$config_values}) {
 	$html_data =~ s/$k/$v/g;
     }
 
@@ -2917,24 +2944,6 @@ sub create_hdoption_view {
     $dialog->destroy();
 }
 
-my $get_raid_devlist = sub {
-
-    my $dev_name_hash = {};
-
-    my $devlist = [];
-    for (my $i = 0; $i < @$hds; $i++) {
-	if (my $hd = $config_options->{"disksel$i"}) {
-	    my ($disk, $devname, $size, $model) = @$hd;
-	    die "device '$devname' is used more than once\n"
-		if $dev_name_hash->{$devname};
-	    $dev_name_hash->{$devname} = $hd;
-	    push @$devlist, $hd;
-	}
-    }
-
-    return $devlist;
-};
-
 sub zfs_mirror_size_check {
     my ($expected, $actual) = @_;
 
-- 
2.11.0





More information about the pve-devel mailing list