大网数据广告活动
服务器运维问答

kvm/libvirt backup: how to ensure a consistent fs during online blockcommit?

· 52CE 我爱测

I want to create online backups of a KVM Windows 10 virtual machine that is managed by libvirt. I have the qemu agent setup in the guest. If found this wiki entry that suggests the following: 1. create an offline snapshot $ virsh…

问题原文

原帖链接 · muffel · CC BY-SA 4.0

I want to create online backups of a KVM Windows 10 virtual machine that is managed by libvirt. I have the qemu agent setup in the guest.

If found this wiki entry that suggests the following:

1. create an offline snapshot

$ virsh snapshot-create-as --domain my-vm my-snapshot \
    --diskspec vda,file=/export/images/overlay.qcow2 \
    --disk-only --atomic --quiesce

2. backup the base image

$ my-backup-tool /path/to/base.image

3. merge fs changes that occured after the snapshot back into the base image

$ virsh blockcommit my-vm hda --active --verbose --pivot

4. remove snapshot

$ virsh snapshot-delete my-vm --metadata my-snapshot

My question: It is suggested by the articcle to provide the --quiesce parameter to ensure a consistent snapshot creating (i.e. freeze fs activity during creation), but wouldn't one need to do the same for step 3 with the help of e.g. virsh domfsfreeze? What happens with ongoing fs activity during the blockcommit?

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

Actually you do not want to freeze the filesystem during the blockcommit. That would result in a lengthy delay while blocks are being copied from one image to the other. Because, before and during the copy, one (or both) of the two always represents the actual filesystem state, there's no higher chance of data loss.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-08-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。