KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO)...
Transcript of KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO)...
![Page 1: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/1.jpg)
QEMU BackupMaxim Nestratov, Virtuozzo
Vladimir Sementsov-Ogievskiy, Virtuozzo
![Page 2: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/2.jpg)
QEMU BackupVladimir Sementsov-Ogievskiy, Virtuozzo
![Page 3: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/3.jpg)
Full featured backup
Copyright © 2017 Virtuozzo. All Rights Reserved. 3
•Online backup• Fast
• Not very invasive for the guest
• Incremental• Dirty bitmaps persistence and migration
•External backup API
![Page 4: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/4.jpg)
Incremental
Copyright © 2017 Virtuozzo. All Rights Reserved. 4
![Page 5: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/5.jpg)
Incremental
Copyright © 2017 Virtuozzo. All Rights Reserved. 5
![Page 6: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/6.jpg)
Incremental: persistent
Copyright © 2017 Virtuozzo. All Rights Reserved. 6
•Qcow2 bitmaps merged into 2.9• Several named bitmaps
• Size equals image size
• Sparse format
•Other formats are under discussion
![Page 7: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/7.jpg)
Incremental: migration
Copyright © 2017 Virtuozzo. All Rights Reserved. 7
Variants:
• Fist approach: meta bitmaps
•Current approach: postcopy
•Through storage (works for qcow2)
![Page 8: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/8.jpg)
Incremental: snapshots
Copyright © 2017 Virtuozzo. All Rights Reserved. 8
Internal snapshots
•Dirty bitmaps correspond to active state
•Switch to snapshot = the whole disk is dirty
External snapshots
•Everything is possible
![Page 9: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/9.jpg)
Performance: current work
Copyright © 2017 Virtuozzo. All Rights Reserved. 9
Backup = simple copy + COW (write notifiers)
•Current approach:• Sequential copying + sequential notifiers
•New arc:• Queues of requests• Several copying coroutines• Notifiers just increase priority of request• Earlier notifier release
![Page 10: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/10.jpg)
Performance: ideas and plans
Copyright © 2017 Virtuozzo. All Rights Reserved. 10
How to handle COW?
•Current: guest wait for backup
•Reverse delta: read COW area to local delta
![Page 11: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/11.jpg)
External backup API
Copyright © 2017 Virtuozzo. All Rights Reserved. 11
• Image fleecing scheme
• Incremental backup• NBD block-status extension
• Additional API for dirty bitmap management
![Page 12: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/12.jpg)
External backup API: image fleecing
Copyright © 2017 Virtuozzo. All Rights Reserved. 12
![Page 13: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/13.jpg)
External backup API: NBD block-status
Copyright © 2017 Virtuozzo. All Rights Reserved. 13
•Current NBD: payload only for READ
•Extension: structured replies
•Extension: block-status• Negotiation phase: select metadata contexts
• Transmission phase• New command NBD_CMD_BLOCK_STATUS
• Reply chunk contains extent descriptors
![Page 14: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/14.jpg)
QEMU Backup summary
Copyright © 2017 Virtuozzo. All Rights Reserved. 14
Merged:
•Qcow2 bitmaps
Done in Virtuozzo:
•New backup architecture (async IO)
• Bitmaps migration
•NBD block-status extension
Near future:
• External backup API
![Page 15: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/15.jpg)
Libvirt BackupMaxim Nestratov, Virtuozzo
![Page 16: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/16.jpg)
Libvirt Backup API first proposal
Copyright © 2017 Virtuozzo. All Rights Reserved. 16
• "Push" backups
• "Pull" backups
![Page 17: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/17.jpg)
Why not snapshots?
Copyright © 2017 Virtuozzo. All Rights Reserved. 17
•Different storage
• Incremental backups
•Multiple chains
•Agentless
![Page 18: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/18.jpg)
"Push" or "Managed" Backups
Copyright © 2017 Virtuozzo. All Rights Reserved. 18
•A new set of functions similar to snapshots
•Create, List, Delete, Edit
•Managed by libvirt
• Local to host
•Can be saved to any supported block device
•NAT friendly
![Page 19: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/19.jpg)
Copyright © 2017 Virtuozzo. All Rights Reserved. 19
Managed backup scheme
![Page 20: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/20.jpg)
Managed backup concerns
Copyright © 2017 Virtuozzo. All Rights Reserved. 20
•Hard to use in clusters
•Guest performance influence due to network throughput
•A lot of code to implement
•Access to backup storage
![Page 21: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/21.jpg)
"Pull" or "External" Backups
Copyright © 2017 Virtuozzo. All Rights Reserved. 21
•Mostly two functions: Start/Stop
•Exposes block device via NBD protocol
•Uses NBD protocol extension for incremental backups
![Page 22: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/22.jpg)
External backups advantages
Copyright © 2017 Virtuozzo. All Rights Reserved. 22
•Tolerant to guests performance
•Controlled externally
•Cluster friendly
![Page 23: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/23.jpg)
External backups concerns
Copyright © 2017 Virtuozzo. All Rights Reserved. 23
•NAT unfriendly
•Tolerant to guests performance
•Uses NBD protocol extension for incremental backups
•Controlled externally
•Not bound to a specific hypervisor host
![Page 24: KVM - QEMU Backup...•Qcow2 bitmaps Done in Virtuozzo: •New backup architecture (async IO) •Bitmaps migration •NBD block-status extension Near future: •External backup API](https://reader036.fdocuments.us/reader036/viewer/2022081410/609f03e06ffbf25925163073/html5/thumbnails/24.jpg)
Copyright © 2017 Virtuozzo. All Rights Reserved. 24
External backup scheme