[ovirt-devel] Fwd: Got an error after buuilding VDSM on latest upstream commit

2014-11-30 Thread ybronhei

forwarding to devels

anyone familiar with the issue already ? any ready patch?


 Forwarded Message 
Subject: Got an error after buuilding VDSM on latest upstream commit
Date: Sun, 30 Nov 2014 05:54:45 -0500 (EST)
From: Eli Mesika emes...@redhat.com
To: Dan Kenigsberg dan...@redhat.com, Saggi Mizrahi 
smizr...@redhat.com, ybronhei ybron...@redhat.com, Dima Kuznetsov 
dkuzn...@redhat.com

CC: Oved Ourfali oourf...@redhat.com, Barak Azulay bazu...@redhat.com

vdsm: Running restore_nets
libvirt: Network Driver error : Network not found: no network with 
matching name 'vdsm-ovirtmgmt'

^X^CTraceback (most recent call last):
  File /usr/share/vdsm/vdsm-restore-net-config, line 139, in module
restore()
  File /usr/share/vdsm/vdsm-restore-net-config, line 125, in restore
unified_restoration()
  File /usr/share/vdsm/vdsm-restore-net-config, line 70, in 
unified_restoration

setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True)
  File /usr/share/vdsm/network/api.py, line 715, in setupNetworks
implicitBonding=True, _netinfo=_netinfo, **d)
  File /usr/share/vdsm/network/api.py, line 221, in wrapped
ret = func(**attrs)
  File /usr/share/vdsm/network/api.py, line 310, in addNetwork
netEnt.configure(**options)
  File /usr/share/vdsm/network/models.py, line 196, in configure
self.configurator.configureBridge(self, **opts)
  File /usr/share/vdsm/network/configurators/ifcfg.py, line 92, in 
configureBridge

ifup(bridge.name, bridge.ipConfig.async)
  File /usr/share/vdsm/network/configurators/ifcfg.py, line 820, in ifup
rc, out, err = _ifup(iface)
  File /usr/share/vdsm/network/configurators/ifcfg.py, line 804, in _ifup
rc, out, err = utils.execCmd([constants.EXT_IFUP, netIf], raw=False)
  File /usr/lib/python2.6/site-packages/vdsm/utils.py, line 622, in 
execCmd

(out, err) = p.communicate(data)
  File /usr/lib64/python2.6/subprocess.py, line 732, in communicate
stdout, stderr = self._communicate(input, endtime)
  File /usr/lib64/python2.6/subprocess.py, line 1316, in _communicate
stdout, stderr = self._communicate_with_poll(input, endtime)
  File /usr/lib64/python2.6/subprocess.py, line 1388, in 
_communicate_with_poll

ready = poller.poll(self._remaining_time(endtime))



Any ideas ???

Thanks
Eli Mesika


--
Yaniv Bronhaim.


___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel


Re: [ovirt-devel] Fw: Some ideas on oVirt Java SDK

2014-11-30 Thread Michael Pasternak
Hey Vojtech,

How are you?, please see my reply inline.



On Friday, November 28, 2014 5:26 PM, Vojtech Szocs vsz...@redhat.com
 wrote:


 Hi guys,

 since the initial (small, working  well-tested) version of oVirtJS
 JavaScript SDK is finished [*], I've started working on GWT wrapper
 for oVirtJS.

 While analyzing/reverse-engineering oVirt Java SDK, some thoughts
 came to my mind, and I wanted to share them with you.

 [*] TODO(vszocs) upload new patchset with all recent changes

 First, the way XJC (JAXB binding compiler that generates Java beans
 out of REST XSD schema) is invoked looks a bit weird to me, as Java
 SDK's XsdCodegen does this:

   Runtime.getRuntime().exec(command)

 Why not simply use existing Maven plugins to invoke XJC?
 - either: https://github.com/highsource/maven-jaxb2-plugin


it was using jaxb to begin with, but Juan has replaced it with XJC,
btw Juan, what was the motivation behind this?
(REST api uses jaxb as well so we used to have 1x1 mappings)


 - or: http://mojo.codehaus.org/jaxb2-maven-plugin/


same.



 Second, and most importantly, what's the point of having group
 entities? I'll give an example - api.xsd contains this:

   xs:complexType name=DataCenters
 xs:complexContent
   xs:extension base=BaseResources
 xs:sequence
   xs:annotation
 xs:appinfo
 jaxb:property name=DataCenters/
 /xs:appinfo
   /xs:annotation
   xs:element ref=data_center minOccurs=0
 maxOccurs=unbounded/
 /xs:sequence
   /xs:extension
 /xs:complexContent
   /xs:complexType

 (Same as above for Hosts, Clusters, VMs, etc.)

 This results in following (IMHO rather meaningless) Java class
 being generated by XJC:

 public class DataCenters extends BaseResources {

 @XmlElement(name = data_center)
 protected ListDataCenter dataCenters;

 public ListDataCenter getDataCenters() {
 if (dataCenters == null) {
 dataCenters = new ArrayListDataCenter();
 }
 return this.dataCenters;
 }

 public boolean isSetDataCenters() {
 return ((this.dataCenters!= null)(!this.dataCenters.isEmpty()));
 }

 public void unsetDataCenters() {
 this.dataCenters = null;
 }

 }

 Instead, we could use @XmlElementWrapper as described in [1]
 to avoid generating group entities altogether.

 [1] https://github.com/dmak/jaxb-xew-plugin

 The fact that Java SDK provides decorator for each specific
 resource collection (like DataCenters), instead of having ONE
 resource collection type, greatly complicates overall design
 and code-gen aspect.


