On Thu, Feb 16, 2012 at 10:55:16AM +0800, Lei Li wrote:
> On 02/16/2012 07:22 AM, Adam Litke wrote:
> >On Wed, Feb 15, 2012 at 06:36:48PM +0200, Dan Kenigsberg wrote:
> >>On Thu, Feb 16, 2012 at 12:05:16AM +0800, Lei Li wrote:
> >>>Hi,
> >>>
> >>>We are working on VDSM network REST APIs, to support the functions we need 
> >>>to get
> >>>the list of configured networks. I found that VDSM network has a function
> >>>'listNetworks' in configNetwork.py. It can get and display the current 
> >>>configured
> >>>network like this:
> >>>
> >>># python configNetwork.py list
> >>>Networks: ['bridge_one', 'bridge_three', 'bridge_two']
> >>>Vlans: []
> >>>Nics: ['eth0']
> >>>Bondings: []
> >>>
> >>>But there are some problems with it. It can not display the defined 
> >>>networks after
> >>>host restart, but the created config file are still 
> >>>there(/etc/sysconfig/network-scripts/..).
> >>>Did I miss anything? Or Is there some way to avoid this?
> >>>
> >>>Your suggestion and thoughts would be appreciated.
> >Lei, on my vdsm host, running python /usr/share/vdsm/configNetwork.py list 
> >gives
> >me the following output:
> >
> >Networks: ['ovirtmgmt']
> >Vlans: []
> >Nics: ['eth1', 'eth0']
> >Bondings: ['bond4', 'bond0', 'bond1', 'bond2', 'bond3']
> >
> >and python /usr/share/vdsm/configNetwork.py show ovirtmgmt gives:
> >
> >Bridge ovirtmgmt: vlan=None, bonding=None, nics=['eth0']
> >
> >These results are what I would expect to see.
> Hi Adam,
> That's strange...did you reboot your host?
> I get this after the host reboot:
> #python configNetwork.py list
> Networks: []
> Vlans: []
> Nics: ['eth0']
> Bondings: []
> I guess maybe I miss something...:(
> >
> >>Could you describe how you reproduce the problem (with as much details)?
> >>You define a network, persist it, and restart the host?
> Hi Dan,
> Yes, that is what I do. My step is just add a network(like bridge_one), I did 
> not
> do the persistence action, the added config file is still there but not for 
> the
> output of 'configNetwork.py list' after host reboot.
> How can I persist the defined network?

You should call the verb setSafeNetConfig in order to keep your current
network configuration for next reboot.

> >Hi Dan.  As I understand it there is not a problem with vdsm in this regard.
> >Lei is trying to model the current networking APIs in REST.  To do this you
> >might have something like:
> >
> >/vdsm-api/networks/ ..................Get a list of bridges configured for 
> >vdsm
> >/vdsm-api/networks/confirm............Mark the current network config as safe
> >/vdsm-api/networks/add................Add a new network
> >/vdsm-api/networks/ovirtmgmt/.........View details of the ovirtmgmt network
> >/vdsm-api/networks/ovirtmgmt/edit.....Edit the ovirtmgmt network
> >/vdsm-api/networks/ovirtmgmt/delete...Delete the ovirtmgmt network
> >
> >The current vdsm API lacks a facility to display the /vdsm-api/networks/ URI
> >because there is no function to get such a list.  To create such an API, one
> >might call out to 'configNetwork.py list'.  Is there support for adding such 
> >an
> >API to API.py?  How about an API to fetch network info via
> >configNetwork.py show?

Among a lot of other stuff, getVdsCaps returns a dictionary named
'networks'. Hey, I can even see me mentioning this verb down below!
I believe this is what you are looking for.

> >
> >Also, I think the networking APIs should be organized into a Network class 
> >within API.py.
> >
> Yes, we need to get a list of configured networks as Adam said. and we are
> wondering If function 'listNetworks' in configNetwork.py can support it.
> >>Did Vdsm restart after boot? What is reported by getVdsCaps ?
vdsm-devel mailing list

Reply via email to