[Engine-devel] Problem with detachment of host interface using ovirt-sdk
Itzik Brown
ItzikB at mellanox.com
Mon Apr 2 07:45:38 UTC 2012
Hi,
I tried using ovirt-sdk against ovirt-engine-3.0.0_0001-1.6.
I still get the same result:
10:29:26,554 WARN [org.jboss.resteasy.core.SynchronousDispatcher] (http--0.0.0.0-8080-4) failed to execute: org.ovirt.engine.api.restapi.resource.BaseBackendResource$WebFaultException
at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handleError(BaseBackendResource.java:207) [restapi-jaxrs-3.0.0-0001.jar:]
at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handleError(BaseBackendResource.java:183) [restapi-jaxrs-3.0.0-0001.jar:]
at org.ovirt.engine.api.restapi.resource.BackendHostNicsResource.lookupNetwork(BackendHostNicsResource.java:242) [restapi-jaxrs-3.0.0-0001.jar:]
at org.ovirt.engine.api.restapi.resource.BackendHostNicResource.doAttachAction(BackendHostNicResource.java:56) [restapi-jaxrs-3.0.0-0001.jar:]
at org.ovirt.engine.api.restapi.resource.BackendHostNicResource.detach(BackendHostNicResource.java:75) [restapi-jaxrs-3.0.0-0001.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_24]
Please advise,
Itzik
________________________________
From: engine-devel-bounces at ovirt.org [engine-devel-bounces at ovirt.org] on behalf of Roy Golan [rgolan at redhat.com]
Sent: Sunday, March 25, 2012 8:51 AM
To: engine-devel at ovirt.org
Subject: Re: [Engine-devel] Problem with detachment of host interface using ovirt-sdk
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/20120402/61432b8f/attachment.html>
More information about the Engine-devel
mailing list