Bug 1203032
Summary: | Enhancing block/disk migration in libvirt | |||
---|---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Tony Breeds <tony> | |
Component: | libvirt | Assignee: | Pavel Boldin <pboldin> | |
Status: | CLOSED NEXTRELEASE | QA Contact: | ||
Severity: | low | Docs Contact: | ||
Priority: | medium | |||
Version: | unspecified | CC: | dyuan, gfa, j.rosenboom, kchamart, matthew.gilliard, mprivozn, pboldin, rbalakri, redhat-bugzilla, shyu, tony, xuzhang, zpeng | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-1.2.17 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1204040 1283495 (view as bug list) | Environment: | ||
Last Closed: | 2015-06-18 14:59:40 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1204040, 1210352, 1283495 |
Description
Tony Breeds
2015-03-18 00:29:27 UTC
I'm very happy to do this work (so I assigned it to me). I just need to free up the time. Hi there, I want to take part in this as well. I have a time so if there is any progress I had like to take a look at it. I don't even have the beginnings of an implementation. I was still in the code review process when my priorities changed. If you have the time please feel free to do this work. I'd be very happy to help and test what you produce. [Assigning this bug back to libvirt-maint as it can come up in triage lists.] I have started working on the discussed implementation but the code needs some testing before it can be send to the upstream. Here are the preliminary patches: https://github.com/paboldin/libvirt/commits/master https://github.com/paboldin/libvirt-python/commits/master *** Bug 1208588 has been marked as a duplicate of this bug. *** (In reply to Pavel Boldin from comment #5) > I have started working on the discussed implementation but the code needs > some testing before it can be send to the upstream. > > Here are the preliminary patches: > https://github.com/paboldin/libvirt/commits/master > https://github.com/paboldin/libvirt-python/commits/master Pavel, can you please post the patches upstream? That's where all the development takes place. (In reply to Michal Privoznik from comment #7) > > Pavel, can you please post the patches upstream? That's where all the > development takes place. Done. Please review https://www.redhat.com/archives/libvir-list/2015-May/msg00345.html Please review re-roll: https://www.redhat.com/archives/libvir-list/2015-May/msg00697.html And the patches were jus pushed upstream: commit a4e92f9e14d0a81ceaa2bc8d0c423522fb455184 Author: Pavel Boldin <pboldin> AuthorDate: Tue Jun 16 01:42:11 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 virsh: selective block device migration Add `virsh migrate' option `--migrate-disks' that allows CLI user to explicitly specify block devices to migrate. Signed-off-by: Pavel Boldin <pboldin> Signed-off-by: Michal Privoznik <mprivozn> commit 93a19e283e5a147d147d84383aaaa8be63b6a68d Author: Pavel Boldin <pboldin> AuthorDate: Tue Jun 16 01:42:10 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 qemu: migration: selective block device migration https://bugzilla.redhat.com/show_bug.cgi?id=1203032 Implement a `migrate_disks' parameters for the QEMU driver. This multi- value parameter can be used to explicitly specify what block devices are to be migrated using the NBD server. Tunnelled migration using NBD is to be done. Signed-off-by: Pavel Boldin <pboldin> Signed-off-by: Michal Privoznik <mprivozn> commit 5eb03b6ea07d6e9178f5b8510681ea9ec9ca422f Author: Pavel Boldin <pboldin> AuthorDate: Tue Jun 16 01:42:09 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 util: add virTypedParamsAddStringList The `virTypedParamsAddStringList' function provides interface to add a NULL-terminated array of string values as a multi-value to the params. Signed-off-by: Pavel Boldin <pboldin> Signed-off-by: Michal Privoznik <mprivozn> commit 952907f5401512013a1296d7888b1217abecff76 Author: Pavel Boldin <pboldin> AuthorDate: Tue Jun 16 01:42:08 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 util: virTypedParams{Filter,GetStringList} Add multikey API: * virTypedParamsFilter that filters all the parameters with specified name. * virTypedParamsGetStringList that returns a list with all the values for specified name and string type. Signed-off-by: Pavel Boldin <pboldin> Signed-off-by: Michal Privoznik <mprivozn> commit e9ef8565205bdb1438c9a5e40a3d54e29f562b4e Author: Pavel Boldin <pboldin> AuthorDate: Tue Jun 16 01:42:07 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 util: multi-value parameters in virTypedParamsAdd* Allow multi-value parameters to be build using virTypedParamsAdd* functions by removing check for duplicates. Signed-off-by: Pavel Boldin <pboldin> Signed-off-by: Michal Privoznik <mprivozn> commit a5250449de8d570992744f309fefaaaa6f8212cd Author: Pavel Boldin <pboldin> AuthorDate: Tue Jun 16 01:42:06 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 util: multi-value virTypedParameter The `virTypedParamsValidate' function now can be instructed to allow multiple entries for some of the keys. For this flag the type with the `VIR_TYPED_PARAM_MULTIPLE' flag. Add unit tests for this new behaviour. Signed-off-by: Pavel Boldin <pboldin> Signed-off-by: Michal Privoznik <mprivozn> commit cb7297c150639e9f70e414f3a82d1cde9fa3d9d6 Author: Michal Privoznik <mprivozn> AuthorDate: Tue Jun 16 01:42:05 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 qemuMigrationDriveMirror: Force raw format for NBD When playing with disk migration lately, I've noticed this warning in domain logs: WARNING: Image format was not specified for 'nbd://masina:49153/drive-virtio-disk0' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. So I started digging into qemu source code to see what has triggered the warning. I'd expect qemu to know formats of guest's disks since we tell them on command line. This lead me to qmp_drive_mirror() where the following can be found: if (!has_format) { format = mode == NEW_IMAGE_MODE_EXISTING ? NULL : bs->drv->format_name; } So, format is automatically initialized from the disk iff mode != "existing". Unfortunately, in migration we are tied to use this mode (NBD doesn't support creating new images). Therefore the only way to avoid this warning is to pass format. The discussion on the mail-list [1] resulted in the code that always forces NBD export as "raw" format. [1] https://www.redhat.com/archives/libvir-list/2015-June/msg00153.html Signed-off-by: Michal Privoznik <mprivozn> Signed-off-by: Pavel Boldin <pboldin> commit 9c5efd1afd49a57c4d17fc9245995fc4e1e6f653 Author: Michal Privoznik <mprivozn> AuthorDate: Tue Jun 16 01:42:04 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 qemuMigrationBeginPhase: Fix function header indentation This function is returning a string (domain XML). Since d3ce7363 when it was first introduced, it was indented incorrectly: static char *qemuMigrationBeginPhase(..) Signed-off-by: Michal Privoznik <mprivozn> commit 1049a8d8b4fa3efb63cfd39ae924f5ada3338115 Author: Michal Privoznik <mprivozn> AuthorDate: Tue Jun 16 01:42:03 2015 +0300 Commit: Michal Privoznik <mprivozn> CommitDate: Thu Jun 18 16:46:09 2015 +0200 virDomainDiskGetSource: Mark passed disk as 'const' The disk is not changed anywhere in the function. Mark this fact in the function header too. Signed-off-by: Michal Privoznik <mprivozn> v1.2.16-234-ga4e92f9 |