well, i guess now is speaking JS constraints ghost, am i right?,
at any case, the reasons for having decorator per collection are:

1. compliance with REST API (all SDKs and REST api sharing same well know
architecture)
2. decorator is a well known and commonly used java design pattern
3. having one resource type serving all collections would create a
bottleneck
(well it might depend on how you implementing it, but still in my view it's
less convenient/readable
than dedicated collection with own context, verbs and behaviour)

after all the purpose of sdk is being java client serving java application
in Java way
while JS use-case  paradigms are totally different.



 In oVirtJS GWT wrapper, we'll avoid above complication through
 single resource collection type (having common methods like
 get(id), list() etc) for all resources.


 Regards,
 Vojtech
 ___
 Devel mailing list
 Devel@ovirt.org
 http://lists.ovirt.org/mailman/listinfo/devel





-- 

Michael Pasternak
___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel

Re: [ovirt-devel] Some ideas on oVirt Java SDK

2014-11-30 Thread Michael Pasternak
Hey Vojtech,

How are you?, please see my reply inline.




  On Friday, November 28, 2014 5:26 PM, Vojtech Szocs vsz...@redhat.com 
wrote:
   

 Hi guys,

since the initial (small, working  well-tested) version of oVirtJS
JavaScript SDK is finished [*], I've started working on GWT wrapper
for oVirtJS.

While analyzing/reverse-engineering oVirt Java SDK, some thoughts
came to my mind, and I wanted to share them with you.

[*] TODO(vszocs) upload new patchset with all recent changes

First, the way XJC (JAXB binding compiler that generates Java beans
out of REST XSD schema) is invoked looks a bit weird to me, as Java
SDK's XsdCodegen does this:

  Runtime.getRuntime().exec(command)

Why not simply use existing Maven plugins to invoke XJC?
- either: https://github.com/highsource/maven-jaxb2-plugin


[MP] sdk was using jaxb to begin with, it was replaced with XJC just recently,
btw Juan, what was the motivation behind this? 
(REST api uses jaxb as well so we used to have 1x1 mappings)
 
- or: http://mojo.codehaus.org/jaxb2-maven-plugin/


[MP] same.



Second, and most importantly, what's the point of having group
entities? I'll give an example - api.xsd contains this:

  xs:complexType name=DataCenters
    xs:complexContent
      xs:extension base=BaseResources
        xs:sequence
          xs:annotation
            xs:appinfo
                jaxb:property name=DataCenters/
            /xs:appinfo
          /xs:annotation
          xs:element ref=data_center minOccurs=0 maxOccurs=unbounded/
        /xs:sequence
      /xs:extension
    /xs:complexContent
  /xs:complexType

(Same as above for Hosts, Clusters, VMs, etc.)

This results in following (IMHO rather meaningless) Java class
being generated by XJC:

public class DataCenters extends BaseResources {

    @XmlElement(name = data_center)
    protected ListDataCenter dataCenters;

    public ListDataCenter getDataCenters() {
        if (dataCenters == null) {
            dataCenters = new ArrayListDataCenter();
        }
        return this.dataCenters;
    }

    public boolean isSetDataCenters() {
        return ((this.dataCenters!= null)(!this.dataCenters.isEmpty()));
    }

    public void unsetDataCenters() {
        this.dataCenters = null;
    }

}

Instead, we could use @XmlElementWrapper as described in [1]
to avoid generating group entities altogether.

[1] https://github.com/dmak/jaxb-xew-plugin

The fact that Java SDK provides decorator for each specific
resource collection (like DataCenters), instead of having ONE
resource collection type, greatly complicates overall design
and code-gen aspect.


[MP] Well, i guess now is speaking JS constraints ghost, am i right?,
in any case, the reasons for having decorator per collection are:

1. compliance with REST API (all SDKs and REST api are sharing same well know 
architecture)
2. decorator is a well known and commonly used java design pattern
3. having one resource type serving all collections would create a bottleneck
(well it might depend on how you implementing it, but still in my view it's 
less convenient/readable
than dedicated collection with own context, verbs and behavior), 
after all the purpose of sdk is being java client serving application in Java 
way(i.e type-safe + well bounded interface), while JS use-cases  paradigms are 
totallydifferent, just consider:
[1] java-sdk stile
Disk snapshotDisk = 
api.getVms().get('my-vm').getSnapshots().get('my-snapshot').getDisks().get('my-disk')
[2] JS style you propose
Disk snapshotDisk = getCollections().get(new Params[] { Disk.class, 'my-vm', 
'my-snapshot', 'my-disk'})

