| Api_errors.Server_error (e,l) ->
e,l
- | Forkhelpers.Spawn_internal_error(stderr, stdout, Unix.WEXITED n) as e ->
+ | Forkhelpers.Spawn_internal_error(stderr, stdout, Unix.WEXITED n) ->
internal_error, [ Printf.sprintf "Subprocess exitted with unexpected code %d; stdout = [ %s ]; stderr = [ %s ]" n stdout stderr ]
| Invalid_argument x ->
internal_error, [ Printf.sprintf "Invalid argument: %s" x ]
let newvm = Client.VM.clone rpc session_id template "ISCSI target server" in
try
Client.VM.provision rpc session_id newvm;
- let isovbd = Client.VBD.create rpc session_id newvm iscsi_iso "0" true `RO `CD false false [] "" [] in
+ ignore_VBD(Client.VBD.create rpc session_id newvm iscsi_iso "0" true `RO `CD false false [] "" []);
let realpool = List.hd (Client.Pool.get_all rpc session_id) in
let defaultsr = Client.Pool.get_default_SR rpc session_id realpool in
assert_sr_exists rpc session_id defaultsr "pool's default SR";
let storage_vdi_label = Printf.sprintf "SCSI VDI %d" i in
let storage_vdi = Client.VDI.create rpc session_id storage_vdi_label "" defaultsr sr_disk_size `user false false [oc_key,key] [] [] [] in
let userdevice = Printf.sprintf "%d" (i+1) in
- Client.VBD.create rpc session_id newvm storage_vdi userdevice false `RW `Disk false false [] "" []
+ ignore_VBD(Client.VBD.create rpc session_id newvm storage_vdi userdevice false `RW `Disk false false [] "" [])
done;
Client.VM.set_PV_bootloader rpc session_id newvm "pygrub";
open Listext
open Client
+(* ----------- Ignore functions ----------- *)
+
+let ignore_VBD v = let (_ : API.ref_VBD) = v in ()
+
(* --------------- Debugging --------------- *)
let stdout_m = Mutex.create ()
Client.VM.set_PV_bootloader rpc session_id newvm "pygrub";
Client.VM.set_PV_args rpc session_id newvm (Printf.sprintf "net_ip=%s net_mask=255.255.255.0" (make_iscsi_ip pool));
Client.VM.set_HVM_boot_policy rpc session_id newvm "";
- Client.VIF.create rpc session_id "0" network newvm "" 1500L [oc_key,pool.key] "" [];
+ let (_ : API.ref_VIF) = Client.VIF.create rpc session_id "0" network newvm "" 1500L [oc_key,pool.key] "" [] in
Client.VM.add_to_other_config rpc session_id newvm oc_key pool.key;
let localhost_uuid = Xapi_inventory.lookup "INSTALLATION_UUID" in
Client.VM.start_on rpc session_id newvm (Client.Host.get_by_uuid rpc session_id localhost_uuid) false false;
let interfaces = initialise session_id template pool in
Printf.printf "Creating iSCSI target VM serving %d LUNs\n%!" pool.iscsi_luns;
- let iscsi_vm = CreateVM.make_iscsi session_id pool (Client.VIF.get_network rpc session_id interfaces.(2)) in
+ let (_ : API.ref_VM option) = CreateVM.make_iscsi session_id pool (Client.VIF.get_network rpc session_id interfaces.(2)) in
debug "Creating %d SDK VMs" pool.hosts;
let hosts = Array.init pool.hosts (
let slave_uuids = List.filter (fun x -> x <> master_uuid) (Array.to_list host_uuids) in
let host_uuids = Array.of_list (slave_uuids @ [ master_uuid ]) in
- let bonds = Array.mapi (fun i host_uuid ->
+ let (_ : API.ref_Bond array array) = Array.mapi (fun i host_uuid ->
let host_ref = Client.Host.get_by_uuid poolrpc poolses host_uuid in
let pifs = List.filter (fun pif -> Client.PIF.get_host poolrpc poolses pif = host_ref) pifs in
Array.init pool.bonds (fun bnum ->
let remoterpc host xml =
Instrumented_xmlrpcclient.do_secure_xml_rpc ~host:host ~version:"1.1" ~port:443 ~path:"/" xml
-
(* Rewrite the provisioning XML fragment to create all disks on a new, specified SR. This is cut-n-pasted from cli_util.ml *)
let rewrite_provisioning_xml rpc session_id new_vm sr_uuid =
let rewrite_xml xml newsrname =
debug test "Cloning suspended VM";
let vm' = Client.VM.clone !rpc session_id vm "clone-suspended-test" in
debug test "Snapshoting the VM twice";
- let snap1 = Client.VM.snapshot !rpc session_id vm' "snap1" in
- let snap2 = Client.VM.snapshot !rpc session_id vm' "snap2" in
+ ignore(Client.VM.snapshot !rpc session_id vm' "snap1");
+ ignore(Client.VM.snapshot !rpc session_id vm' "snap2");
debug test "Comparing original, clone VIF configuration";
compare_vifs session_id test vm vm';
match Random.int 3 with
| 0 -> raise (Api_errors.Server_error(Api_errors.ha_operation_would_break_failover_plan, []))
| 1 -> raise (Api_errors.Server_error("FIST: unexpected exception", []))
- | 2 -> ()
+ | _ -> ()
end;
(* If we tried before and failed, don't retry again within 2 minutes *)
| Api_errors.Server_error(code, params) when code = Api_errors.ha_operation_would_break_failover_plan ->
(* This should never happen since the planning code would always allow the restart of a protected VM... *)
error "Caught exception HA_OPERATION_WOULD_BREAK_FAILOVER_PLAN: setting pool as overcommitted and retrying";
- mark_pool_as_overcommitted ~__context;
+ ignore_bool(mark_pool_as_overcommitted ~__context);
begin
try
go ();