Description of problem: We have a host with a bonded network interface with two slave interfaces. It is possible to attach virtual networks to this interface using the REST API: POST /hosts/aed416c1-97cd-4608-b9eb-fb6331b24e67/nics/65b9cc20-10a8-4b76-b28b-ba83dff9ba5b/attach '<action><network id="8d3a59e3-c34a-4eb0-b59e-6926fd38e3eb"/></action>' <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <action> <network id="8d3a59e3-c34a-4eb0-b59e-6926fd38e3eb"/> <status> <state>complete</state> </status> </action> However, detaching the same network after that fails: POST /hosts/aed416c1-97cd-4608-b9eb-fb6331b24e67/nics/65b9cc20-10a8-4b76-b28b-ba83dff9ba5b/detach '<action><network id="8d3a59e3-c34a-4eb0-b59e-6926fd38e3eb"/></action>' <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <action> <network id="8d3a59e3-c34a-4eb0-b59e-6926fd38e3eb"/> <status> <state>failed</state> </status> <fault> <reason>Operation Failed</reason> <detail>[Bond is not attached to Network.]</detail> </fault> </action> Version-Release number of selected component (if applicable): 3.3.3-2.el6 Steps to Reproduce: See above Actual results: See above Expected results: Network should be detached.
Livnat, I don't have an environment with bonding available to check this. Can you ask someone in your team to take a look?
sure, I'm adding Moti to take a look.
Hi Martin, Could you specify the definition of the network with id '8d3a59e3-c34a-4eb0-b59e-6926fd38e3eb' ? If that network was configured with a vlan id, you should send the detach request on the vlan device, i.e. bondx.y and not on the bond itself.
Hello Moti, thanks for the quick reply! Yes, the network is configured with a vlan id. I'll try detaching the network from the vlan interface and get back to you! Best regards, Martin
I sent the request to the vlan device, but am now receiving another error message: POST /hosts/aed416c1-97cd-4608-b9eb-fb6331b24e67/nics/3b7f53b6-a90b-46fe-afc9-0e728c440c6a/detach '<action/>' -H 'content-type: application/xml' <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <action> <status> <state>failed</state> </status> <fault> <reason>Operation Failed</reason> <detail>[Cannot edit Network while Host is Active, change the Host to Maintenance mode and try again.]</detail> </fault> </action> Detaching the network using the web interface works find, by the way. I also tried simply DELETEing the vlan interface using the REST API, which appears to kind-of work; but I'm wondering if simply deleting the interface instead of detaching the network may have any other kind of unwanted side-effects?
(In reply to Martin Helmich from comment #5) > I sent the request to the vlan device, but am now receiving another error > message: > > POST > /hosts/aed416c1-97cd-4608-b9eb-fb6331b24e67/nics/3b7f53b6-a90b-46fe-afc9- > 0e728c440c6a/detach '<action/>' -H 'content-type: application/xml' > <?xml version="1.0" encoding="UTF-8" standalone="yes"?> > <action> > <status> > <state>failed</state> > </status> > <fault> > <reason>Operation Failed</reason> > <detail>[Cannot edit Network while Host is Active, change the > Host to Maintenance mode and try again.]</detail> > </fault> > </action> > The 'detach' of a network via the api is a deprecated api which was developed for 3.0 clusters. Back there, the host had to be in maintenance mode in order to detach a network or to update a network on a nic. > Detaching the network using the web interface works find, by the way. > Via the UI (in cluster level >= 3.1) a new api is used, named setup-networks [1]. It allows to update a network when a host is active. The setup networks api is a bit more complex and requires the entire target topology to be sent. [1] www.ovirt.org/Features/Design/Network/SetupNetworks > I also tried simply DELETEing the vlan interface using the REST API, which > appears to kind-of work; but I'm wondering if simply deleting the interface > instead of detaching the network may have any other kind of unwanted > side-effects? The delete action is translated into 'remove-bond' action. So it seems it was designed for breaking a bond, but somehow it also supports the removal of a vlan network on top of a bond. Using DELETE method on top of a non-bond device will fail. So you can use this method which basically does what you intended to, or to use the setup-networks api. Since there is no bug here, i'm closing this one.