Bug 1005103 - Migration should fail when migrate guest offline to a file which is specified to a readonly directory.
Migration should fail when migrate guest offline to a file which is specified...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Juan Quintela
Virtualization Bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-06 04:44 EDT by Qian Guo
Modified: 2014-06-17 23:36 EDT (History)
10 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-53.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 07:57:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Qian Guo 2013-09-06 04:44:11 EDT
Description of problem:
When test guest migration offline to a file specified to a readonly directory, the migration does not fail, but complete, this is not expected.

Version-Release number of selected component (if applicable):
# uname -r
3.10.0-15.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.5.3-2.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Set up a nfs server that is readonly
# cat /etc/exports
/home/ *(ro,no_root_squash,sync)

2.mount this nfs server to host.
#mount 
...
10.66.7.126:/home on /opt/mt type nfs4 (ro,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.66.7.126,local_lock=none,addr=10.66.7.126)
...

3.Boot guest in this host
# /usr/libexec/qemu-kvm -cpu Penryn -enable-kvm -m 4096 -smp 4,sockets=1,cores=4,threads=1 -name rhel7base  -drive file=/mnt/rhel7cp1.qcow2_v3,if=none,id=drive-virtio-disk0,format=qcow2,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -boot menu=on -monitor stdio -netdev tap,id=hostnet0,ifname=guest1,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,vhost=on -device virtio-net,netdev=hostnet0,mac=54:52:1b:35:3c:16,id=test -nodefaults -nodefconfig -spice port=5930,seamless-migration=on,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864   -device virtio-balloon-pci,id=balloon1 -qmp tcp:0:4446,server,nowait  -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -serial unix:/tmp/qiguo,server,nowait

4.Try migrate this guest offline to this readonly directory.
(qemu) migrate -d "exec:gzip -c >/opt/mt/test.gz"
(qemu) sh: /opt/mt/test.gz: Read-only file system

Actual results:
Though when start migrate guest, it prompt:
(qemu) sh: /opt/mt/test.gz: Read-only file system

but the migration is still in process, and can complete:
(qemu) info migrate
capabilities: xbzrle: off auto-converge: off 
Migration status: completed
total time: 24228 milliseconds
downtime: 1393 milliseconds
transferred ram: 707774 kbytes
remaining ram: 0 kbytes
total ram: 4325832 kbytes
duplicate: 921664 pages
skipped: 0 pages
normal: 174577 pages
normal bytes: 698308 kbytes

(qemu) info status
VM status: paused (postmigrate)



Expected results:
migration failed, and guest did not access paused (postmigrate) state, should still in running.

Additional info:
Comment 1 Qian Guo 2013-09-06 04:53:09 EDT
Hit same problem when test migration offline in an NO_ENOUGH_SPACE location:

when start migrate, qemu can prompt the info:
gzip: stdout: No space left on device

but migration can still continue and complete:

 (qemu) info migrate
 capabilities: xbzrle: off auto-converge: off 
 Migration status: completed
 total time: 15890 milliseconds
 downtime: 26 milliseconds
 transferred ram: 486519 kbytes
 remaining ram: 0 kbytes
 total ram: 1180104 kbytes
 duplicate: 180757 pages
 skipped: 0 pages
 normal: 120996 pages
 normal bytes: 483984 kbytes
 (qemu) info status
 VM status: paused (postmigrate)
Comment 3 Juan Quintela 2014-02-11 12:22:22 EST
It works for me: (/mnt/mirror is mounted readonly)

