[one-users] Missing log when no error happens

Daniel Dehennin daniel.dehennin at baby-gnu.org
Tue Nov 5 02:26:47 PST 2013


"Ruben S. Montero" <rsmontero at opennebula.org> writes:

> So, your proposal is to have, all messages as in:
>
>     [TM][I]: clone: Cloning
> /var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94 in
> yggdrasil:/var/lib/one//datastores/0/15/disk.1
>
> This is pre-pend with the "clone:" string, right? If this is the case, this
> could be done in the core as:
>
>    [TM][I]: <<<<<< ERROR IN CLONE >>>>>>>>>
>    [TM][I]: Command execution fail: /var/lib/one/remotes/tm/qcow2/clone
> yggdrasil:/var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94
> yggdrasil:/var/lib/one//datastores/0/15/disk.1 15 1
>     [TM][I]: clone: Cloning
> /var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94 in
> yggdrasil:/var/lib/one//datastores/0/15/disk.1
> ...
>    [TM][I]: <<<<<< ERROR IN CLONE >>>>>>>>>
>
>
> What do you think?

I thought about wrapping all executed commands to log:

- INFO: the description of the command, like
  “Cloning /var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94
   in yggdrasil:/var/lib/one//datastores/0/15/disk.1”

- DEBUG: the command to execute, like: “ssh at yggdrasil: <COMMAND>”

This could output something like the following (line wrapped to ease reading):

    [TM][I]: Command: /var/lib/one/remotes/tm/qcow2/clone
             yggdrasil:/var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94
             yggdrasil:/var/lib/one//datastores/0/15/disk.1
             15 1
    [TM][I]: clone: Cloning /var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94
             in yggdrasil:/var/lib/one//datastores/0/15/disk.1
    [TM][D]: clone: ssh at yggdrasil "cd /var/lib/one/datastores/0/15; 
             qemu-img create -b /var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94 
             -f qcow2 /var/lib/one/datastores/0/15/disk.1"
    [TM][E]: <<<<<< ERROR IN CLONE >>>>>>>>>
    [TM][E]: Command execution fail: "/var/lib/one/remotes/tm/qcow2/clone
             yggdrasil:/var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94
             yggdrasil:/var/lib/one//datastores/0/15/disk.1
             15 1": qemu-img: Could not open '/var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94'
    [TM][E]: Error copying yggdrasil:/var/lib/one/datastores/1/e72972d1dc14203d83520f9ae6395d94 
             to yggdrasil:/var/lib/one//datastores/0/15/disk.1
    [TM][I]: ExitCode: 1
    [TM][E]: <<<<<< ERROR IN CLONE >>>>>>>>>

So, we can follow the execution path until the error:

1. the “qcow2 clone” is called with specified arguments
2. the “clone” script informs what it does
3. in debug mode[1] we see the command that will be executed: an SSH to
   yggdrasil running “cd” and “qemu-img”
4. an error occurs and we see the command and it's output

Actually, the point 4 is already OK for me, but 1 to 3 are missing.

The point 2 is already done by the script[2] but is not present in the
logs and I don't know why.

The point 3 can be done by common wrappers[3].

The point 1 is from core, I think.

This could be generalized as:

1. the core log state changes
2. for each step to setup a VM, the core log what need to be done, like
   “setting up network”, “setting up storage”, etc.
3. the core log which script it will call with its arguments
4. the script log informative messages of what it does
5. before a command is executed, a log of what will be executed and
   where
6. after the command is executed, log the result

Looking at my log files, not everything is logged, mostly the “what ONE wants to/will do”.

I hope it will help understand what I would like.

Regards.

Footnotes: 
[1]  or info I don't know what's the best

[2]  http://dev.opennebula.org/projects/opennebula/repository/revisions/release-4.2/entry/src/tm_mad/qcow2/clone#L69

[3]  http://dev.opennebula.org/projects/opennebula/repository/revisions/release-4.2/entry/src/mad/sh/scripts_common.sh

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20131105/414be420/attachment-0002.pgp>


More information about the Users mailing list