How to get Virtual Machine log from Opennebula 5.0.2 using XML-RPC? Where will that log data is stored?

I’m trying to get log of each and every virtual machine from opennebula. Please tell me how to get those log?

1 Like

Hi,
I’m afraid I have no experience with OpenNebula’s XML-RPC interface but according to docs http://docs.opennebula.org/5.0/integration/system_interfaces/api.html maybe you can try to get some info using the one.vm.info action. Sorry I can’t send you a code snippet but haven’t tried the API directly and also it would depend on your programming language.

By default logs are stored in the /var/log/one directory and you can find logs there for the opennebula service, sunstone service… Also each machine has a log with the VM ID followed by *.log e.g (0.log, 1.log…). Have a look at http://docs.opennebula.org/5.0/deployment/references/log_debug.html to find more about log configuration (e.g sending logs to other systems like syslog).

Cheers!

2 Likes

Thanks for the reply:slight_smile:

What is time format of log time of virtual machine in log file in var/log/one path? Which country format is it?

Hi,
English date, I guess. Anyway it doesn’t seem very difficult to parse, isn’t it it?

This is a sample though you have plenty of it in that folder to play with: Wed Oct 5 11:47:09 2016 [Z0][VMM][I]: Driver loaded.

Check your parser or favourite programming language documentation to know how to parse that dates… seems standard so you’ll find many examples. I can’t share a code snippet as I haven’t done that in the past, sorry.

Cheers!

The format is as ctime(t) which is string representation of
<day of week> <month> <day of month> <hour>:<minute>:<second> <year>

source:

Kind Regards,
Anton Todorov

Hi,

I’m using PHP language to run openNebula API. I’ve tried “one.vm.info” API but there is not vm log in this API result.

Can you please help me to get VM logs?

Thanks