exit 1
let vcpus = ref 0 (* 0 = choose for me *)
+let open_console = ref false
+let open_viewer = ref false
+
let get_arg_speclist () = Arg.align [
+ "--console", Arg.Set open_console, " Open the serial console";
"--cpus", Arg.Set_int vcpus, "n Number of virtual CPUs";
"--memory", Arg.String set_memory, "nnG Amount of RAM to give guest";
"--ram", Arg.String set_memory, "nnG Amount of RAM to give guest";
"--vcpus", Arg.Set_int vcpus, "n Number of virtual CPUs";
+ "--viewer", Arg.Set open_viewer, " Open the graphical console";
]
let boot ~verbose template name =
);
(* Start the guest. *)
- try
- let conn =
- let name = node.MS.node_status.MS.node.Mclu_conf.libvirt_uri in
- C.connect ~name () in
- let dom = D.create_xml conn xml [] in
- printf "mclu: %s:%s started\n" hostname (D.get_name dom)
- with Libvirt.Virterror msg ->
- eprintf "mclu: %s: %s\n" hostname (Libvirt.Virterror.to_string msg);
- exit 1
+ let dom =
+ try
+ let conn =
+ let name = node.MS.node_status.MS.node.Mclu_conf.libvirt_uri in
+ C.connect ~name () in
+ let dom = D.create_xml conn xml [] in
+ printf "mclu: %s:%s started\n" hostname (D.get_name dom);
+ dom
+ with Libvirt.Virterror msg ->
+ eprintf "mclu: %s: %s\n" hostname (Libvirt.Virterror.to_string msg);
+ exit 1 in
+
+ (* Graphical console? *)
+ if !open_viewer then
+ Mclu_viewer.viewer ~verbose ~host:hostname (D.get_name dom);
+
+ (* Serial console? (Interactive, so run it last) *)
+ if !open_console then
+ Mclu_console.console ~verbose ~host:hostname (D.get_name dom)
let run ~verbose = function
| [ template; name ] ->