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:
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.
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) backend. snapshot_ extract( out_path, image_format) create_ domain( domain= virt_dom)
snapshot_
self._
The console log file is passed as "-chardev" option of qemu process. charserial0, path=/opt/ stack/data/ nova/instances/ 6454f845- 9a47-4024- bb9e-85a6525466 c1/console. log
Ex) -chardev file,id=
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.