Bug 1437720 - After adding network interface volume status goes offline
Summary: After adding network interface volume status goes offline
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virtio-win
Version: unspecified
Hardware: Unspecified
OS: Windows
unspecified
medium
Target Milestone: ---
Assignee: Yvugenfi@redhat.com
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-31 01:47 UTC by Rohanil
Modified: 2017-05-21 07:05 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-21 07:05:28 UTC
Embargoed:


Attachments (Terms of Use)

Description Rohanil 2017-03-31 01:47:53 UTC
Description of problem:
I have virtual machine with windows guest OS. I have it on kvm/qemu hypervisor. I have 1 more volume attached to virtual machine except boot volume. Then I make volume status online using 'Disk Management' utility. Then I stop virtual machine and attach additional network interface to virtual machine. And I start vm. I check volume status and it shows offline. It should be online but becomes offline after adding device. By the way, I am using Openstack based cloud environment. 


Version-Release number of selected component (if applicable):
virtio-win : 0.1.134-3

Steps to Reproduce:
1. Create virtual machine with Windows 2012R2 guest OS.
2. Attach additional volume to vm other than boot volume.
3. Make volume status Online in guest using Disk Management utility.
4. Stop vm.
5. Attach additional network interface to vm.
6. Start vm.
7. Check volume status.

Actual results:
volume status becomes Offline

Expected results:
volume status should remain Online

Comment 1 Yvugenfi@redhat.com 2017-04-27 12:21:12 UTC
1. Is it the same VM image or you are recreating it from template?

2. How do you stop virtual machine? Shutdown from within or kill it?

3. As we do not experiencing such issues outside of OpenStack environment, please provide information regarding OpenStaick version and configuration.

Thanks.

Comment 2 Rohanil 2017-04-28 03:13:39 UTC
(In reply to Yan Vugenfirer from comment #1)
> 1. Is it the same VM image or you are recreating it from template?
> 
> 2. How do you stop virtual machine? Shutdown from within or kill it?
> 
> 3. As we do not experiencing such issues outside of OpenStack environment,
> please provide information regarding OpenStaick version and configuration.
> 
> Thanks.

1. I use same VM.
2. I stop it using Openstack GUI's Shutdown vm option. It basically uses nova's stop API.
3. I had this problem on Openstack's Juno and Mitaka versions.

Please let me know if you want more config info.

Thanks.

Comment 3 Peixiu Hou 2017-05-02 09:31:02 UTC
Hi,

I try to reproduce this issue with qemu command directly, but I cannot  reproduce it. Reproduce steps as follows:

1. Boot a win2012-r2 vm with a viostor booted volume.

/usr/libexec/qemu-kvm \
-name win2012-R2 \
-enable-kvm -m 2G -smp 2 -cpu SandyBridge -uuid ea78071a-f6e4-4347-8077-9cb9f7953a84 \
-nodefconfig --nodefaults -boot order=cd,menu=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=isa_serial0 -device usb-tablet,id=input0 \
-object iothread,id=thread0 -drive file=2012-r2.raw,if=none,id=drive-virtio-disk1,format=raw,serial=mike_cao1,cache=none -device virtio-blk-pci,iothread=thread0,bus=pci.0,drive=drive-virtio-disk1,id=virtio-disk1 \
-drive file=en_windows_server_2012_r2_x64_dvd_2707946.iso,media=cdrom,id=cdrom,if=none -device ide-drive,drive=cdrom,bootindex=1 \
-netdev tap,id=hostnet0,vhost=on,vhostforce=off \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:83:66:77:88:66,bus=pci.0,addr=0x4,status=on \
-vnc 0.0.0.0:0 -vga std -monitor stdio -qmp tcp:0:4445,server,nowait \

2. Hot plug a viostor data disk.
#telnet 10.66.4.129 4445
1){"execute": "qmp_capabilities"}
2){"execute":"__com.redhat_drive_add", "arguments": {"file":"test.raw","format":"raw","id":"drive-virtio-disk0"}}
3){"execute":"device_add","arguments":{"driver":"virtio-blk-pci","iothread":"thread0","drive":"drive-virtio-disk0","id":"virtio-disk0"}}

3. Make new added volume status Online in guest using Disk Management utility.

4. Shutdown the vm through cmd "shutdown -s -t 0".

