You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Nguyen Anh Tu <ng...@gmail.com> on 2013/06/10 16:17:26 UTC

[GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Hi forks,

I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException when
executing deployVM.

I found this error starting from the below code.

*NetworkManagerImpl.java*

*NicProfile profile = guru.allocate(network, requested, vm);     (1)*
        if (isDefaultNic != null) {
            profile.setDefaultNic(
isDefaultNic);
        }

*ExtenalGuestNetworkGuru.java*

    @Override
   * public NicProfile allocate(Network config, NicProfile nic,
VirtualMachineProfile<? extends VirtualMachine> vm) throws
InsufficientVirtualNetworkCapcityException,
            InsufficientAddressCapacityException* {

        if
(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(),
config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
            throw new CloudRuntimeException("Does not support custom ip
allocation at this time: " + nic);
        }

        NicProfile profile = super.allocate(config, nic, vm);

        *boolean _isEnabled =
Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
(2)
        if (_isEnabled) {
            return null;
        }*

        if
(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(),
config.getId())) {
            profile.setStrategy(ReservationStrategy.Start);
            /* We won't clear IP address, because router may set gateway as
it IP, and it would be updated properly later */
            //profile.setIp4Address(null);
            profile.setGateway(null);
            profile.setNetmask(null);
        }

        return profile;
    }*

*
The return from (1) is NULL, because at (2) *sdn.ovs.controller* set to
true. So profile = NULL and then we get NullPointerException error in the
next step.

This error prevents me to deployVM using GRE isolation method. If I set *
sdn.ovs.controller* = false, no error anymore but can't using GRE.

How can I fix this? Thanks for any help.

-- 

N.g.U.y.e.N.A.n.H.t.U

Re: [GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Posted by Sebastien Goasguen <ru...@gmail.com>.
On Jun 10, 2013, at 10:17 AM, Nguyen Anh Tu <ng...@gmail.com> wrote:

> Hi forks,
> 

I think we say "folks" but that's not solving the NPE error.

I cc Chiradeep who might have some insight here.

-sebastien

> I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException when
> executing deployVM.
> 
> I found this error starting from the below code.
> 
> *NetworkManagerImpl.java*
> 
> *NicProfile profile = guru.allocate(network, requested, vm);     (1)*
>        if (isDefaultNic != null) {
>            profile.setDefaultNic(
> isDefaultNic);
>        }
> 
> *ExtenalGuestNetworkGuru.java*
> 
>    @Override
>   * public NicProfile allocate(Network config, NicProfile nic,
> VirtualMachineProfile<? extends VirtualMachine> vm) throws
> InsufficientVirtualNetworkCapcityException,
>            InsufficientAddressCapacityException* {
> 
>        if
> (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(),
> config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
>            throw new CloudRuntimeException("Does not support custom ip
> allocation at this time: " + nic);
>        }
> 
>        NicProfile profile = super.allocate(config, nic, vm);
> 
>        *boolean _isEnabled =
> Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
> (2)
>        if (_isEnabled) {
>            return null;
>        }*
> 
>        if
> (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(),
> config.getId())) {
>            profile.setStrategy(ReservationStrategy.Start);
>            /* We won't clear IP address, because router may set gateway as
> it IP, and it would be updated properly later */
>            //profile.setIp4Address(null);
>            profile.setGateway(null);
>            profile.setNetmask(null);
>        }
> 
>        return profile;
>    }*
> 
> *
> The return from (1) is NULL, because at (2) *sdn.ovs.controller* set to
> true. So profile = NULL and then we get NullPointerException error in the
> next step.
> 
> This error prevents me to deployVM using GRE isolation method. If I set *
> sdn.ovs.controller* = false, no error anymore but can't using GRE.
> 
> How can I fix this? Thanks for any help.
> 
> -- 
> 
> N.g.U.y.e.N.A.n.H.t.U


Re: [GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Posted by Nguyen Anh Tu <ng...@gmail.com>.
Hi,

I'll look around this bug.


2013/6/11 Chiradeep Vittal <Ch...@citrix.com>

> Yes
>
> On 6/10/13 1:12 PM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>
> >
> >On Jun 10, 2013, at 3:07 PM, Chiradeep Vittal
> ><Ch...@citrix.com> wrote:
> >
> >> The check for the config is incorrect. The check should be whether the
> >> network in the input parameter has the isolation method 'GRE'. You can
> >>see
> >> the canHandle method on how to check for this. Although, I don't see why
> >> this check should even be necessary. The network will be associated with
> >> the guru at design time.
> >
> >Chiradeep, that's a bug then ?
> >
> >>
> >>
> >> On 6/10/13 7:17 AM, "Nguyen Anh Tu" <ng...@gmail.com> wrote:
> >>
> >>> Hi forks,
> >>>
> >>> I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException
> >>>when
> >>> executing deployVM.
> >>>
> >>> I found this error starting from the below code.
> >>>
> >>> *NetworkManagerImpl.java*
> >>>
> >>> *NicProfile profile = guru.allocate(network, requested, vm);     (1)*
> >>>       if (isDefaultNic != null) {
> >>>           profile.setDefaultNic(
> >>> isDefaultNic);
> >>>       }
> >>>
> >>> *ExtenalGuestNetworkGuru.java*
> >>>
> >>>   @Override
> >>>  * public NicProfile allocate(Network config, NicProfile nic,
> >>> VirtualMachineProfile<? extends VirtualMachine> vm) throws
> >>> InsufficientVirtualNetworkCapcityException,
> >>>           InsufficientAddressCapacityException* {
> >>>
> >>>       if
> >>>
> >>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
> >>>nt
> >>> erId(),
> >>> config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
> >>>           throw new CloudRuntimeException("Does not support custom ip
> >>> allocation at this time: " + nic);
> >>>       }
> >>>
> >>>       NicProfile profile = super.allocate(config, nic, vm);
> >>>
> >>>       *boolean _isEnabled =
> >>>
> >>>Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))
> >>>;
> >>> (2)
> >>>       if (_isEnabled) {
> >>>           return null;
> >>>       }*
> >>>
> >>>       if
> >>>
> >>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
> >>>nt
> >>> erId(),
> >>> config.getId())) {
> >>>           profile.setStrategy(ReservationStrategy.Start);
> >>>           /* We won't clear IP address, because router may set gateway
> >>> as
> >>> it IP, and it would be updated properly later */
> >>>           //profile.setIp4Address(null);
> >>>           profile.setGateway(null);
> >>>           profile.setNetmask(null);
> >>>       }
> >>>
> >>>       return profile;
> >>>   }*
> >>>
> >>> *
> >>> The return from (1) is NULL, because at (2) *sdn.ovs.controller* set to
> >>> true. So profile = NULL and then we get NullPointerException error in
> >>>the
> >>> next step.
> >>>
> >>> This error prevents me to deployVM using GRE isolation method. If I
> >>>set *
> >>> sdn.ovs.controller* = false, no error anymore but can't using GRE.
> >>>
> >>> How can I fix this? Thanks for any help.
> >>>
> >>> --
> >>>
> >>> N.g.U.y.e.N.A.n.H.t.U
> >>
> >
>
>


