I use virsh
attach-disk to attach a volume to a running VM
After execution,
I use “virsh dumpxml“ to see the config and it shows
<disk
type='file' device='disk'>
<driver
name='file'/>
<source file='/tmp/testvolume'/>
<target dev='sdc' bus='scsi'/>
</disk>
The problem is, I can’t find the scsi disk, if I don’t
reboot this VM
Detach also causes some problems
I tried the following commands when VM is running
[root@localhost ~]# virsh detach-disk centos sdc
error: Failed to detach disk
error: POST operation failed: xend_post: error from xen daemon: (xend.err
'Device 2080 (vbd) could not be disconnected. ')
[root@localhost ~]# xm block-detach centos sdc
Error: Device sdc (vbd) could not be disconnected.
When VM is off
[root@localhost ~]# virsh detach-disk centos sdc
error: Failed to detach disk
error: Unknown failure
xm block-detach centos sdc can success.
any idea about this problem?