Comment 20 for bug 1251920

Revision history for this message
Ken'ichi Ohmichi (oomichi) wrote :

This problem seems difficult to fix at Nova side.

At snapshot() in nova/virt/libvirt/driver.py, a qemu process stops before extracting snapshot.
Then, it creates a qemu process again after extracting snapshot like the following:

 virt_dom.managedSave(0)
 snapshot_backend.snapshot_extract(out_path, image_format)
 self._create_domain(domain=virt_dom)

The console log file is passed as "-chardev" option of qemu process.
Ex) -chardev file,id=charserial0,path=/opt/stack/data/nova/instances/6454f845-9a47-4024-bb9e-85a6525466c1/console.log
And "console-log" API reads the file, and return it as a response.
The manpage of the option is the following:

 $ man qemu-system-x86_64
 [..]
       -chardev file ,id=id ,path=path
           Log all traffic received from the guest to a file.

           path specifies the path of the file to be opened. This file will be created if it does not already exist, and overwritten if it does. path is required.

That means the file content will be truncated if the file exists.
As the result, we cannot get the console log after an instance snapshot/backup.

We could avoid this problem if live-snapshot, because of an instance not-stopping.
However, current gate environment could not use live-snapshot, I guess.

So I don't have a solution at Nova side.
I guess we can avoid this if putting the console log test at the first in Tempest.