-- 

N.g.U.y.e.N.A.n.H.t.U

Re: [GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Posted by Nguyen Anh Tu <ng...@gmail.com>.
@Chiradeep: I already implemented allocate() function to
OvsGuestNetworkGuru. The above error is no more appear.

Now I'll make OVS works with XCP 1.6. I tried and saw some new errors.
However, everything is more clearly.


2013/6/12 Nguyen Anh Tu <ng...@gmail.com>

> @Chiradeep Vittal: I saw what happen on this error. The problem is: the *
> guru.allocate()* function in NetworkManager called to
> ExternalGuestNetworkGuru instead of OvsGuestNetworkGuru.
>
> *NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus,
> network.getGuruName())*
> this function return ExternalGuestNetworkGuru
>
> And even if it calls to OvsGuestNetworkGuru, the problem does still appear
> because the OvsGuestNetworkGuru doesn't have the allocate() function.
>
>
> 2013/6/11 Chiradeep Vittal <Ch...@citrix.com>
>
>> Yes
>>
>> On 6/10/13 1:12 PM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>>
>> >
>> >On Jun 10, 2013, at 3:07 PM, Chiradeep Vittal
>> ><Ch...@citrix.com> wrote:
>> >
>> >> The check for the config is incorrect. The check should be whether the
>> >> network in the input parameter has the isolation method 'GRE'. You can
>> >>see
>> >> the canHandle method on how to check for this. Although, I don't see
>> why
>> >> this check should even be necessary. The network will be associated
>> with
>> >> the guru at design time.
>> >
>> >Chiradeep, that's a bug then ?
>> >
>> >>
>> >>
>> >> On 6/10/13 7:17 AM, "Nguyen Anh Tu" <ng...@gmail.com> wrote:
>> >>
>> >>> Hi forks,
>> >>>
>> >>> I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException
>> >>>when
>> >>> executing deployVM.
>> >>>
>> >>> I found this error starting from the below code.
>> >>>
>> >>> *NetworkManagerImpl.java*
>> >>>
>> >>> *NicProfile profile = guru.allocate(network, requested, vm);     (1)*
>> >>>       if (isDefaultNic != null) {
>> >>>           profile.setDefaultNic(
>> >>> isDefaultNic);
>> >>>       }
>> >>>
>> >>> *ExtenalGuestNetworkGuru.java*
>> >>>
>> >>>   @Override
>> >>>  * public NicProfile allocate(Network config, NicProfile nic,
>> >>> VirtualMachineProfile<? extends VirtualMachine> vm) throws
>> >>> InsufficientVirtualNetworkCapcityException,
>> >>>           InsufficientAddressCapacityException* {
>> >>>
>> >>>       if
>> >>>
>>
>> >>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
>> >>>nt
>> >>> erId(),
>> >>> config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
>> >>>           throw new CloudRuntimeException("Does not support custom ip
>> >>> allocation at this time: " + nic);
>> >>>       }
>> >>>
>> >>>       NicProfile profile = super.allocate(config, nic, vm);
>> >>>
>> >>>       *boolean _isEnabled =
>> >>>
>>
>> >>>Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))
>> >>>;
>> >>> (2)
>> >>>       if (_isEnabled) {
>> >>>           return null;
>> >>>       }*
>> >>>
>> >>>       if
>> >>>
>>
>> >>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
>> >>>nt
>> >>> erId(),
>> >>> config.getId())) {
>> >>>           profile.setStrategy(ReservationStrategy.Start);
>> >>>           /* We won't clear IP address, because router may set gateway
>> >>> as
>> >>> it IP, and it would be updated properly later */
>> >>>           //profile.setIp4Address(null);
>> >>>           profile.setGateway(null);
>> >>>           profile.setNetmask(null);
>> >>>       }
>> >>>
>> >>>       return profile;
>> >>>   }*
>> >>>
>> >>> *
>> >>> The return from (1) is NULL, because at (2) *sdn.ovs.controller* set
>> to
>> >>> true. So profile = NULL and then we get NullPointerException error in
>> >>>the
>> >>> next step.
>> >>>
>> >>> This error prevents me to deployVM using GRE isolation method. If I
>> >>>set *
>> >>> sdn.ovs.controller* = false, no error anymore but can't using GRE.
>> >>>
>> >>> How can I fix this? Thanks for any help.
>> >>>
>> >>> --
>> >>>
>> >>> N.g.U.y.e.N.A.n.H.t.U
>> >>
>> >
>>
>>
>
>
> --
>
> N.g.U.y.e.N.A.n.H.t.U
>



