]> git.datanom.net - omvzfs.git/commitdiff
Made it optional to use /dev/disk/by-path
authorNiclas Berglind <nb@kjam.se>
Tue, 14 Oct 2014 07:37:32 +0000 (09:37 +0200)
committerMichael Rasmussen <mir@datanom.net>
Tue, 14 Oct 2014 20:47:03 +0000 (22:47 +0200)
Signed-off-by: Niclas Berglind <nb@kjam.se>
gui/js/omv/module/admin/storage/zfs/Overview.js
gui/rpc/zfs.inc

index 4acc897bbcc6f3c402d0a6d243c7408dd0961475..7341205c6db9fb363423dc5922ba40bc01dfa1f6 100644 (file)
@@ -177,6 +177,14 @@ Ext.define("OMV.module.admin.storage.zfs.AddPool", {
                                ptype: "fieldinfo",
                                text: _("Optional mountpoint for the pool. Default is to use pool name.")
                        }]
                                ptype: "fieldinfo",
                                text: _("Optional mountpoint for the pool. Default is to use pool name.")
                        }]
+               },{
+                       xtype: "checkbox",
+                       name: "diskpath",
+                       fieldLabel: _("Disk-by-path"),
+                       plugins: [{
+                               ptype: "fieldinfo",
+                               text: _("Use /dev/disk/by-path when creating the pool. Recommended.")
+                       }]
                },{
                        xtype: "checkbox",
                        name: "force",
                },{
                        xtype: "checkbox",
                        name: "force",
@@ -527,6 +535,14 @@ Ext.define("OMV.module.admin.storage.zfs.ExpandPool", {
                                        flex: 1
                                }]
                        }
                                        flex: 1
                                }]
                        }
+               },{
+                       xtype: "checkbox",
+                       name: "diskpath",
+                       fieldLabel: _("Disk-by-path"),
+                       plugins: [{
+                               ptype: "fieldinfo",
+                               text: _("Use /dev/disk/by-path when creating the vdev. Recommended.")
+                       }]
                },{
                        xtype: "checkbox",
                        name: "force",
                },{
                        xtype: "checkbox",
                        name: "force",
index 2b12b18d5b1623706a8c2500d8ba21d536f15c5c..881372aebb6fbbe1578c3cee7dbb08a65db79a17 100644 (file)
@@ -45,7 +45,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                                  "force":{"type":"boolean"},
                                  "mountpoint":{"type":"string"},
                                  "name":{"type":"string"},
                                  "force":{"type":"boolean"},
                                  "mountpoint":{"type":"string"},
                                  "name":{"type":"string"},
-                                 "devices":{"type":"string"}
+                                 "devices":{"type":"string"},
+                                 "diskpath":{"type":"boolean"}
                          }
                  }');
                switch ($params['pooltype']) {
                          }
                  }');
                switch ($params['pooltype']) {
@@ -77,14 +78,16 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                        $opts .= "-m " . $params['mountpoint'] . " ";
                }
 
                        $opts .= "-m " . $params['mountpoint'] . " ";
                }
 
-               //Use /dev/disk/by-path as deafult when creating new pools as suggested in ZoL FAQ.
                $disks = preg_split("/[,;]/", $params['devices']);
                $disks = preg_split("/[,;]/", $params['devices']);
-               if (file_exists("/dev/disk/by-path/")) {
-                       $tmp_disks = array();
-                       foreach ($disks as $disk) {
-                               $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk);
+               //Use /dev/disk/by-path as suggested in ZoL FAQ.
+               if ($params['diskpath']) {
+                       if (file_exists("/dev/disk/by-path/")) {
+                               $tmp_disks = array();
+                               foreach ($disks as $disk) {
+                                       $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk);
+                               }
+                               $disks = $tmp_disks;
                        }
                        }
-                       $disks = $tmp_disks;
                }
 
                $vdev = new OMVModuleZFSVdev($params['name'], $pooltype, $disks);
                }
 
                $vdev = new OMVModuleZFSVdev($params['name'], $pooltype, $disks);
@@ -547,7 +550,8 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                                        '"raidz1","raidz2","raidz3"]},
                                  "name":{"type":"string"},
                                  "devices":{"type":"string"},
                                        '"raidz1","raidz2","raidz3"]},
                                  "name":{"type":"string"},
                                  "devices":{"type":"string"},
-                                 "force":{"type":"boolean"}
+                                 "force":{"type":"boolean"},
+                                 "diskpath":{"type":"boolean"}
                          }
                }');
                $pool = new OMVModuleZFSZpool($params['name']);
                          }
                }');
                $pool = new OMVModuleZFSZpool($params['name']);
@@ -574,14 +578,16 @@ class OMVRpcServiceZFS extends OMVRpcServiceAbstract {
                if ($params['force']) {
                        $opts .= "-f ";
                }
                if ($params['force']) {
                        $opts .= "-f ";
                }
-               //Use /dev/disk/by-path as deafult when creating new pools as suggested in ZoL FAQ.
                $disks = preg_split("/[,;]/", $params['devices']);
                $disks = preg_split("/[,;]/", $params['devices']);
-               if (file_exists("/dev/disk/by-path/")) {
-                       $tmp_disks = array();
-                       foreach ($disks as $disk) {
-                               $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk);
+               //Use /dev/disk/by-path as suggested in ZoL FAQ.
+               if ($params['diskpath']) {
+                       if (file_exists("/dev/disk/by-path/")) {
+                               $tmp_disks = array();
+                               foreach ($disks as $disk) {
+                                       $tmp_disks[] = OMVModuleZFSUtil::getDiskPath($disk);
+                               }
+                               $disks = $tmp_disks;
                        }
                        }
-                       $disks = $tmp_disks;
                }
                $vdev[] = new OMVModuleZFSVdev($params['name'], $pooltype, $disks);
                $pool->addVdev($vdev, $opts);
                }
                $vdev[] = new OMVModuleZFSVdev($params['name'], $pooltype, $disks);
                $pool->addVdev($vdev, $opts);
This page took 0.040179 seconds and 5 git commands to generate.