[libvirt-users] Detach disk from VM - virsh (working) vs. PHP (not working)

Michal Prívozník mprivozn at redhat.com
Sat Aug 3 06:54:16 UTC 2019


On 8/2/19 6:26 PM, Jan Horak wrote:
> Thank you for your help!
> 
> 1, i used vda as install disk and vdb as target disk, because i boot from the first. After setup boot order flag i was able change install disk to vdb and target disk to vda. With this configuration when i boot from vdb i can install OS with grub and after it redefine XML without vdb without problem. Thanks a lot.
> 
> 2, maybe i have something wrong, but still not working:
> 
> Now in libvirt log i got error: device not found: no target device vdb

Ah, of coure. I overlooked that virDomainDetachDeviceFlags() is called
with VIR_DOMAIN_AFFECT_CONFIG, which means that live configuration is
not affected and if the disk you're trying to detach exists only in live
XML then the API fails. The same problem was found in
libvirt_domain_disk_add, libvirt_domain_nic_add and
libvirt_domain_nic_remove.

I've pushed the fixes to the master. Thanks for the report.

Michal




More information about the libvirt-users mailing list