<div dir="ltr"><div><div>Thanks, can you post sample on Assigning Multiple Logical Network to Physical Network in Java?<br><br></div>I have create the Logical Network and attached to Cluster. Now i want to Assign or Map this to Physical Network? <br>
<br></div>Also, How to Bond Two Physical NICs and Map or Assign Multiple Logical Networks. <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 21, 2014 at 1:37 PM, Moti Asayag <span dir="ltr"><<a href="mailto:masayag@redhat.com" target="_blank">masayag@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">h<br>
<br>
----- Original Message -----<br>
> From: "Tejesh M" <<a href="mailto:tejeshmk@gmail.com">tejeshmk@gmail.com</a>><br>
> To: "users@oVirt.org" <<a href="mailto:users@ovirt.org">users@ovirt.org</a>><br>
> Sent: Thursday, February 20, 2014 11:48:56 AM<br>
> Subject: [Users] Creating Logical Network issue - API<br>
><br>
> Hi ,<br>
><br>
> I'm trying to create Logical Network and assign it to cluster & want to bond<br>
> this to one of the Network Interface on Host. so that i can isolate my VM<br>
> from other networks.<br>
><br>
> The issue is even if i set Cluster while creating Logical Network, it is not<br>
> setting the cluster. In Web Admin it is in unset state.<br>
><br>
> Also, let me know how do i bind this Logical network on Host Interface.<br>
><br>
> Java code:<br>
><br>
> Network nw1=new Network();<br>
> VLAN vlan = new VLAN();<br>
> vlan.setId(2000);<br>
> nw1.setVlan(vlan);<br>
> IP ip = new IP();<br>
> ip.setAddress("192.168.1.151");<br>
> ip.setGateway("192.168.1.1");<br>
> ip.setNetmask("255.255.255.0");<br>
<br>
Note that the stated IP above will not be used to set the address on the host itself.<br>
In order to do so you should use either the 'setup networks' api on host's nics level.<br>
(Alternately, you can send POST request to /hosts/{host:id}/nics which utilize the<br>
former api (it is a bit simpler than using the setup networks api).<br>
<br>
Should look like:<br>
Host host = api.getHosts().get("host_name");<br>
Action action = new Action();<br>
action.setCheckConnectivity(true); //required for rollback in case of configuration failure<br>
action.setHostNics(...); // should contain the target configuration<br>
host.getHostNics().setupnetworks(action);<br>
<br>
where the action should contain the entire desired network configuration.<br>
<br>
You can find various python-sdk example for setup networks on my blog [1]<br>
I'll post few examples using the java sdk earlier next week.<br>
<br>
[1] <a href="https://motiasayag.wordpress.com/" target="_blank">https://motiasayag.wordpress.com/</a><br>
<br>
> nw1.setIp(ip);<br>
> nw1.setName("apiNetwork");<br>
><br>
> nw1.setDataCenter(api.getDataCenters().get("testDC"));<br>
> nw1.setCluster(api.getClusters().get("testCluster"));<br>
><br>
> org.ovirt.engine.sdk.decorators.Network nw2 = api.getNetworks().add(nw1);<br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> Thanks & Regards<br>
> Tejesh<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>Thanks & Regards</div>
<div>Tejesh</div>
</div>