
--_000_4488206DC085244C886DBC9E7038B6892516DF3Bmtrdag02mtlcom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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.Bas= eBackendResource$WebFaultException at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handle= Error(BaseBackendResource.java:207) [restapi-jaxrs-3.0.0-0001.jar:] at org.ovirt.engine.api.restapi.resource.BaseBackendResource.handle= Error(BaseBackendResource.java:183) [restapi-jaxrs-3.0.0-0001.jar:] at org.ovirt.engine.api.restapi.resource.BackendHostNicsResource.lo= okupNetwork(BackendHostNicsResource.java:242) [restapi-jaxrs-3.0.0-0001.jar= :] at org.ovirt.engine.api.restapi.resource.BackendHostNicResource.doA= ttachAction(BackendHostNicResource.java:56) [restapi-jaxrs-3.0.0-0001.jar:] at org.ovirt.engine.api.restapi.resource.BackendHostNicResource.det= ach(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(NativeMethodAccessor= Impl.java:57) [:1.6.0_24] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod= AccessorImpl.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@ovirt.org [engine-devel-bounces@ovirt.org] on be= half of Roy Golan [rgolan@redhat.com] Sent: Sunday, March 25, 2012 8:51 AM To: engine-devel@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 f= rom 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 =3D api.hosts.get(name=3Dhost).nics.get(name=3Dif_name) net =3D params.Network(name=3Dnet_name) act =3D params.Action(network=3Dnet) nic.detach(act) api.hosts.get(name=3Dhost).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 detachme= nt 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 versio= n of rhevm) Use the REST api instead: curl -X POST user@domain:password -H "Content-Type: application/xml" -d@/pa= th/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> --_000_4488206DC085244C886DBC9E7038B6892516DF3Bmtrdag02mtlcom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <html dir=3D"ltr"> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-= 1"> <style id=3D"owaParaStyle" type=3D"text/css"></style> </head> <body ocsi=3D"0" fpstyle=3D"1" bgcolor=3D"#FFFFFF"> <div style=3D"direction: ltr;font-family: Tahoma;color: #000000;font-size: = 10pt;">Hi,<br> <br> I tried using ovirt-sdk against ovirt-engine-3.0.0_0001-1.6.<br> I still get the same result:<br> <br> 10:29:26,554 WARN [org.jboss.resteasy.core.SynchronousDispatcher] (ht= tp--0.0.0.0-8080-4) failed to execute: org.ovirt.engine.api.restapi.resourc= e.BaseBackendResource$WebFaultException<br> at org.ovirt.engine.api.restapi.= resource.BaseBackendResource.handleError(BaseBackendResource.java:207) [res= tapi-jaxrs-3.0.0-0001.jar:]<br> at org.ovirt.engine.api.restapi.= resource.BaseBackendResource.handleError(BaseBackendResource.java:183) [res= tapi-jaxrs-3.0.0-0001.jar:]<br> at org.ovirt.engine.api.restapi.= resource.BackendHostNicsResource.lookupNetwork(BackendHostNicsResource.java= :242) [restapi-jaxrs-3.0.0-0001.jar:]<br> at org.ovirt.engine.api.restapi.= resource.BackendHostNicResource.doAttachAction(BackendHostNicResource.java:= 56) [restapi-jaxrs-3.0.0-0001.jar:]<br> at org.ovirt.engine.api.restapi.= resource.BackendHostNicResource.detach(BackendHostNicResource.java:75) [res= tapi-jaxrs-3.0.0-0001.jar:]<br> at sun.reflect.NativeMethodAcces= sorImpl.invoke0(Native Method) [:1.6.0_24]<br> at sun.reflect.NativeMethodAcces= sorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_24]<br> at sun.reflect.DelegatingMethodA= ccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_24]<br> at java.lang.reflect.Method.invo= ke(Method.java:616) [:1.6.0_24]<br> <br> Please advise,<br> Itzik<br> <br> <div style=3D"font-family: Times New Roman; color: #000000; font-size: 16px= "> <hr tabindex=3D"-1"> <div style=3D"direction: ltr;" id=3D"divRpF595604"><font color=3D"#000000" = face=3D"Tahoma" size=3D"2"><b>From:</b> engine-devel-bounces@ovirt.org [eng= ine-devel-bounces@ovirt.org] on behalf of Roy Golan [rgolan@redhat.com]<br> <b>Sent:</b> Sunday, March 25, 2012 8:51 AM<br> <b>To:</b> engine-devel@ovirt.org<br> <b>Subject:</b> Re: [Engine-devel] Problem with detachment of host interfac= e using ovirt-sdk<br> </font><br> </div> <div></div> <div>On 03/22/2012 10:43 AM, Itzik Brown wrote: <blockquote type=3D"cite"><style>=0A= <!--=0A= @font-face=0A= {font-family:"Cambria Math"}=0A= @font-face=0A= {font-family:Calibri}=0A= @font-face=0A= {font-family:"Courrier New"}=0A= p.MsoNormal, li.MsoNormal, div.MsoNormal=0A= {margin:0cm;=0A= margin-bottom:.0001pt;=0A= text-align:right;=0A= direction:rtl;=0A= unicode-bidi:embed;=0A= font-size:11.0pt;=0A= font-family:"Calibri","sans-serif"}=0A= a:link, span.MsoHyperlink=0A= {color:blue;=0A= text-decoration:underline}=0A= a:visited, span.MsoHyperlinkFollowed=0A= {color:purple;=0A= text-decoration:underline}=0A= span.EmailStyle17=0A= {font-family:"Calibri","sans-serif";=0A= color:windowtext}=0A= .MsoChpDefault=0A= {font-family:"Calibri","sans-serif"}=0A= @page WordSection1=0A= {margin:72.0pt 90.0pt 72.0pt 90.0pt}=0A= -->=0A= BODY {direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;}P = {margin-top:0;margin-bottom:0;}</style> <div class=3D"WordSection1"> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">Hi,</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">I'm using ovirt-sdk to attach and detach a network to a host's Int= erface.</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">Once the network is attached to the interface I try to detach the = network from the interface using the following steps:<span dir=3D"RTL" styl= e=3D"font-family:"Arial","sans-serif"" lang=3D"HE"></sp= an></p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">1.Detach the network from the cluster through the GUI.</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">2.Remove the network from the datacenter through the GUI.</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">3.Detach the network from the host's interface using the SDK:</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; text-autospace:none; direc= tion:ltr; unicode-bidi:embed"> <span style=3D"">nic =3D api.hosts.get(name=3Dhost).nics.get(name=3Dif_name= )<span style=3D"color:#404040; background:gray"></span></span></p> <p class=3D"MsoNormal" style=3D"text-align:left; text-autospace:none; direc= tion:ltr; unicode-bidi:embed"> <span style=3D"">net =3D params.Network(name=3Dnet_name)<span style=3D"colo= r:#404040; background:gray"></span></span></p> <p class=3D"MsoNormal" style=3D"text-align:left; text-autospace:none; direc= tion:ltr; unicode-bidi:embed"> <span style=3D"">act =3D params.Action(network=3Dnet)<span style=3D"color:#= 404040; background:gray"></span></span></p> <p class=3D"MsoNormal" style=3D"text-align:left; text-autospace:none; direc= tion:ltr; unicode-bidi:embed"> <span style=3D"">nic.detach(act)<span style=3D"color:#404040; background:gr= ay"></span></span></p> <p class=3D"MsoNormal" style=3D"text-align:left; text-autospace:none; direc= tion:ltr; unicode-bidi:embed"> <span style=3D"">api.hosts.get(name=3Dhost).commitnetconfig()<span style=3D= "color:#404040; background:gray"></span></span></p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">Then I get the error:</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"><a href=3D"http://pastebin.com/3Md07huE" target=3D"_blank">http://= pastebin.com/3Md07huE</a></p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">The same flow using the GUI works fine.</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">Network removal from the Datacenter is a trigger for me to run the= detachment operation therefore I use this flow.</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">I use the following components:</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"><span style=3D"">rhevm-3.0.2_0001-2</span></p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">ovirt-sdk (Using the latest from git repository)</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">Please advise how to proceed.</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed"> </p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">Thanks,</p> <p class=3D"MsoNormal" style=3D"text-align:left; direction:ltr; unicode-bid= i:embed">Itzik</p> </div> <br> <fieldset class=3D"mimeAttachmentHeader" target=3D"_blank"></fieldset> <br> <pre>This body part will be downloaded on demand.</pre> </blockquote> Ovirt-sdk and rhevm don't comply (ovirt-sdk is based on the upstream versio= n of rhevm)<br> <br> Use the REST api instead:<br> <br> curl -X POST user@domain:password -H "Content-Type: application/xml&qu= ot; -d@/path/to/file.xml <a class=3D"moz-txt-link-freetext" href=3D"https://rhevm:8843/api/hosts/" t= arget=3D"_blank"> https://rhevm:8843/api/hosts/</a>{host-id}/nics/{nic-id}/detach<br> <br> file.xml:<br> <br> <action><br> <host_nic><br> <name>eth0</name><br> </host_nic><br> </action><br> </div> </div> </div> </body> </html> --_000_4488206DC085244C886DBC9E7038B6892516DF3Bmtrdag02mtlcom_--