Bug 23605 - qemu: qcow2 disk corruption on domain shutdown
qemu: qcow2 disk corruption on domain shutdown
Status: CLOSED DUPLICATE of bug 27612
Product: UCS
Classification: Unclassified
Component: Virtualization - KVM
UCS 2.4
All Linux
: P5 normal (vote)
: UCS 3.1
Assigned To: Philipp Hahn
Janek Walkenhorst
: interim-3
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-13 19:57 CEST by Philipp Hahn
Modified: 2012-12-12 21:09 CET (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Troubleshooting
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2011-09-13 19:57:14 CEST
Bei QA-Tests ist erneut aufgefallen, das es bei Verwendung von KVM gelegentlich zu Image-Datei-Korruption kommt: Nach dem Zurückspielen eines Sicherungspunktes reagierte die VM nicht wie gewünscht und wurde per "Beenden" hart beendet. Beim nachfolgenden Reboot wurden dann vom e2fsck so gravierende Fehler festgestellt, daß diese per Hand korrigiert werden sollten.
Ein erneutes Zurückspielen des gleichen Sicherungspunktes hat das Problem dann zum Glück behoben.

Ursache könnte libvirt sein, der qemu per SIGTERM statt SIGQUIT beendet, wodurch qemu keine Change per hat, die noch ausstehenden Daten des Festplatten-Images zurückzuschreiben. Siehe <http://www.redhat.com/archives/libvir-list/2011-September/msg00466.html> für einen ungetesteten Patch.

libvirt-0.8.7:

src/qemu/qemu_driver.c: qemuDomainRevertToSnapshot()
4537:  qemudShutdownVMDaemon(driver, vm, 0);

src/qemu/qemu_driver.c: qemudShutdownVMDaemon()
3042:  virKillProcess(vm->pid, SIGTERM) < 0)
Comment 1 Philipp Hahn univentionstaff 2012-08-07 20:07:55 CEST
Der erwähnte Patch ist für eine spätere Version als für libvirt-0.8.7, wie wir es noch in UCS-3.0 verwenden. Inzwischen sieht der aktuelle libvirt-Code wieder anders aus, von daher stelle ich das erstmal zurück bis entschieden ist, ob wir nicht generell eine neuere Version von libvirt in UCS-3.1 importieren werden.
Comment 2 Philipp Hahn univentionstaff 2012-09-13 09:47:17 CEST
Im Rahmen von Bug #27612 wurde libvirt-0.9.12 importiert, was in 
src/qemu/qemu_process.c # qemuProcessKill() folgendes implementiert:

    /* This loop sends SIGTERM (or SIGKILL if flags has
     * VIR_QEMU_PROCESS_KILL_FORCE and VIR_QEMU_PROCESS_KILL_NOWAIT),
     * then waits a few iterations (10 seconds) to see if it dies. If
     * the qemu process still hasn't exited, and
     * VIR_QEMU_PROCESS_KILL_FORCE is requested, a SIGKILL will then
     * be sent, and qemuProcessKill will wait up to 5 seconds more for
     * the process to exit before returning.  Note that the FORCE mode
     * could result in lost data in the guest, so it should only be
     * used if the guest is hung and can't be destroyed in any other
     * manner.
     */

Damit ist das Problem dann behoben.

*** This bug has been marked as a duplicate of bug 27612 ***
Comment 3 Janek Walkenhorst univentionstaff 2012-11-22 12:54:11 CET
Die Upstream-Änderung ist übernommen.

Es sind bei der QA keine weiteren Korruptionsprobleme aufgetreten.
Comment 4 Stefan Gohmann univentionstaff 2012-12-12 21:09:06 CET
UCS 3.1-0 has been released: 
 http://forum.univention.de/viewtopic.php?f=54&t=2125

If this error occurs again, please use "Clone This Bug".