[Users] Creating Logical Network issue - API

Moti Asayag masayag at redhat.com
Thu Feb 20 22:42:16 UTC 2014



----- Original Message -----
> From: "Tejesh M" <tejeshmk at gmail.com>
> To: "users at oVirt.org" <users at ovirt.org>
> Sent: Thursday, February 20, 2014 11:48:56 AM
> Subject: [Users] Creating Logical Network issue - API
> 
> Hi ,
> 
> I'm trying to create Logical Network and assign it to cluster & want to bond
> this to one of the Network Interface on Host. so that i can isolate my VM
> from other networks.
> 
> The issue is even if i set Cluster while creating Logical Network, it is not
> setting the cluster. In Web Admin it is in unset state.
> 
> Also, let me know how do i bind this Logical network on Host Interface.
> 
> Java code:
> 
> Network nw1=new Network();
> VLAN vlan = new VLAN();
> vlan.setId(2000);
> nw1.setVlan(vlan);
> IP ip = new IP();
> ip.setAddress("192.168.1.151");
> ip.setGateway("192.168.1.1");
> ip.setNetmask("255.255.255.0");
> nw1.setIp(ip);
> nw1.setName("apiNetwork");
> 
> nw1.setDataCenter(api.getDataCenters().get("testDC"));
> nw1.setCluster(api.getClusters().get("testCluster"));
> 
> org.ovirt.engine.sdk.decorators.Network nw2 = api.getNetworks().add(nw1);

This part will only add the network in the data-center.
In order to attach it to a cluster, there is a need for a specific action:

api.getClusters().get("testCluster").getNetworks().add(nw2);

> 
> --
> Thanks & Regards
> Tejesh
> 
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 



More information about the Users mailing list