root@deus ~]# touch /mnt/mirror/kkk
touch: cannot touch `/mnt/mirror/kkk': Read-only file system
[root@deus ~]# mount | grep mirror
nfs:/mnt/mirror on /mnt/mirror type nfs4 (rw,addr=192.168.10.200,clientaddr=192.168.10.231)

As you can see, just after doing it, migrate gives the error.

migrate -d "exec:gzip -c > /mnt/mirror/kk.gz"
migrate: failed to popen the migration target: Cannot allocate memory
(qemu) info status
VM status: running
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: failed
total time: 0 milliseconds
(qemu)
Comment 4 Juan Quintela 2014-02-11 17:09:22 EST
Forget previous comment.  I was doing something wrong and migration was failing for something different :p
Comment 7 Miroslav Rezanina 2014-03-12 04:45:55 EDT
Fix included in qemu-kvm-1.5.3-53.el7
Comment 9 huiqingding 2014-03-17 21:16:23 EDT
Reproduce this bug using the following version:
qemu-kvm-1.5.3-35.el7.x86_64
kernel-3.10.0-107.el7.x86_64

Steps to Reproduce:
1.Set up a nfs server that is readonly
# cat /etc/exports
/home/ *(ro,no_root_squash,sync)

2.mount this nfs server to host.
#mount 
...
10.66.106.3:/home on /opt/mnt type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.66.5.112,local_lock=none,addr=10.66.106.3)
...

3.Boot guest in this host
# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4096 -smp 4,sockets=1,cores=4,threads=1 -name rhel7base  -drive file=/mnt/rhel7.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -boot menu=on -monitor stdio -netdev tap,id=hostnet0,ifname=guest1,script=/etc/qemu-ifup,vhost=on -device virtio-net,netdev=hostnet0,mac=54:52:1b:35:3c:16,id=test -nodefaults -nodefconfig -spice port=5930,seamless-migration=on,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864   -device virtio-balloon-pci,id=balloon1 -qmp tcp:0:4446,server,nowait  -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -serial unix:/tmp/qiguo,server,nowait -vnc :3


4.Try migrate this guest offline to this readonly directory.
(qemu) migrate -d "exec:gzip -c >/opt/mnt/test.gz"
(qemu) sh: /opt/mt/test.gz: Read-only file system

Actual results:
hough when start migrate guest, it prompt:
(qemu) sh: /opt/mnt/test.gz: Read-only file system

but the migration is still in process, and can complete:
(qemu) info migrate
capabilities: xbzrle: off auto-converge: off 
Migration status: completed
total time: 24228 milliseconds
downtime: 1393 milliseconds
transferred ram: 707774 kbytes
remaining ram: 0 kbytes
total ram: 4325832 kbytes
duplicate: 921664 pages
skipped: 0 pages
normal: 174577 pages
normal bytes: 698308 kbytes

(qemu) info status
VM status: paused (postmigrate)

Verify this bug using the following version:
qemu-kvm-1.5.3-53.el7.x86_64
kernel-3.10.0-107.el7.x86_64

Steps to Reproduce:
1.Set up a nfs server that is readonly
# cat /etc/exports
/home/ *(ro,no_root_squash,sync)

2.mount this nfs server to host.
#mount 
...
10.66.106.3:/home on /opt/mnt type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.66.5.112,local_lock=none,addr=10.66.106.3)
...

3.Boot guest in this host
# /usr/libexec/qemu-kvm -cpu SandyBridge -enable-kvm -m 4096 -smp 4,sockets=1,cores=4,threads=1 -name rhel7base  -drive file=/mnt/rhel7.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -boot menu=on -monitor stdio -netdev tap,id=hostnet0,ifname=guest1,script=/etc/qemu-ifup,vhost=on -device virtio-net,netdev=hostnet0,mac=54:52:1b:35:3c:16,id=test -nodefaults -nodefconfig -spice port=5930,seamless-migration=on,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864   -device virtio-balloon-pci,id=balloon1 -qmp tcp:0:4446,server,nowait  -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -serial unix:/tmp/qiguo,server,nowait -vnc :3


4.Try migrate this guest offline to this readonly directory.
(qemu) migrate -d "exec:gzip -c >/opt/mnt/test.gz"
(qemu) sh: /opt/mt/test.gz: Read-only file system

Actual results:
after step4, the migration is failed and the guest is running as following:
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: failed
total time: 0 milliseconds
(qemu) info status
VM status: running

Based on the above results, I think this bug has been fixed.
Comment 11 Ludek Smid 2014-06-13 07:57:41 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.