=over 4
+=item B<--console>
+
+Open the serial console immediately after booting the guest. This is
+the same as using the C<mclu console> subcommand, but quicker.
+
=item B<--memory nnG>
Specify the amount of memory (RAM) to give this guest. You can use
Specify the number of virtual CPUs to give to the guest. The default
is the number of physical CPUs, but not more than 4.
+=item B<--viewer>
+
+Open the graphical console immediately after booting the guest. This is
+the same as using the C<mclu viewer> subcommand, but quicker.
+
=back
=item B<mclu console [host:]guest>
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 ] ->