Bug 846703

Summary: Cannot add disk to vbox guest
Product: [Community] Virtualization Tools Reporter: cohoe
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DEFERRED QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: cohoe, crobinso, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-24 00:44:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description cohoe 2012-08-08 13:20:24 UTC
Description of problem:
Attaching a disk to an existing domain (either running or not) returns a very generic error (An error occurred, but the cause is unknown). I suspect that it is related to virDomainAttachDevice.

Version-Release number of selected component (if applicable):
Compiled against library: libvir 0.9.10
Using library: libvir 0.9.10
Using API: VBOX 0.9.10
Running hypervisor: VBOX 4.1.18

How reproducible:
Always

Steps to Reproduce:
1. Connect to VBox host with virsh (vbox:///session)
2. Attempt to connect a disk (attach-disk vbox-test01 /root/winxp.iso hdb --driver file --type cdrom --mode readonly)
  
Actual results:
error: Failed to attach disk
error: An error occurred, but the cause is unknown

Expected results:
Attached disk to domain

Additional info:
I receive the same error when attempting to attach an Interface. SELinux is disabled and all commands are being run as root. I suspect the root cause is that virDomainAttachDevice is not implemented for this driver, since performing similar actions on my ESX machine fails but returns a useful error (error: this function is not supported by the connection driver: virDomainAttachDevice). However I have no proof of this.

Comment 1 cohoe 2012-08-08 13:25:18 UTC
I am able to attach the disk fine if I modify the XML directly:

virsh -c vbox:///session 'destroy vbox-test01'
virsh -c vbox:///session 'undefine vbox-test01'

<disk type='file' device='cdrom'>
 <source file='/root/winxp.iso'/>
 <target dev='hdb' bus='ide'/>
</disk>

virsh -c vbox:///session 'define vbox-test01.xml'
virsh -c vbox:///session 'start vbox-test01'

Comment 2 cohoe 2012-08-09 13:07:51 UTC
This also affects library/API 0.9.13

Comment 3 Cole Robinson 2016-03-24 00:44:29 UTC
Sorry this bug never received a response. Given the age, and that the vbox driver was heavily reworked since then, I'm closing as DEFERRED since I assume this is fixed or no longer valid. But if anyone can still reproduce with recent libvirt and virtualbox, please reopen