-- 

N.g.U.y.e.N.A.n.H.t.U

Re: [GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Posted by Nguyen Anh Tu <ng...@gmail.com>.
@Chiradeep Vittal: I saw what happen on this error. The problem is: the *
guru.allocate()* function in NetworkManager called to
ExternalGuestNetworkGuru instead of OvsGuestNetworkGuru.

*NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus,
network.getGuruName())*
this function return ExternalGuestNetworkGuru

And even if it calls to OvsGuestNetworkGuru, the problem does still appear
because the OvsGuestNetworkGuru doesn't have the allocate() function.


2013/6/11 Chiradeep Vittal <Ch...@citrix.com>

> Yes
>
> On 6/10/13 1:12 PM, "Sebastien Goasguen" <ru...@gmail.com> wrote:
>
> >
> >On Jun 10, 2013, at 3:07 PM, Chiradeep Vittal
> ><Ch...@citrix.com> wrote:
> >
> >> The check for the config is incorrect. The check should be whether the
> >> network in the input parameter has the isolation method 'GRE'. You can
> >>see
> >> the canHandle method on how to check for this. Although, I don't see why
> >> this check should even be necessary. The network will be associated with
> >> the guru at design time.
> >
> >Chiradeep, that's a bug then ?
> >
> >>
> >>
> >> On 6/10/13 7:17 AM, "Nguyen Anh Tu" <ng...@gmail.com> wrote:
> >>
> >>> Hi forks,
> >>>
> >>> I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException
> >>>when
> >>> executing deployVM.
> >>>
> >>> I found this error starting from the below code.
> >>>
> >>> *NetworkManagerImpl.java*
> >>>
> >>> *NicProfile profile = guru.allocate(network, requested, vm);     (1)*
> >>>       if (isDefaultNic != null) {
> >>>           profile.setDefaultNic(
> >>> isDefaultNic);
> >>>       }
> >>>
> >>> *ExtenalGuestNetworkGuru.java*
> >>>
> >>>   @Override
> >>>  * public NicProfile allocate(Network config, NicProfile nic,
> >>> VirtualMachineProfile<? extends VirtualMachine> vm) throws
> >>> InsufficientVirtualNetworkCapcityException,
> >>>           InsufficientAddressCapacityException* {
> >>>
> >>>       if
> >>>
> >>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
> >>>nt
> >>> erId(),
> >>> config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
> >>>           throw new CloudRuntimeException("Does not support custom ip
> >>> allocation at this time: " + nic);
> >>>       }
> >>>
> >>>       NicProfile profile = super.allocate(config, nic, vm);
> >>>
> >>>       *boolean _isEnabled =
> >>>
> >>>Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))
> >>>;
> >>> (2)
> >>>       if (_isEnabled) {
> >>>           return null;
> >>>       }*
> >>>
> >>>       if
> >>>
> >>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
> >>>nt
> >>> erId(),
> >>> config.getId())) {
> >>>           profile.setStrategy(ReservationStrategy.Start);
> >>>           /* We won't clear IP address, because router may set gateway
> >>> as
> >>> it IP, and it would be updated properly later */
> >>>           //profile.setIp4Address(null);
> >>>           profile.setGateway(null);
> >>>           profile.setNetmask(null);
> >>>       }
> >>>
> >>>       return profile;
> >>>   }*
> >>>
> >>> *
> >>> The return from (1) is NULL, because at (2) *sdn.ovs.controller* set to
> >>> true. So profile = NULL and then we get NullPointerException error in
> >>>the
> >>> next step.
> >>>
> >>> This error prevents me to deployVM using GRE isolation method. If I
> >>>set *
> >>> sdn.ovs.controller* = false, no error anymore but can't using GRE.
> >>>
> >>> How can I fix this? Thanks for any help.
> >>>
> >>> --
> >>>
> >>> N.g.U.y.e.N.A.n.H.t.U
> >>
> >
>
>