5. Start the vm with new added viostor disk and another netkvm interface.
/usr/libexec/qemu-kvm \
-name win2012-R2 \
-enable-kvm -m 2G -smp 2 -cpu SandyBridge -uuid ea78071a-f6e4-4347-8077-9cb9f7953a84 \
-nodefconfig --nodefaults -boot order=cd,menu=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=isa_serial0 -device usb-tablet,id=input0 \
-object iothread,id=thread0 -drive file=2012-r2.raw,if=none,id=drive-virtio-disk1,format=raw,serial=mike_cao1,cache=none -device virtio-blk-pci,iothread=thread0,bus=pci.0,drive=drive-virtio-disk1,id=virtio-disk1 \
-drive file=en_windows_server_2012_r2_x64_dvd_2707946.iso,media=cdrom,id=cdrom,if=none -device ide-drive,drive=cdrom,bootindex=1 \
-netdev tap,id=hostnet0,vhost=on,vhostforce=off \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:83:66:77:88:66,bus=pci.0,addr=0x4,status=on \
-vnc 0.0.0.0:0 -vga std -monitor stdio -qmp tcp:0:4445,server,nowait \
-netdev tap,id=hostnet1,vhost=on,vhostforce=off \
-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:83:66:77:88:69,bus=pci.0,status=on \
-drive file=test.raw,if=none,id=drive-virtio-disk0,format=raw,serial=mike_cao,cache=none -device virtio-blk-pci,iothread=thread0,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0 \

6. Check volume status.

I also tried scenarios as follows:
1). viostor boot volume + 1 viostor data volume  --cannot reproduce
2). viostor boot volume + 1 vioscsi data volume  --cannot reproduce
3). vioscsi boot volume + 1 viostor data volume  --cannot reproduce
4). vioscsi boot volume + 1 vioscsi data volume  --cannot reproduce

After step6, the data volume shown online.

I'm not sure if these steps are match with your background running, could you help to confirm any difference with your background used? thanks a lot~


Best Regards~
Peixiu

