[Engine-devel] Problem with detachment of host interface using ovirt-sdk

Roy Golan rgolan at redhat.com
Sun Mar 25 06:51:06 UTC 2012


On 03/22/2012 10:43 AM, Itzik Brown wrote:
>
> Hi,
>
> I'm using ovirt-sdk to attach and detach a network to a host's Interface.
>
> Once the network is attached to the interface I try to detach the 
> network from the interface using the following steps:
>
> 1.Detach the network from the cluster through the GUI.
>
> 2.Remove the network from the datacenter through the GUI.
>
> 3.Detach the network from the host's interface using the SDK:
>
> nic = api.hosts.get(name=host).nics.get(name=if_name)
>
> net = params.Network(name=net_name)
>
> act = params.Action(network=net)
>
> nic.detach(act)
>
> api.hosts.get(name=host).commitnetconfig()
>
> Then I get the error:
>
> http://pastebin.com/3Md07huE
>
> The same flow using the GUI works fine.
>
> Network removal from the Datacenter is a trigger for me to run the 
> detachment operation therefore I use this flow.
>
> I use the following components:
>
> rhevm-3.0.2_0001-2
>
> ovirt-sdk (Using the latest from git repository)
>
> Please advise how to proceed.
>
> Thanks,
>
> Itzik
>
>
>
> This body part will be downloaded on demand.
Ovirt-sdk and rhevm don't comply (ovirt-sdk is based on the upstream 
version of rhevm)

Use the REST api instead:

curl -X POST user at domain:password -H "Content-Type: application/xml" 
-d@/path/to/file.xml 
https://rhevm:8843/api/hosts/{host-id}/nics/{nic-id}/detach

file.xml:

<action>
<host_nic>
<name>eth0</name>
</host_nic>
</action>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/engine-devel/attachments/20120325/15386e41/attachment.html>


More information about the Engine-devel mailing list