}
$disks = preg_split("/[,;]/", $params['devices']);
+ foreach ($disks as $disk) {
+ OMVModuleZFSUtil::setGPTLabel($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);
+ try {
+ 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;
+ } catch (OMVModuleZFSException $e) {
+ //Do nothing if an excpetion is thrown
}
}
$opts .= "-f ";
}
$disks = preg_split("/[,;]/", $params['devices']);
+ foreach ($disks as $disk) {
+ OMVModuleZFSUtil::setGPTLabel($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);
+ try {
+ 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;
+ } catch (OMVModuleZFSException $e) {
+ //Do nothing if an exception is thrown
}
}
$vdev[] = new OMVModuleZFSVdev($params['name'], $pooltype, $disks);