Live Block Device Operations in QEMU
Kashyap Chamarthy <kashyap@redhat.com> FOSDEM 2018 Brussels
1 / 34
Live Block Device Operations in QEMU Kashyap Chamarthy - - PowerPoint PPT Presentation
Live Block Device Operations in QEMU Kashyap Chamarthy <kashyap@redhat.com> FOSDEM 2018 Brussels 1 / 34 Part I Background 2 / 34 KVM / QEMU virtualization components OpenStack libguestfs Compute (Nova) KubeVirt guestfish ( Virt
1 / 34
2 / 34
VM1 QEMU VM2 QEMU libvirtd OpenStack Compute (Nova) KubeVirt libguestfs guestfish (Virt Driver)
QMP QMP 3 / 34
Block Layer qcow2 raw ... file NBD ... QMP Talk focus
Image format I/O protocol
4 / 34
5 / 34
5 / 34
base (raw)
6 / 34
base (raw)
(Backing file) (Backing file format)
6 / 34
base
(Live QEMU)
7 / 34
8 / 34
8 / 34
8 / 34
8 / 34
9 / 34
10 / 34
10 / 34
10 / 34
$ socat UNIX:./qmp-sock \ READLINE,history=$HOME/.qmp_history \ {"QMP": {"version": {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": "(v2.11.0-355-g281f327487)"}, "capabilities": []}} {"execute": "qmp_capabilities"} {"return": {}} {"execute": "query-status"} {"return": {"status": "running", "singlestep": false, "running": true} }
11 / 34
$ socat UNIX:./qmp-sock \ READLINE,history=$HOME/.qmp_history \ {"QMP": {"version": {"QMP": {"version": {"qemu": {"micro": 50, "minor": 11, "major": 2}, {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": "(v2.11.0-355-g281f327487)"}, "package": "(v2.11.0-355-g281f327487)"}, "capabilities": []}} "capabilities": []}} {"execute": "qmp_capabilities"} {"return": {}} {"execute": "query-status"} {"return": {"status": "running", "singlestep": false, "running": true} }
11 / 34
$ socat UNIX:./qmp-sock \ READLINE,history=$HOME/.qmp_history \ {"QMP": {"version": {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": "(v2.11.0-355-g281f327487)"}, "capabilities": []}} {"execute": "qmp_capabilities qmp_capabilities"} {"return": {}} {"execute": "query-status"} {"return": {"status": "running", "singlestep": false, "running": true} }
11 / 34
$ socat UNIX:./qmp-sock \ READLINE,history=$HOME/.qmp_history \ {"QMP": {"version": {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": "(v2.11.0-355-g281f327487)"}, "capabilities": []}} {"execute": "qmp_capabilities"} {"return": {}} {"execute": "query-status query-status"} {"return": {"status": "running", "singlestep": false, "running": true} }
11 / 34
$ socat UNIX:./qmp-sock \ READLINE,history=$HOME/.qmp_history \ {"QMP": {"version": {"qemu": {"micro": 50, "minor": 11, "major": 2}, "package": "(v2.11.0-355-g281f327487)"}, "capabilities": []}} {"execute": "qmp_capabilities"} {"return": {}} {"execute": "query-status"} {"return": {"status": "running", "singlestep": false, "running": true} }
11 / 34
(QEMU) block-job-complete device=virtio1
NB: Modifying VM state behind libvirt’s back voids support warranty!
12 / 34
13 / 34
14 / 34
15 / 34
15 / 34
15 / 34
15 / 34
16 / 34
17 / 34
18 / 34
base (Live QEMU)
19 / 34
base (Live QEMU)
19 / 34
base (Live QEMU)
base
(Live QEMU)
19 / 34
base
(Live QEMU)
20 / 34
base
(Live QEMU)
base
21 / 34
base
22 / 34
base
22 / 34
base
22 / 34
base
22 / 34
base
22 / 34
base
base
(Live QEMU) (invalid) (invalid) (invalid)
23 / 34
24 / 34
base
copy (Live QEMU)
25 / 34
base
copy (Live QEMU)
26 / 34
27 / 34
Details: qemu/docs/interop/live-block-operations.rst
28 / 34
29 / 34
30 / 34
base
copy (sync=none) (Live QEMU)
{"execute":"blockdev-backup", "arguments":{"device": "node-Overlay3", "target": "copy", "job-id": "job0", "sync": "none"}} [...] # Start NBD server and export the ‘copy’
31 / 34
32 / 34
Detailed docs with examples: Live Block Device Operations https://kashyapc.fedorapeople.org/QEMU-Docs/_build/html/docs/ live-block-operations.html "Incremental Backups - Good things come in small packages!" by John Snow https://fosdem.org/2017/schedule/event/backup_dr_incr_backups/ "Managing the New Block Layer" by Kevin Wolf & Max Reitz https://events.static.linuxfound.org/sites/events/files/slides/ talk_11.pdf "Backing Chain Management in libvirt and qemu" by Eric Blake http://events.linuxfoundation.org/sites/events/files/slides/ 2015-qcow2-expanded.pdf "Towards a more expressive and introspectable QEMU command line" https://events.static.linuxfound.org/sites/events/files/slides/ armbru-qapi-cmdline_1.pdf
33 / 34
34 / 34