-- 

N.g.U.y.e.N.A.n.H.t.U

Re: [GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Posted by Chiradeep Vittal <Ch...@citrix.com>.
Yes

On 6/10/13 1:12 PM, "Sebastien Goasguen" <ru...@gmail.com> wrote:

>
>On Jun 10, 2013, at 3:07 PM, Chiradeep Vittal
><Ch...@citrix.com> wrote:
>
>> The check for the config is incorrect. The check should be whether the
>> network in the input parameter has the isolation method 'GRE'. You can
>>see
>> the canHandle method on how to check for this. Although, I don't see why
>> this check should even be necessary. The network will be associated with
>> the guru at design time.
>
>Chiradeep, that's a bug then ?
>
>> 
>> 
>> On 6/10/13 7:17 AM, "Nguyen Anh Tu" <ng...@gmail.com> wrote:
>> 
>>> Hi forks,
>>> 
>>> I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException
>>>when
>>> executing deployVM.
>>> 
>>> I found this error starting from the below code.
>>> 
>>> *NetworkManagerImpl.java*
>>> 
>>> *NicProfile profile = guru.allocate(network, requested, vm);     (1)*
>>>       if (isDefaultNic != null) {
>>>           profile.setDefaultNic(
>>> isDefaultNic);
>>>       }
>>> 
>>> *ExtenalGuestNetworkGuru.java*
>>> 
>>>   @Override
>>>  * public NicProfile allocate(Network config, NicProfile nic,
>>> VirtualMachineProfile<? extends VirtualMachine> vm) throws
>>> InsufficientVirtualNetworkCapcityException,
>>>           InsufficientAddressCapacityException* {
>>> 
>>>       if
>>> 
>>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
>>>nt
>>> erId(),
>>> config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
>>>           throw new CloudRuntimeException("Does not support custom ip
>>> allocation at this time: " + nic);
>>>       }
>>> 
>>>       NicProfile profile = super.allocate(config, nic, vm);
>>> 
>>>       *boolean _isEnabled =
>>> 
>>>Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))
>>>;
>>> (2)
>>>       if (_isEnabled) {
>>>           return null;
>>>       }*
>>> 
>>>       if
>>> 
>>>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCe
>>>nt
>>> erId(),
>>> config.getId())) {
>>>           profile.setStrategy(ReservationStrategy.Start);
>>>           /* We won't clear IP address, because router may set gateway
>>> as
>>> it IP, and it would be updated properly later */
>>>           //profile.setIp4Address(null);
>>>           profile.setGateway(null);
>>>           profile.setNetmask(null);
>>>       }
>>> 
>>>       return profile;
>>>   }*
>>> 
>>> *
>>> The return from (1) is NULL, because at (2) *sdn.ovs.controller* set to
>>> true. So profile = NULL and then we get NullPointerException error in
>>>the
>>> next step.
>>> 
>>> This error prevents me to deployVM using GRE isolation method. If I
>>>set *
>>> sdn.ovs.controller* = false, no error anymore but can't using GRE.
>>> 
>>> How can I fix this? Thanks for any help.
>>> 
>>> -- 
>>> 
>>> N.g.U.y.e.N.A.n.H.t.U
>> 
>


