Bug 1022393

Summary: Disable live-storage-migration in virsh (migrate -b/-i in qemu) - libvirt support
Product: Red Hat Enterprise Linux 7 Reporter: Ademar Reis <areis>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, areis, berrange, bsarathy, dallan, dyuan, eblake, jcody, jdenemar, knoel, mkenneth, mprivozn, virt-maint, ydu, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.1.1-12.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1020495 Environment:
Last Closed: 2014-06-13 12:21:11 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:
Bug Depends On: 1022392    
Bug Blocks:    

Comment 3 Michal Privoznik 2013-11-07 09:44:17 UTC
Just to make clear how is libvirt acting on migration with non-shared storage (just 'migration' hereafter). On migration request, the source checks for 'nbd-server-start' command (*) and advertises this fact to the destination libvirt. If the destination libvirt sees that the source knows NBD migration, it checks for the very same command, and adds all non-shared disks to the migration queue (via 'nbd-server-add'). If the command is not present, the old way of migration is assumed. The presence and successfulness of all nbd-server-* commands is then advertised back to the destination, which then just start 'drive-mirror' to all non-shared disks. Then, the source libvirt waits for storage migration to settle down after which the actual migration of RAM & internal state is started.

In case any of source or destination doesn't support 'nbd-server-start' the old way of migration is used.

So what we need here is:
1) disable 'blk' and 'inc' flags to 'migrate' command
2) hide/disable 'nbd-server-start' command

Doing just 1) (what is done here IIUC) is not enough for the reason mention above - if libvirt detects 'nbd-server-start' on both source and destination it won't even get to the 'blk' or 'inc' in migrate where an error would be thrown.

---
* - in fact, the command presence is checked on qemu startup and it's remembered. Moreover, if the command is presented all other nbd-server-* commands are assumed too. But their presence is not checked, though.

Comment 4 Michal Privoznik 2013-11-07 13:15:59 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2013-November/msg00239.html

Comment 7 zhe peng 2013-11-13 08:24:36 UTC
verify with build:
qemu-kvm-1.5.3-19.el7.x86_64
libvirt-1.1.1-12.el7.x86_64

step:
1: create migration env.
2: pre-create img on target host.
3: migrate guest with --copy-storage-all(migrate -b)
# virsh migrate --live --copy-storage-all rhel qemu+ssh://10.66.100.118/system --verbose --unsafe
root.100.118's password: 
error: internal error: unable to execute QEMU command 'migrate': this feature or command is not currently supported

check libvirtd log :
....
2013-11-13 07:31:27.827+0000: 6512: debug : qemuMigrationDriveMirror:1190 : Destination doesn't support NBD server Falling back to previous implementation.
....
2013-11-13 07:31:27.841+0000: 6512: debug : qemuMonitorJSONCheckError:343 : unable to execute QEMU command {"execute":"migrate","arguments":{"detach":true,"blk":true,"inc":false,"uri":"fd:migrate"},"id":"libvirt-19"}: {"id":"libvirt-19","error":{"class":"GenericError","desc":"this feature or command is not currently supported"}}
....

4: migrate guest with --copy-storage-inc(migrate -i)
# virsh migrate --live --copy-storage-inc rhel qemu+ssh://10.66.100.118/system --verbose --unsafe
root.100.118's password: 
error: internal error: unable to execute QEMU command 'migrate': this feature or command is not currently supported

check libvirtd log:
....
2013-11-13 08:15:59.789+0000: 6513: debug : qemuMigrationDriveMirror:1190 : Destination doesn't support NBD server Falling back to previous implementation.
....
2013-11-13 08:15:59.804+0000: 6513: debug : qemuMonitorJSONCheckError:343 : unable to execute QEMU command {"execute":"migrate","arguments":{"detach":true,"blk":false,"inc":true,"uri":"fd:migrate"},"id":"libvirt-33"}: {"id":"libvirt-33","error":{"class":"GenericError","desc":"this feature or command is not currently supported"}}
....

move to verified.

Comment 10 Ludek Smid 2014-06-13 12:21:11 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.