notice: =
in [2] you have a bunch of parameters disconnected form any context where 
orderis *important* (other way you heuristic guesses what user meaning by these 
params won't work),obviously it's fragile and error prone,
while [1] is readable, well bounded, defending it's consumers from potentials 
errors(exactly what SDK should look like),
hope it helps.



 

 On Friday, November 28, 2014 5:26 PM, Vojtech Szocs vsz...@redhat.com 
wrote:
   

 Hi guys,

since the initial (small, working  well-tested) version of oVirtJS
JavaScript SDK is finished [*], I've started working on GWT wrapper
for oVirtJS.

While analyzing/reverse-engineering oVirt Java SDK, some thoughts
came to my mind, and I wanted to share them with you.

[*] TODO(vszocs) upload new patchset with all recent changes

First, the way XJC (JAXB binding compiler that generates Java beans
out of REST XSD schema) is invoked looks a bit weird to me, as Java
SDK's XsdCodegen does this:

  Runtime.getRuntime().exec(command)

Why not simply use existing Maven plugins to invoke XJC?
- either: https://github.com/highsource/maven-jaxb2-plugin
- or: http://mojo.codehaus.org/jaxb2-maven-plugin/

Second, and most importantly, what's the point of having group
entities? I'll give an example - api.xsd contains this:

  xs:complexType name=DataCenters
    xs:complexContent
      xs:extension base=BaseResources
        

Re: [ovirt-devel] Fwd: Got an error after buuilding VDSM on latest upstream commit

2014-11-30 Thread Dan Kenigsberg
On Sun, Nov 30, 2014 at 01:00:28PM +0200, ybronhei wrote:
 forwarding to devels
 
 anyone familiar with the issue already ? any ready patch?
 
 
  Forwarded Message 
 Subject: Got an error after buuilding VDSM on latest upstream commit
 Date: Sun, 30 Nov 2014 05:54:45 -0500 (EST)
 From: Eli Mesika emes...@redhat.com
 To: Dan Kenigsberg dan...@redhat.com, Saggi Mizrahi smizr...@redhat.com,
 ybronhei ybron...@redhat.com, Dima Kuznetsov dkuzn...@redhat.com
 CC: Oved Ourfali oourf...@redhat.com, Barak Azulay bazu...@redhat.com
 
 vdsm: Running restore_nets
 libvirt: Network Driver error : Network not found: no network with matching
 name 'vdsm-ovirtmgmt'
 ^X^CTraceback (most recent call last):
   File /usr/share/vdsm/vdsm-restore-net-config, line 139, in module
 restore()
   File /usr/share/vdsm/vdsm-restore-net-config, line 125, in restore
 unified_restoration()
   File /usr/share/vdsm/vdsm-restore-net-config, line 70, in
 unified_restoration
 setupNetworks(nets, bonds, connectivityCheck=False, _inRollback=True)
   File /usr/share/vdsm/network/api.py, line 715, in setupNetworks
 implicitBonding=True, _netinfo=_netinfo, **d)
   File /usr/share/vdsm/network/api.py, line 221, in wrapped
 ret = func(**attrs)
   File /usr/share/vdsm/network/api.py, line 310, in addNetwork
 netEnt.configure(**options)
   File /usr/share/vdsm/network/models.py, line 196, in configure
 self.configurator.configureBridge(self, **opts)
   File /usr/share/vdsm/network/configurators/ifcfg.py, line 92, in
 configureBridge
 ifup(bridge.name, bridge.ipConfig.async)
   File /usr/share/vdsm/network/configurators/ifcfg.py, line 820, in ifup
 rc, out, err = _ifup(iface)
   File /usr/share/vdsm/network/configurators/ifcfg.py, line 804, in _ifup
 rc, out, err = utils.execCmd([constants.EXT_IFUP, netIf], raw=False)
   File /usr/lib/python2.6/site-packages/vdsm/utils.py, line 622, in
 execCmd
 (out, err) = p.communicate(data)
   File /usr/lib64/python2.6/subprocess.py, line 732, in communicate
 stdout, stderr = self._communicate(input, endtime)
   File /usr/lib64/python2.6/subprocess.py, line 1316, in _communicate
 stdout, stderr = self._communicate_with_poll(input, endtime)
   File /usr/lib64/python2.6/subprocess.py, line 1388, in
 _communicate_with_poll
 ready = poller.poll(self._remaining_time(endtime))


The traceback seems snipped. I woder which exception is raised deep
done.

As it happens with our new unified_restoration() of network definitions,
please share the content of your /var/lib/vdsm/netconf/*

Could it be that a network there referes to a nic that no longer exists?

___
Devel mailing list
Devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/devel