Commit 8385054b authored by Thomas Goirand's avatar Thomas Goirand

Fix ENC to support non-/dev/sda system drive in stores.

parent 0b87cadf
......@@ -933,7 +933,24 @@ function api_actions($con,$conf){
$enc_file .= " zoneid: $machine_location\n";
$enc_file .= " block_devices:\n";
$q = "SELECT * FROM blockdevices WHERE machine_id='$machine_id' AND name NOT LIKE '%da'";
if($machine["install_on_raid"] == "no"){
$q = "SELECT * FROM blockdevices WHERE machine_id='$machine_id' AND name NOT LIKE '%da'";
}else{
switch($machine["raid_type"]){
case "0":
case "1":
$q = "SELECT * FROM blockdevices WHERE machine_id='$machine_id' AND name NOT LIKE '".$machine["raid_dev0"]."' AND name NOT LIKE '".$machine["raid_dev1"]."'";
break;
case "10":
$q = "SELECT * FROM blockdevices WHERE machine_id='$machine_id' AND name NOT LIKE '".$machine["raid_dev0"]."' AND name NOT LIKE '".$machine["raid_dev1"]."' AND name NOT LIKE '".$machine["raid_dev2"]."' AND name NOT LIKE '".$machine["raid_dev3"]."'";
break;
case "5":
default:
die("Not supported yet.");
break;
}
}
$r = mysqli_query($con, $q);
$n = mysqli_num_rows($r);
if($n < 1){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment