----- Original Message -----
From: "Tejesh M" <tejeshmk(a)gmail.com>
To: "users(a)oVirt.org" <users(a)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(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/users