Re: [GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Posted by Sebastien Goasguen <ru...@gmail.com>.
On Jun 10, 2013, at 3:07 PM, Chiradeep Vittal <Ch...@citrix.com> wrote:

> The check for the config is incorrect. The check should be whether the
> network in the input parameter has the isolation method 'GRE'. You can see
> the canHandle method on how to check for this. Although, I don't see why
> this check should even be necessary. The network will be associated with
> the guru at design time.

Chiradeep, that's a bug then ?

> 
> 
> On 6/10/13 7:17 AM, "Nguyen Anh Tu" <ng...@gmail.com> wrote:
> 
>> Hi forks,
>> 
>> I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException when
>> executing deployVM.
>> 
>> I found this error starting from the below code.
>> 
>> *NetworkManagerImpl.java*
>> 
>> *NicProfile profile = guru.allocate(network, requested, vm);     (1)*
>>       if (isDefaultNic != null) {
>>           profile.setDefaultNic(
>> isDefaultNic);
>>       }
>> 
>> *ExtenalGuestNetworkGuru.java*
>> 
>>   @Override
>>  * public NicProfile allocate(Network config, NicProfile nic,
>> VirtualMachineProfile<? extends VirtualMachine> vm) throws
>> InsufficientVirtualNetworkCapcityException,
>>           InsufficientAddressCapacityException* {
>> 
>>       if
>> (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCent
>> erId(),
>> config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
>>           throw new CloudRuntimeException("Does not support custom ip
>> allocation at this time: " + nic);
>>       }
>> 
>>       NicProfile profile = super.allocate(config, nic, vm);
>> 
>>       *boolean _isEnabled =
>> Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
>> (2)
>>       if (_isEnabled) {
>>           return null;
>>       }*
>> 
>>       if
>> (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCent
>> erId(),
>> config.getId())) {
>>           profile.setStrategy(ReservationStrategy.Start);
>>           /* We won't clear IP address, because router may set gateway
>> as
>> it IP, and it would be updated properly later */
>>           //profile.setIp4Address(null);
>>           profile.setGateway(null);
>>           profile.setNetmask(null);
>>       }
>> 
>>       return profile;
>>   }*
>> 
>> *
>> The return from (1) is NULL, because at (2) *sdn.ovs.controller* set to
>> true. So profile = NULL and then we get NullPointerException error in the
>> next step.
>> 
>> This error prevents me to deployVM using GRE isolation method. If I set *
>> sdn.ovs.controller* = false, no error anymore but can't using GRE.
>> 
>> How can I fix this? Thanks for any help.
>> 
>> -- 
>> 
>> N.g.U.y.e.N.A.n.H.t.U
> 


Re: [GSOC] NullPointerException when deployVM using GRE isolation method. Help me!

Posted by Chiradeep Vittal <Ch...@citrix.com>.
The check for the config is incorrect. The check should be whether the
network in the input parameter has the isolation method 'GRE'. You can see
the canHandle method on how to check for this. Although, I don't see why
this check should even be necessary. The network will be associated with
the guru at design time.


On 6/10/13 7:17 AM, "Nguyen Anh Tu" <ng...@gmail.com> wrote:

>Hi forks,
>
>I'm trying OVS tunnel with XCP 1.6 and get error NullPointerException when
>executing deployVM.
>
>I found this error starting from the below code.
>
>*NetworkManagerImpl.java*
>
>*NicProfile profile = guru.allocate(network, requested, vm);     (1)*
>        if (isDefaultNic != null) {
>            profile.setDefaultNic(
>isDefaultNic);
>        }
>
>*ExtenalGuestNetworkGuru.java*
>
>    @Override
>   * public NicProfile allocate(Network config, NicProfile nic,
>VirtualMachineProfile<? extends VirtualMachine> vm) throws
>InsufficientVirtualNetworkCapcityException,
>            InsufficientAddressCapacityException* {
>
>        if
>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCent
>erId(),
>config.getId()) && nic != null && nic.getRequestedIpv4() != null) {
>            throw new CloudRuntimeException("Does not support custom ip
>allocation at this time: " + nic);
>        }
>
>        NicProfile profile = super.allocate(config, nic, vm);
>
>        *boolean _isEnabled =
>Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
>(2)
>        if (_isEnabled) {
>            return null;
>        }*
>
>        if
>(_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCent
>erId(),
>config.getId())) {
>            profile.setStrategy(ReservationStrategy.Start);
>            /* We won't clear IP address, because router may set gateway
>as
>it IP, and it would be updated properly later */
>            //profile.setIp4Address(null);
>            profile.setGateway(null);
>            profile.setNetmask(null);
>        }
>
>        return profile;
>    }*
>
>*
>The return from (1) is NULL, because at (2) *sdn.ovs.controller* set to
>true. So profile = NULL and then we get NullPointerException error in the
>next step.
>
>This error prevents me to deployVM using GRE isolation method. If I set *
>sdn.ovs.controller* = false, no error anymore but can't using GRE.
>
>How can I fix this? Thanks for any help.
>
>-- 
>
>N.g.U.y.e.N.A.n.H.t.U