<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> <!--@import url(scrollbar.css); --></STYLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE> body{FONT-SIZE:12pt; FONT-FAMILY:宋体,serif;} </STYLE>
<META name=GENERATOR content="MSHTML 8.00.7600.16385"><BASE
target=_blank></HEAD>
<BODY
style="LINE-HEIGHT: 1.3; BORDER-RIGHT-WIDTH: 0px; MARGIN: 12px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px"
marginheight="0" marginwidth="0">
<DIV><FONT color=#000000 size=3 face=宋体>I have see this same
error on my debian OS(2.6.X kernel) without acpiphp and pci_hotplug
modules,</FONT></DIV>
<DIV>after I insert these two modules, the re-attachment works ok.</DIV>
<DIV> </DIV>
<DIV>With Windows OS, do you have install the virtio drivers(pci and
disk)?</DIV>
<DIV>because in my windows 7 the re-attachment works ok, too.</DIV>
<DIV>I thought windows 2008 has the same kernel with windows 7 (may be).</DIV>
<DIV> </DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana>2014-02-27</FONT></DIV>
<DIV align=left><FONT size=2 face=Verdana>
<HR style="WIDTH: 122px; HEIGHT: 2px" id=SignNameHR align=left SIZE=2>
</FONT></DIV>
<DIV align=left><FONT color=#c0c0c0 size=2 face=Verdana><SPAN
id=_FlashSignName>Wangpan</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Verdana>
<HR>
</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>发件人:</STRONG>Zuo Changqian
<dummyhacker85@gmail.com></FONT></DIV>
<DIV><FONT size=2
face=Verdana><STRONG>发送时间:</STRONG>2014-02-27 09:53</FONT></DIV>
<DIV><FONT size=2 face=Verdana><STRONG>主题:</STRONG>Re: [Openstack] [Nova] KVM
Windows Guest disk hot plugging support.</FONT></DIV>
<DIV><FONT size=2
face=Verdana><STRONG>收件人:</STRONG>"Zhangleiqiang"<zhangleiqiang@huawei.com></FONT></DIV>
<DIV><FONT size=2
face=Verdana><STRONG>抄送:</STRONG>"Openstack@lists.openstack.org"<openstack@lists.openstack.org></FONT></DIV>
<DIV><FONT size=2 face=Verdana></FONT> </DIV>
<DIV><FONT size=2 face=Verdana>
<DIV dir=ltr>I have tried, it would still fail. <BR><BR>Also I got something new
this morning, If I first remove the device (attached disk) inside Windows 2008,
and then call detach-volume command, the reattching will succeed.<BR><BR>I think
this is not a problem of Libvirt of KVM (Linux guest works perfectly), but a
problem of Windows operating system. That's why I asked whether Windows itself
support this disk hot plug in-and-out feature or not, if it can, how.<BR>
<DIV><BR></DIV>
<DIV>The following "newdisk.img" has been formatted with as a NTFS disk, and
there is some data inside. "instance-0000000d" is a Windows 2008 instance (I
reboot it before every test).<BR></DIV>
<DIV><BR>------------------------------------------------------------<BR>[root@nova02
temp]# ll<BR>total 1048584<BR>-rw-r--r-- 1 root root 1073741824 Feb 27 09:19
newdisk.img<BR>-rw-r--r-- 1 root root
120 Feb 25 16:12 newdisk.xml<BR><BR>[root@nova02 temp]# cat newdisk.xml
<BR><disk type='file' device='disk'><BR> <source
file='/home/temp/newdisk.img'/><BR> <target dev='vdb'
bus='virtio'/><BR></disk><BR>[root@nova02 temp]# virsh attach-device
instance-0000000d newdisk.xml <BR>Device attached
successfully<BR><BR>[root@nova02 temp]# virsh detach-device instance-0000000d
newdisk.xml <BR>Device detached successfully<BR><BR>[root@nova02 temp]# virsh
attach-device instance-0000000d newdisk.xml <BR>error: Failed to attach device
from newdisk.xml<BR>error: internal error unable to execute QEMU command
'__com.redhat_drive_add': Duplicate ID 'drive-virtio-disk1' for
drive<BR>-----------------------------------------------------------<BR><BR></DIV>
<DIV>I got same result with "virsh attach-disk"
command:<BR><BR>-----------------------------------------------------------<BR>[root@nova02
temp]# virsh attach-disk instance-0000000d /home/temp/newdisk.img vdb<BR>Disk
attached successfully<BR><BR>[root@nova02 temp]# virsh detach-disk
instance-0000000d vdb<BR>Disk detached successfully<BR><BR>[root@nova02 temp]#
virsh attach-disk instance-0000000d /home/temp/newdisk.img vdb<BR>error: Failed
to attach disk<BR>error: internal error unable to execute QEMU command
'__com.redhat_drive_add': Duplicate ID 'drive-virtio-disk1' for
drive<BR>----------------------------------------------------------<BR><BR><BR><BR></DIV></DIV>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>2014-02-26 17:40 GMT+08:00 Zhangleiqiang <SPAN
dir=ltr><<A href="mailto:zhangleiqiang@huawei.com"
target=_blank>zhangleiqiang@huawei.com</A>></SPAN>:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV lang=ZH-CN vlink="purple" link="blue">
<DIV>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d" lang=EN-US>Hi,
Changqian:<U></U><U></U></SPAN></P>
<P style="TEXT-INDENT: 21pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d"
lang=EN-US><U></U><U></U></SPAN> </P>
<P style="TEXT-INDENT: 21pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d" lang=EN-US>I think
it’s better to try using the corresponding detach command of libvirt (virsh
detach-disk or virsh detach-device) first, and see if the behavior is
expected. <U></U><U></U></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 14pt"
lang=EN-US><U></U><U></U></SPAN> </P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10.5pt"
lang=EN-US><U></U><U></U></SPAN> </P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10.5pt"
lang=EN-US><U></U><U></U></SPAN> </P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10.5pt"
lang=EN-US>----------<U></U><U></U></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10.5pt"
lang=EN-US>Leiqzhang<U></U><U></U></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10.5pt"
lang=EN-US><U></U><U></U></SPAN> </P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10.5pt"
lang=EN-US>Best Regards<U></U><U></U></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 10.5pt"
lang=EN-US><U></U><U></U></SPAN> </P>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: blue 1.5pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 4pt; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0cm">
<DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<P class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt"
lang=EN-US>From:</SPAN></B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt" lang=EN-US> Zuo
Changqian [mailto:<A href="mailto:dummyhacker85@gmail.com"
target=_blank>dummyhacker85@gmail.com</A>] <BR><B>Sent:</B> Wednesday,
February 26, 2014 3:49 PM<BR><B>To:</B> Gangur, Hrushikesh (R & D HP
Cloud)<BR><B>Cc:</B> <A href="mailto:Openstack@lists.openstack.org"
target=_blank>Openstack@lists.openstack.org</A><BR><B>Subject:</B> Re:
[Openstack] [Nova] KVM Windows Guest disk hot plugging
support.<U></U><U></U></SPAN></P></DIV></DIV>
<DIV>
<DIV class=h5>
<P class=MsoNormal><SPAN lang=EN-US><U></U><U></U></SPAN> </P>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN lang=EN-US>By the way,
it's Havana release.<U></U><U></U></SPAN></P></DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN lang=EN-US>We first found
this problem in Ubuntu 12.04 LTS guest, after loading "acpiphp" kernel module
at instance boot time, the problem solved.<U></U><U></U></SPAN></P></DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN lang=EN-US>Then we tested
using CentOS 6.x guest, it seems the code of "acpiphp" module has been
integrated into Linux kernel at compilation time. Nothing needs to been done,
it just works very well. You can freely attach and detach volumes when
instance is running.<U></U><U></U></SPAN></P></DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN lang=EN-US>But this does
not work for Windows guest, you can attach volumes, and you can detach, but it
seems still some information of disk remain in Windows guest, and you can not
attach a second time.<U></U><U></U></SPAN></P></DIV>
<P class=MsoNormal><SPAN lang=EN-US>A reboot do cleanup those remained
infomation, and we know this. I am wondering if this attach/detach can be all
done when Windows guest is running, just like it is done in Linux
guest.<U></U><U></U></SPAN></P>
<DIV>
<DIV>
<DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN
lang=EN-US><U></U><U></U></SPAN> </P></DIV></DIV></DIV></DIV>
<DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN
lang=EN-US><U></U><U></U></SPAN> </P>
<DIV>
<P class=MsoNormal><SPAN lang=EN-US>2014-02-26 15:07 GMT+08:00 Gangur,
Hrushikesh (R & D HP Cloud) <<A href="mailto:hrushikesh.gangur@hp.com"
target=_blank>hrushikesh.gangur@hp.com</A>>:<U></U><U></U></SPAN></P>
<DIV>
<DIV>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"
lang=EN-US>I have seen this issue on Linux VMs too. A reboot of the VM
instance helps workaround this.</SPAN><SPAN
lang=EN-US><U></U><U></U></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt"
lang=EN-US></SPAN><SPAN lang=EN-US><U></U><U></U></SPAN> </P>
<P class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt"
lang=EN-US>From:</SPAN></B><SPAN
style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt" lang=EN-US> Zuo
Changqian [mailto:<A href="mailto:dummyhacker85@gmail.com"
target=_blank>dummyhacker85@gmail.com</A>] <BR><B>Sent:</B> Tuesday, February
25, 2014 10:34 PM<BR><B>To:</B> <A href="mailto:Openstack@lists.openstack.org"
target=_blank>Openstack@lists.openstack.org</A><BR><B>Subject:</B> [Openstack]
[Nova] KVM Windows Guest disk hot plugging support.</SPAN><SPAN
lang=EN-US><U></U><U></U></SPAN></P>
<DIV>
<DIV>
<P class=MsoNormal><SPAN lang=EN-US><U></U><U></U></SPAN> </P>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN
lang=EN-US>Hi<BR><BR>Currently we use Cpeh RBD as cinder volume. According to
<A href="http://www.linux-kvm.org/page/Hotadd_pci_devices"
target=_blank>http://www.linux-kvm.org/page/Hotadd_pci_devices</A>, we have
Linux KVM guest (both CentOS 6.x and Ubuntu 12.04) support disk hot plugging,
it works well.<U></U><U></U></SPAN></P></DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN lang=EN-US>But there is
problem with Windows 2008 guest (2003 not tested). Described below:<BR><BR>1)
Launch an Windows 2008 instance (with RedHat Virtio Driver installed), and
attach a volume (newly created with nothing inside) to it, the volume would be
successfully attached to /dev/vdb.<U></U><U></U></SPAN></P></DIV>
<P class=MsoNormal><SPAN lang=EN-US>2) In Windows (guest machine), format this
newly added disk. After formatting, it will show up in "My Computer" windows.
Create any file (readme.txt with some text in it for example) inside the new
disk. Then deatch the volume.<BR><BR>After about one or two minute, a message
box would show up in Windows, saying that the device not properly removed, and
the newly added disk would still show in "My Computer" window. But with
"cinder list" command, we can see that the volume was successfully
detached.<BR><BR>3) Now reattach to volume to instance, it would
failed.<U></U><U></U></SPAN></P></DIV>
<P class=MsoNormal><SPAN lang=EN-US><U></U><U></U></SPAN> </P></DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN lang=EN-US>Libvirt log
shows: <U></U><U></U></SPAN></P>
<DIV>
<DIV>
<DIV>
<DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN lang=EN-US>error :
qemuMonitorJSONCheckError:357 : internal error unable to execute QEMU command
'__com.redhat_drive_add': Duplicate ID 'drive-virtio-disk1' for
drive<U></U><U></U></SPAN></P></DIV>
<DIV>
<P class=MsoNormal><SPAN lang=EN-US>I googled yesterday afternoon, didn't find
useful information. Would any one tell me whether Windows 2003/2008 as kvm
fully virtualized guest supports disk hot plugging and removing or not? Or any
possibility I have got something wrong?<U></U><U></U></SPAN></P></DIV>
<DIV>
<P class=MsoNormal><SPAN lang=EN-US><BR>Thanks for
help!<U></U><U></U></SPAN></P></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV>
<P class=MsoNormal><SPAN
lang=EN-US><U></U><U></U></SPAN> </P></DIV></DIV></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></FONT></DIV></BODY></HTML>