Comment 4 Yvugenfi@redhat.com 2017-05-03 07:36:02 UTC
(In reply to Peixiu Hou from comment #3)
> Hi,
> 
> I try to reproduce this issue with qemu command directly, but I cannot 
> reproduce it. 
> 
> 4. Shutdown the vm through cmd "shutdown -s -t 0".
> 

That's the main question. If OpenStack kills VM, last setting might not be saved. And it is not related to addition of the network adapter.

Best regards,
Yan.

Comment 5 Yvugenfi@redhat.com 2017-05-17 07:33:16 UTC
(In reply to Rohanil from comment #0)
> Description of problem:
> I have virtual machine with windows guest OS. I have it on kvm/qemu
> hypervisor. I have 1 more volume attached to virtual machine except boot
> volume. Then I make volume status online using 'Disk Management' utility.
> Then I stop virtual machine and attach additional network interface to
> virtual machine. And I start vm. I check volume status and it shows offline.
> It should be online but becomes offline after adding device. By the way, I
> am using Openstack based cloud environment. 
> 
> 
> Version-Release number of selected component (if applicable):
> virtio-win : 0.1.134-3
> 
> Steps to Reproduce:
> 1. Create virtual machine with Windows 2012R2 guest OS.
> 2. Attach additional volume to vm other than boot volume.
> 3. Make volume status Online in guest using Disk Management utility.
> 4. Stop vm.
> 5. Attach additional network interface to vm.
> 6. Start vm.
> 7. Check volume status.
> 
> Actual results:
> volume status becomes Offline
> 
> Expected results:
> volume status should remain Online

Please provide the command line of QEMU for the first and second run.

It could be that the hotpluged and latter added device is not located on the same PCI slot and as a result Windows is treating it as different device (therefore settings for the devices are not reflected on a "new" device).

Comment 6 Yvugenfi@redhat.com 2017-05-18 11:42:48 UTC
(In reply to Peixiu Hou from comment #3)
> Hi,
> 
> I try to reproduce this issue with qemu command directly, but I cannot 
> reproduce it. Reproduce steps as follows:
> 
> 1. Boot a win2012-r2 vm with a viostor booted volume.
> 
> /usr/libexec/qemu-kvm \
> -name win2012-R2 \
> -enable-kvm -m 2G -smp 2 -cpu SandyBridge -uuid
> ea78071a-f6e4-4347-8077-9cb9f7953a84 \
> -nodefconfig --nodefaults -boot order=cd,menu=on \
> -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -chardev
> pty,id=charserial0 -device isa-serial,chardev=charserial0,id=isa_serial0
> -device usb-tablet,id=input0 \
> -object iothread,id=thread0 -drive
> file=2012-r2.raw,if=none,id=drive-virtio-disk1,format=raw,serial=mike_cao1,
> cache=none -device
> virtio-blk-pci,iothread=thread0,bus=pci.0,drive=drive-virtio-disk1,id=virtio-
> disk1 \
> -drive
> file=en_windows_server_2012_r2_x64_dvd_2707946.iso,media=cdrom,id=cdrom,
> if=none -device ide-drive,drive=cdrom,bootindex=1 \
> -netdev tap,id=hostnet0,vhost=on,vhostforce=off \
> -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:83:66:77:88:66,bus=pci.0,
> addr=0x4,status=on \
> -vnc 0.0.0.0:0 -vga std -monitor stdio -qmp tcp:0:4445,server,nowait \
> 
> 2. Hot plug a viostor data disk.
> #telnet 10.66.4.129 4445
> 1){"execute": "qmp_capabilities"}
> 2){"execute":"__com.redhat_drive_add", "arguments":
> {"file":"test.raw","format":"raw","id":"drive-virtio-disk0"}}
> 3){"execute":"device_add","arguments":{"driver":"virtio-blk-pci","iothread":
> "thread0","drive":"drive-virtio-disk0","id":"virtio-disk0"}}
> 
> 3. Make new added volume status Online in guest using Disk Management
> utility.
> 
> 4. Shutdown the vm through cmd "shutdown -s -t 0".
> 
> 5. Start the vm with new added viostor disk and another netkvm interface.
> /usr/libexec/qemu-kvm \
> -name win2012-R2 \
> -enable-kvm -m 2G -smp 2 -cpu SandyBridge -uuid
> ea78071a-f6e4-4347-8077-9cb9f7953a84 \
> -nodefconfig --nodefaults -boot order=cd,menu=on \
> -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -chardev
> pty,id=charserial0 -device isa-serial,chardev=charserial0,id=isa_serial0
> -device usb-tablet,id=input0 \
> -object iothread,id=thread0 -drive
> file=2012-r2.raw,if=none,id=drive-virtio-disk1,format=raw,serial=mike_cao1,
> cache=none -device
> virtio-blk-pci,iothread=thread0,bus=pci.0,drive=drive-virtio-disk1,id=virtio-
> disk1 \
> -drive
> file=en_windows_server_2012_r2_x64_dvd_2707946.iso,media=cdrom,id=cdrom,
> if=none -device ide-drive,drive=cdrom,bootindex=1 \
> -netdev tap,id=hostnet0,vhost=on,vhostforce=off \
> -device
> virtio-net-pci,netdev=hostnet0,id=net0,mac=52:83:66:77:88:66,bus=pci.0,
> addr=0x4,status=on \
> -vnc 0.0.0.0:0 -vga std -monitor stdio -qmp tcp:0:4445,server,nowait \
> -netdev tap,id=hostnet1,vhost=on,vhostforce=off \
> -device
> virtio-net-pci,netdev=hostnet1,id=net1,mac=52:83:66:77:88:69,bus=pci.0,
> status=on \
> -drive
> file=test.raw,if=none,id=drive-virtio-disk0,format=raw,serial=mike_cao,
> cache=none -device
> virtio-blk-pci,iothread=thread0,bus=pci.0,drive=drive-virtio-disk0,id=virtio-
> disk0 \
> 
> 6. Check volume status.
> 
> I also tried scenarios as follows:
> 1). viostor boot volume + 1 viostor data volume  --cannot reproduce
> 2). viostor boot volume + 1 vioscsi data volume  --cannot reproduce
> 3). vioscsi boot volume + 1 viostor data volume  --cannot reproduce
> 4). vioscsi boot volume + 1 vioscsi data volume  --cannot reproduce
> 
> After step6, the data volume shown online.
> 
> I'm not sure if these steps are match with your background running, could
> you help to confirm any difference with your background used? thanks a lot~
> 
> 
> Best Regards~
> Peixiu

It looks that the issue not related to virtio devices or drivers, but rather to the way the devices are added to QEMU.

If you supply exact bus address - the issue cannot be reproduced. If you don't - then from Windows point of view those are different devices - and therefor after network is added, storage device changes its bus location - and treated by Windows as a new device without existing configuration.

Comment 7 Daniel Berrangé 2017-05-18 12:18:14 UTC
(In reply to Yan Vugenfirer from comment #5)

> Please provide the command line of QEMU for the first and second run.
> 
> It could be that the hotpluged and latter added device is not located on the
> same PCI slot and as a result Windows is treating it as different device
> (therefore settings for the devices are not reflected on a "new" device).

That is exactly what is happening. Nova explicitly does not provide any stable PCI device addressing across cold boots, so if you hotplug / unplug devices, then next time you boot the image, their PCI addresses may all have been shuffled around.   Hotplugging/unplugging NICs in particular will always affect disks, because libvirt assigns PCI addresses to all NICs first, then to disk


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