You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by li jerry <di...@hotmail.com> on 2019/04/22 13:36:51 UTC

Cloudstack-agent gets the local IP address exception

HI All


my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via keepalived.

After I started the cloudstack-agent, I got vip[10.226.16.10] and I couldn't get the correct IP [10.226.16.11];

Can I have any way to get the cloudstack agent to get the correct IP address?



Cloudstack 4.11.2
CentOS 7.5



br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
    inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
       valid_lft forever preferred_lft forever
    inet 10.226.16.10/24 scope global secondary br2
       valid_lft forever preferred_lft forever
    inet6 fe80::1456:f9ff:fe06:6228/64 scope link
       valid_lft forever preferred_lft forever

Re: Cloudstack-agent gets the local IP address exception

Posted by Andrija Panic <an...@gmail.com>.
That sounds great Li, glad you solved the problem.

On Tue, 23 Apr 2019 at 16:49, li jerry <di...@hotmail.com> wrote:

> Hi Andrija
>
>
>
>       Your method is very good. I just tested agent. lb. When management
> fails, the agent can complete switching in a very short time.
>
>
>
>
>
> ________________________________
> 发件人: Andrija Panic <an...@gmail.com>
> 发送时间: Tuesday, April 23, 2019 10:22:47 PM
> 收件人: dev
> 抄送: users@cloudstack.apache.org
> 主题: Re: Cloudstack-agent gets the local IP address exception
>
> Hi Jerry,
>
> not a good idea, if you don't mind me saying that.
>
> Are you using 4.11 release ? If so you should use the internal LB logic
> that is now part of Agent on KVM side - please check this one:
> https://www.shapeblue.com/software-based-agent-lb-for-cloudstack/
>
> Let me know if this works for you.
>
> Best,
> Andrija
>
> On Tue, 23 Apr 2019 at 14:59, li jerry <di...@hotmail.com> wrote:
>
> > HI Dag Sonstebo
> >
> > We deploy management and agent on the same host, with three such nodes.
> > So we need to deploy keepalived on these three nodes, elect a VIP, and
> let
> > all agents communicate with this VIP.
> >
> > 发件人: Dag Sonstebo<ma...@shapeblue.com>
> > 发送时间: 2019年4月23日 17:08
> > 收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>;
> > dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
> > 主题: Re: Cloudstack-agent gets the local IP address exception
> >
> > Li,
> >
> > Why do you run with this configuration? If this is for network resilience
> > you would run a bond/team, not keepalived.
> >
> > Regards,
> > Dag Sonstebo
> > Cloud Architect
> > ShapeBlue
> >
> >
> > On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:
> >
> >     HI All
> >
> >
> >     my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> > keepalived.
> >
> >     After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> > couldn't get the correct IP [10.226.16.11];
> >
> >     Can I have any way to get the cloudstack agent to get the correct IP
> > address?
> >
> >
> >
> >     Cloudstack 4.11.2
> >     CentOS 7.5
> >
> >
> >
> >     br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
> UP
> > group default qlen 1000
> >         link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
> >         inet 10.226.16.11/24 brd 10.226.16.255 scope global
> noprefixroute
> > br2
> >            valid_lft forever preferred_lft forever
> >         inet 10.226.16.10/24 scope global secondary br2
> >            valid_lft forever preferred_lft forever
> >         inet6 fe80::1456:f9ff:fe06:6228/64 scope link
> >            valid_lft forever preferred_lft forever
> >
> >
> >
> > Dag.Sonstebo@shapeblue.com
> > www.shapeblue.com<http://www.shapeblue.com>
> > Amadeus House, Floral Street, London  WC2E 9DPUK
> > @shapeblue
> >
> >
> >
> >
>
> --
>
> Andrija Panić
>


-- 

Andrija Panić

Re: Cloudstack-agent gets the local IP address exception

Posted by Andrija Panic <an...@gmail.com>.
That sounds great Li, glad you solved the problem.

On Tue, 23 Apr 2019 at 16:49, li jerry <di...@hotmail.com> wrote:

> Hi Andrija
>
>
>
>       Your method is very good. I just tested agent. lb. When management
> fails, the agent can complete switching in a very short time.
>
>
>
>
>
> ________________________________
> 发件人: Andrija Panic <an...@gmail.com>
> 发送时间: Tuesday, April 23, 2019 10:22:47 PM
> 收件人: dev
> 抄送: users@cloudstack.apache.org
> 主题: Re: Cloudstack-agent gets the local IP address exception
>
> Hi Jerry,
>
> not a good idea, if you don't mind me saying that.
>
> Are you using 4.11 release ? If so you should use the internal LB logic
> that is now part of Agent on KVM side - please check this one:
> https://www.shapeblue.com/software-based-agent-lb-for-cloudstack/
>
> Let me know if this works for you.
>
> Best,
> Andrija
>
> On Tue, 23 Apr 2019 at 14:59, li jerry <di...@hotmail.com> wrote:
>
> > HI Dag Sonstebo
> >
> > We deploy management and agent on the same host, with three such nodes.
> > So we need to deploy keepalived on these three nodes, elect a VIP, and
> let
> > all agents communicate with this VIP.
> >
> > 发件人: Dag Sonstebo<ma...@shapeblue.com>
> > 发送时间: 2019年4月23日 17:08
> > 收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>;
> > dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
> > 主题: Re: Cloudstack-agent gets the local IP address exception
> >
> > Li,
> >
> > Why do you run with this configuration? If this is for network resilience
> > you would run a bond/team, not keepalived.
> >
> > Regards,
> > Dag Sonstebo
> > Cloud Architect
> > ShapeBlue
> >
> >
> > On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:
> >
> >     HI All
> >
> >
> >     my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> > keepalived.
> >
> >     After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> > couldn't get the correct IP [10.226.16.11];
> >
> >     Can I have any way to get the cloudstack agent to get the correct IP
> > address?
> >
> >
> >
> >     Cloudstack 4.11.2
> >     CentOS 7.5
> >
> >
> >
> >     br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state
> UP
> > group default qlen 1000
> >         link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
> >         inet 10.226.16.11/24 brd 10.226.16.255 scope global
> noprefixroute
> > br2
> >            valid_lft forever preferred_lft forever
> >         inet 10.226.16.10/24 scope global secondary br2
> >            valid_lft forever preferred_lft forever
> >         inet6 fe80::1456:f9ff:fe06:6228/64 scope link
> >            valid_lft forever preferred_lft forever
> >
> >
> >
> > Dag.Sonstebo@shapeblue.com
> > www.shapeblue.com<http://www.shapeblue.com>
> > Amadeus House, Floral Street, London  WC2E 9DPUK
> > @shapeblue
> >
> >
> >
> >
>
> --
>
> Andrija Panić
>


-- 

Andrija Panić

答复: Cloudstack-agent gets the local IP address exception

Posted by li jerry <di...@hotmail.com>.
Hi Andrija



      Your method is very good. I just tested agent. lb. When management fails, the agent can complete switching in a very short time.





________________________________
发件人: Andrija Panic <an...@gmail.com>
发送时间: Tuesday, April 23, 2019 10:22:47 PM
收件人: dev
抄送: users@cloudstack.apache.org
主题: Re: Cloudstack-agent gets the local IP address exception

Hi Jerry,

not a good idea, if you don't mind me saying that.

Are you using 4.11 release ? If so you should use the internal LB logic
that is now part of Agent on KVM side - please check this one:
https://www.shapeblue.com/software-based-agent-lb-for-cloudstack/

Let me know if this works for you.

Best,
Andrija

On Tue, 23 Apr 2019 at 14:59, li jerry <di...@hotmail.com> wrote:

> HI Dag Sonstebo
>
> We deploy management and agent on the same host, with three such nodes.
> So we need to deploy keepalived on these three nodes, elect a VIP, and let
> all agents communicate with this VIP.
>
> 发件人: Dag Sonstebo<ma...@shapeblue.com>
> 发送时间: 2019年4月23日 17:08
> 收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>;
> dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
> 主题: Re: Cloudstack-agent gets the local IP address exception
>
> Li,
>
> Why do you run with this configuration? If this is for network resilience
> you would run a bond/team, not keepalived.
>
> Regards,
> Dag Sonstebo
> Cloud Architect
> ShapeBlue
>
>
> On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:
>
>     HI All
>
>
>     my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> keepalived.
>
>     After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> couldn't get the correct IP [10.226.16.11];
>
>     Can I have any way to get the cloudstack agent to get the correct IP
> address?
>
>
>
>     Cloudstack 4.11.2
>     CentOS 7.5
>
>
>
>     br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
> group default qlen 1000
>         link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>         inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute
> br2
>            valid_lft forever preferred_lft forever
>         inet 10.226.16.10/24 scope global secondary br2
>            valid_lft forever preferred_lft forever
>         inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>            valid_lft forever preferred_lft forever
>
>
>
> Dag.Sonstebo@shapeblue.com
> www.shapeblue.com<http://www.shapeblue.com>
> Amadeus House, Floral Street, London  WC2E 9DPUK
> @shapeblue
>
>
>
>

--

Andrija Panić

答复: Cloudstack-agent gets the local IP address exception

Posted by li jerry <di...@hotmail.com>.
Hi Andrija



      Your method is very good. I just tested agent. lb. When management fails, the agent can complete switching in a very short time.





________________________________
发件人: Andrija Panic <an...@gmail.com>
发送时间: Tuesday, April 23, 2019 10:22:47 PM
收件人: dev
抄送: users@cloudstack.apache.org
主题: Re: Cloudstack-agent gets the local IP address exception

Hi Jerry,

not a good idea, if you don't mind me saying that.

Are you using 4.11 release ? If so you should use the internal LB logic
that is now part of Agent on KVM side - please check this one:
https://www.shapeblue.com/software-based-agent-lb-for-cloudstack/

Let me know if this works for you.

Best,
Andrija

On Tue, 23 Apr 2019 at 14:59, li jerry <di...@hotmail.com> wrote:

> HI Dag Sonstebo
>
> We deploy management and agent on the same host, with three such nodes.
> So we need to deploy keepalived on these three nodes, elect a VIP, and let
> all agents communicate with this VIP.
>
> 发件人: Dag Sonstebo<ma...@shapeblue.com>
> 发送时间: 2019年4月23日 17:08
> 收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>;
> dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
> 主题: Re: Cloudstack-agent gets the local IP address exception
>
> Li,
>
> Why do you run with this configuration? If this is for network resilience
> you would run a bond/team, not keepalived.
>
> Regards,
> Dag Sonstebo
> Cloud Architect
> ShapeBlue
>
>
> On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:
>
>     HI All
>
>
>     my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> keepalived.
>
>     After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> couldn't get the correct IP [10.226.16.11];
>
>     Can I have any way to get the cloudstack agent to get the correct IP
> address?
>
>
>
>     Cloudstack 4.11.2
>     CentOS 7.5
>
>
>
>     br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
> group default qlen 1000
>         link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>         inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute
> br2
>            valid_lft forever preferred_lft forever
>         inet 10.226.16.10/24 scope global secondary br2
>            valid_lft forever preferred_lft forever
>         inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>            valid_lft forever preferred_lft forever
>
>
>
> Dag.Sonstebo@shapeblue.com
> www.shapeblue.com<http://www.shapeblue.com>
> Amadeus House, Floral Street, London  WC2E 9DPUK
> @shapeblue
>
>
>
>

--

Andrija Panić

Re: Cloudstack-agent gets the local IP address exception

Posted by Andrija Panic <an...@gmail.com>.
Hi Jerry,

not a good idea, if you don't mind me saying that.

Are you using 4.11 release ? If so you should use the internal LB logic
that is now part of Agent on KVM side - please check this one:
https://www.shapeblue.com/software-based-agent-lb-for-cloudstack/

Let me know if this works for you.

Best,
Andrija

On Tue, 23 Apr 2019 at 14:59, li jerry <di...@hotmail.com> wrote:

> HI Dag Sonstebo
>
> We deploy management and agent on the same host, with three such nodes.
> So we need to deploy keepalived on these three nodes, elect a VIP, and let
> all agents communicate with this VIP.
>
> 发件人: Dag Sonstebo<ma...@shapeblue.com>
> 发送时间: 2019年4月23日 17:08
> 收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>;
> dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
> 主题: Re: Cloudstack-agent gets the local IP address exception
>
> Li,
>
> Why do you run with this configuration? If this is for network resilience
> you would run a bond/team, not keepalived.
>
> Regards,
> Dag Sonstebo
> Cloud Architect
> ShapeBlue
>
>
> On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:
>
>     HI All
>
>
>     my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> keepalived.
>
>     After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> couldn't get the correct IP [10.226.16.11];
>
>     Can I have any way to get the cloudstack agent to get the correct IP
> address?
>
>
>
>     Cloudstack 4.11.2
>     CentOS 7.5
>
>
>
>     br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
> group default qlen 1000
>         link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>         inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute
> br2
>            valid_lft forever preferred_lft forever
>         inet 10.226.16.10/24 scope global secondary br2
>            valid_lft forever preferred_lft forever
>         inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>            valid_lft forever preferred_lft forever
>
>
>
> Dag.Sonstebo@shapeblue.com
> www.shapeblue.com<http://www.shapeblue.com>
> Amadeus House, Floral Street, London  WC2E 9DPUK
> @shapeblue
>
>
>
>

-- 

Andrija Panić

Re: Cloudstack-agent gets the local IP address exception

Posted by Andrija Panic <an...@gmail.com>.
Hi Jerry,

not a good idea, if you don't mind me saying that.

Are you using 4.11 release ? If so you should use the internal LB logic
that is now part of Agent on KVM side - please check this one:
https://www.shapeblue.com/software-based-agent-lb-for-cloudstack/

Let me know if this works for you.

Best,
Andrija

On Tue, 23 Apr 2019 at 14:59, li jerry <di...@hotmail.com> wrote:

> HI Dag Sonstebo
>
> We deploy management and agent on the same host, with three such nodes.
> So we need to deploy keepalived on these three nodes, elect a VIP, and let
> all agents communicate with this VIP.
>
> 发件人: Dag Sonstebo<ma...@shapeblue.com>
> 发送时间: 2019年4月23日 17:08
> 收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>;
> dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
> 主题: Re: Cloudstack-agent gets the local IP address exception
>
> Li,
>
> Why do you run with this configuration? If this is for network resilience
> you would run a bond/team, not keepalived.
>
> Regards,
> Dag Sonstebo
> Cloud Architect
> ShapeBlue
>
>
> On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:
>
>     HI All
>
>
>     my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> keepalived.
>
>     After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> couldn't get the correct IP [10.226.16.11];
>
>     Can I have any way to get the cloudstack agent to get the correct IP
> address?
>
>
>
>     Cloudstack 4.11.2
>     CentOS 7.5
>
>
>
>     br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
> group default qlen 1000
>         link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>         inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute
> br2
>            valid_lft forever preferred_lft forever
>         inet 10.226.16.10/24 scope global secondary br2
>            valid_lft forever preferred_lft forever
>         inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>            valid_lft forever preferred_lft forever
>
>
>
> Dag.Sonstebo@shapeblue.com
> www.shapeblue.com<http://www.shapeblue.com>
> Amadeus House, Floral Street, London  WC2E 9DPUK
> @shapeblue
>
>
>
>

-- 

Andrija Panić

答复: Cloudstack-agent gets the local IP address exception

Posted by li jerry <di...@hotmail.com>.
HI Dag Sonstebo

We deploy management and agent on the same host, with three such nodes.
So we need to deploy keepalived on these three nodes, elect a VIP, and let all agents communicate with this VIP.

发件人: Dag Sonstebo<ma...@shapeblue.com>
发送时间: 2019年4月23日 17:08
收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>; dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
主题: Re: Cloudstack-agent gets the local IP address exception

Li,

Why do you run with this configuration? If this is for network resilience you would run a bond/team, not keepalived.

Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue


On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:

    HI All


    my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via keepalived.

    After I started the cloudstack-agent, I got vip[10.226.16.10] and I couldn't get the correct IP [10.226.16.11];

    Can I have any way to get the cloudstack agent to get the correct IP address?



    Cloudstack 4.11.2
    CentOS 7.5



    br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
        inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
           valid_lft forever preferred_lft forever
        inet 10.226.16.10/24 scope global secondary br2
           valid_lft forever preferred_lft forever
        inet6 fe80::1456:f9ff:fe06:6228/64 scope link
           valid_lft forever preferred_lft forever



Dag.Sonstebo@shapeblue.com
www.shapeblue.com<http://www.shapeblue.com>
Amadeus House, Floral Street, London  WC2E 9DPUK
@shapeblue




答复: Cloudstack-agent gets the local IP address exception

Posted by li jerry <di...@hotmail.com>.
HI Dag Sonstebo

We deploy management and agent on the same host, with three such nodes.
So we need to deploy keepalived on these three nodes, elect a VIP, and let all agents communicate with this VIP.

发件人: Dag Sonstebo<ma...@shapeblue.com>
发送时间: 2019年4月23日 17:08
收件人: users@cloudstack.apache.org<ma...@cloudstack.apache.org>; dev@cloudstack.apache.org<ma...@cloudstack.apache.org>
主题: Re: Cloudstack-agent gets the local IP address exception

Li,

Why do you run with this configuration? If this is for network resilience you would run a bond/team, not keepalived.

Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue


On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:

    HI All


    my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via keepalived.

    After I started the cloudstack-agent, I got vip[10.226.16.10] and I couldn't get the correct IP [10.226.16.11];

    Can I have any way to get the cloudstack agent to get the correct IP address?



    Cloudstack 4.11.2
    CentOS 7.5



    br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
        inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
           valid_lft forever preferred_lft forever
        inet 10.226.16.10/24 scope global secondary br2
           valid_lft forever preferred_lft forever
        inet6 fe80::1456:f9ff:fe06:6228/64 scope link
           valid_lft forever preferred_lft forever



Dag.Sonstebo@shapeblue.com
www.shapeblue.com<http://www.shapeblue.com>
Amadeus House, Floral Street, London  WC2E 9DPUK
@shapeblue




Re: Cloudstack-agent gets the local IP address exception

Posted by Dag Sonstebo <Da...@shapeblue.com>.
Li,

Why do you run with this configuration? If this is for network resilience you would run a bond/team, not keepalived.

Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
 

On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:

    HI All
    
    
    my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via keepalived.
    
    After I started the cloudstack-agent, I got vip[10.226.16.10] and I couldn't get the correct IP [10.226.16.11];
    
    Can I have any way to get the cloudstack agent to get the correct IP address?
    
    
    
    Cloudstack 4.11.2
    CentOS 7.5
    
    
    
    br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
        inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
           valid_lft forever preferred_lft forever
        inet 10.226.16.10/24 scope global secondary br2
           valid_lft forever preferred_lft forever
        inet6 fe80::1456:f9ff:fe06:6228/64 scope link
           valid_lft forever preferred_lft forever
    


Dag.Sonstebo@shapeblue.com 
www.shapeblue.com
Amadeus House, Floral Street, London  WC2E 9DPUK
@shapeblue
  
 


Re: Cloudstack-agent gets the local IP address exception

Posted by Dag Sonstebo <Da...@shapeblue.com>.
Li,

Why do you run with this configuration? If this is for network resilience you would run a bond/team, not keepalived.

Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
 

On 22/04/2019, 14:37, "li jerry" <di...@hotmail.com> wrote:

    HI All
    
    
    my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via keepalived.
    
    After I started the cloudstack-agent, I got vip[10.226.16.10] and I couldn't get the correct IP [10.226.16.11];
    
    Can I have any way to get the cloudstack agent to get the correct IP address?
    
    
    
    Cloudstack 4.11.2
    CentOS 7.5
    
    
    
    br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
        inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
           valid_lft forever preferred_lft forever
        inet 10.226.16.10/24 scope global secondary br2
           valid_lft forever preferred_lft forever
        inet6 fe80::1456:f9ff:fe06:6228/64 scope link
           valid_lft forever preferred_lft forever
    


Dag.Sonstebo@shapeblue.com 
www.shapeblue.com
Amadeus House, Floral Street, London  WC2E 9DPUK
@shapeblue
  
 


Re: Cloudstack-agent gets the local IP address exception

Posted by Nux! <nu...@li.nux.ro>.
Thanks Wei, I've opened a proper issue for this, hope your fix gets applied.

https://github.com/apache/cloudstack/issues/3311

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Wei ZHOU" <us...@gmail.com>
> To: "dev" <de...@cloudstack.apache.org>
> Cc: "users" <us...@cloudstack.apache.org>
> Sent: Wednesday, 1 May, 2019 21:52:06
> Subject: Re: Cloudstack-agent gets the local IP address exception

> Hi Nux,
> 
> It is because NetworkInterface.getInterfaceAddresses() returns the ips in
> reverse order.
> For example, "ip addr show dev eth0"  shows the following ips
> inet X.X.X.X
> inet secondary Y.Y.Y.Y
> inet6 Z:Z:Z:Z:Z:Z
> 
> Then NetworkInterface.getInterfaceAddresses returns
> Z:Z:Z:Z:Z:Z
> Y.Y.Y.Y
> X.X.X.X
> 
> The following patch should work as you expect.
> 
> ```
> diff --git a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> index afe73f1..afb0ce6 100644
> --- a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> +++ b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> @@ -32,6 +32,7 @@ import java.net.SocketException;
> import java.net.URI;
> import java.net.UnknownHostException;
> import java.util.ArrayList;
> +import java.util.Collections;
> import java.util.Formatter;
> import java.util.List;
> import java.util.Random;
> @@ -394,10 +395,11 @@ public class NetUtils {
>     }
> 
>     public static String[] getNetworkParams(final NetworkInterface nic) {
> -        final List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
> +        List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
>         if (addrs == null || addrs.size() == 0) {
>             return null;
>         }
> +        Collections.reverse(addrs);
>         InterfaceAddress addr = null;
>         for (final InterfaceAddress iaddr : addrs) {
>             final InetAddress inet = iaddr.getAddress();
> ```
> 
> 
> -Wei
> 
> 
> 
> Nux! <nu...@li.nux.ro> 于2019年5月1日周三 下午4:00写道:
> 
>> I ran into a similar problem when I tried to allocate an additional IP on
>> the agent machine (for other purposes), the hypervisor would then show up
>> in the UI with this new IP and in "Alert" state.
>>
>> I solved the problem by moving the IP out of br0 and on to the loopback
>> interface.
>>
>> --
>> Sent from the Delta quadrant using Borg technology!
>>
>> Nux!
>> www.nux.ro
>>
>> ----- Original Message -----
>> > From: "li jerry" <di...@hotmail.com>
>> > To: "users" <us...@cloudstack.apache.org>, "dev" <
>> dev@cloudstack.apache.org>
>> > Sent: Monday, 22 April, 2019 14:36:51
>> > Subject: Cloudstack-agent gets the local IP address exception
>>
>> > HI All
>> >
>> >
>> > my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
>> keepalived.
>> >
>> > After I started the cloudstack-agent, I got vip[10.226.16.10] and I
>> couldn't get
>> > the correct IP [10.226.16.11];
>> >
>> > Can I have any way to get the cloudstack agent to get the correct IP
>> address?
>> >
>> >
>> >
>> > Cloudstack 4.11.2
>> > CentOS 7.5
>> >
>> >
>> >
>> > br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
>> group
>> > default qlen 1000
>> >    link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>> >    inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
>> >       valid_lft forever preferred_lft forever
>> >    inet 10.226.16.10/24 scope global secondary br2
>> >       valid_lft forever preferred_lft forever
>> >    inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>> >        valid_lft forever preferred_lft forever

Re: Cloudstack-agent gets the local IP address exception

Posted by Nux! <nu...@li.nux.ro>.
Thanks Wei, I've opened a proper issue for this, hope your fix gets applied.

https://github.com/apache/cloudstack/issues/3311

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Wei ZHOU" <us...@gmail.com>
> To: "dev" <de...@cloudstack.apache.org>
> Cc: "users" <us...@cloudstack.apache.org>
> Sent: Wednesday, 1 May, 2019 21:52:06
> Subject: Re: Cloudstack-agent gets the local IP address exception

> Hi Nux,
> 
> It is because NetworkInterface.getInterfaceAddresses() returns the ips in
> reverse order.
> For example, "ip addr show dev eth0"  shows the following ips
> inet X.X.X.X
> inet secondary Y.Y.Y.Y
> inet6 Z:Z:Z:Z:Z:Z
> 
> Then NetworkInterface.getInterfaceAddresses returns
> Z:Z:Z:Z:Z:Z
> Y.Y.Y.Y
> X.X.X.X
> 
> The following patch should work as you expect.
> 
> ```
> diff --git a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> index afe73f1..afb0ce6 100644
> --- a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> +++ b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
> @@ -32,6 +32,7 @@ import java.net.SocketException;
> import java.net.URI;
> import java.net.UnknownHostException;
> import java.util.ArrayList;
> +import java.util.Collections;
> import java.util.Formatter;
> import java.util.List;
> import java.util.Random;
> @@ -394,10 +395,11 @@ public class NetUtils {
>     }
> 
>     public static String[] getNetworkParams(final NetworkInterface nic) {
> -        final List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
> +        List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
>         if (addrs == null || addrs.size() == 0) {
>             return null;
>         }
> +        Collections.reverse(addrs);
>         InterfaceAddress addr = null;
>         for (final InterfaceAddress iaddr : addrs) {
>             final InetAddress inet = iaddr.getAddress();
> ```
> 
> 
> -Wei
> 
> 
> 
> Nux! <nu...@li.nux.ro> 于2019年5月1日周三 下午4:00写道:
> 
>> I ran into a similar problem when I tried to allocate an additional IP on
>> the agent machine (for other purposes), the hypervisor would then show up
>> in the UI with this new IP and in "Alert" state.
>>
>> I solved the problem by moving the IP out of br0 and on to the loopback
>> interface.
>>
>> --
>> Sent from the Delta quadrant using Borg technology!
>>
>> Nux!
>> www.nux.ro
>>
>> ----- Original Message -----
>> > From: "li jerry" <di...@hotmail.com>
>> > To: "users" <us...@cloudstack.apache.org>, "dev" <
>> dev@cloudstack.apache.org>
>> > Sent: Monday, 22 April, 2019 14:36:51
>> > Subject: Cloudstack-agent gets the local IP address exception
>>
>> > HI All
>> >
>> >
>> > my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
>> keepalived.
>> >
>> > After I started the cloudstack-agent, I got vip[10.226.16.10] and I
>> couldn't get
>> > the correct IP [10.226.16.11];
>> >
>> > Can I have any way to get the cloudstack agent to get the correct IP
>> address?
>> >
>> >
>> >
>> > Cloudstack 4.11.2
>> > CentOS 7.5
>> >
>> >
>> >
>> > br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
>> group
>> > default qlen 1000
>> >    link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>> >    inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
>> >       valid_lft forever preferred_lft forever
>> >    inet 10.226.16.10/24 scope global secondary br2
>> >       valid_lft forever preferred_lft forever
>> >    inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>> >        valid_lft forever preferred_lft forever

Re: Cloudstack-agent gets the local IP address exception

Posted by Wei ZHOU <us...@gmail.com>.
Hi Nux,

It is because NetworkInterface.getInterfaceAddresses() returns the ips in
reverse order.
For example, "ip addr show dev eth0"  shows the following ips
inet X.X.X.X
inet secondary Y.Y.Y.Y
inet6 Z:Z:Z:Z:Z:Z

Then NetworkInterface.getInterfaceAddresses returns
Z:Z:Z:Z:Z:Z
Y.Y.Y.Y
X.X.X.X

The following patch should work as you expect.

```
diff --git a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
index afe73f1..afb0ce6 100644
--- a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
@@ -32,6 +32,7 @@ import java.net.SocketException;
 import java.net.URI;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Formatter;
 import java.util.List;
 import java.util.Random;
@@ -394,10 +395,11 @@ public class NetUtils {
     }

     public static String[] getNetworkParams(final NetworkInterface nic) {
-        final List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
+        List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
         if (addrs == null || addrs.size() == 0) {
             return null;
         }
+        Collections.reverse(addrs);
         InterfaceAddress addr = null;
         for (final InterfaceAddress iaddr : addrs) {
             final InetAddress inet = iaddr.getAddress();
```


-Wei



Nux! <nu...@li.nux.ro> 于2019年5月1日周三 下午4:00写道:

> I ran into a similar problem when I tried to allocate an additional IP on
> the agent machine (for other purposes), the hypervisor would then show up
> in the UI with this new IP and in "Alert" state.
>
> I solved the problem by moving the IP out of br0 and on to the loopback
> interface.
>
> --
> Sent from the Delta quadrant using Borg technology!
>
> Nux!
> www.nux.ro
>
> ----- Original Message -----
> > From: "li jerry" <di...@hotmail.com>
> > To: "users" <us...@cloudstack.apache.org>, "dev" <
> dev@cloudstack.apache.org>
> > Sent: Monday, 22 April, 2019 14:36:51
> > Subject: Cloudstack-agent gets the local IP address exception
>
> > HI All
> >
> >
> > my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> keepalived.
> >
> > After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> couldn't get
> > the correct IP [10.226.16.11];
> >
> > Can I have any way to get the cloudstack agent to get the correct IP
> address?
> >
> >
> >
> > Cloudstack 4.11.2
> > CentOS 7.5
> >
> >
> >
> > br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
> group
> > default qlen 1000
> >    link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
> >    inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
> >       valid_lft forever preferred_lft forever
> >    inet 10.226.16.10/24 scope global secondary br2
> >       valid_lft forever preferred_lft forever
> >    inet6 fe80::1456:f9ff:fe06:6228/64 scope link
> >        valid_lft forever preferred_lft forever
>

Re: Cloudstack-agent gets the local IP address exception

Posted by Wei ZHOU <us...@gmail.com>.
Hi Nux,

It is because NetworkInterface.getInterfaceAddresses() returns the ips in
reverse order.
For example, "ip addr show dev eth0"  shows the following ips
inet X.X.X.X
inet secondary Y.Y.Y.Y
inet6 Z:Z:Z:Z:Z:Z

Then NetworkInterface.getInterfaceAddresses returns
Z:Z:Z:Z:Z:Z
Y.Y.Y.Y
X.X.X.X

The following patch should work as you expect.

```
diff --git a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
index afe73f1..afb0ce6 100644
--- a/utils/src/main/java/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/main/java/com/cloud/utils/net/NetUtils.java
@@ -32,6 +32,7 @@ import java.net.SocketException;
 import java.net.URI;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Formatter;
 import java.util.List;
 import java.util.Random;
@@ -394,10 +395,11 @@ public class NetUtils {
     }

     public static String[] getNetworkParams(final NetworkInterface nic) {
-        final List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
+        List<InterfaceAddress> addrs = nic.getInterfaceAddresses();
         if (addrs == null || addrs.size() == 0) {
             return null;
         }
+        Collections.reverse(addrs);
         InterfaceAddress addr = null;
         for (final InterfaceAddress iaddr : addrs) {
             final InetAddress inet = iaddr.getAddress();
```


-Wei



Nux! <nu...@li.nux.ro> 于2019年5月1日周三 下午4:00写道:

> I ran into a similar problem when I tried to allocate an additional IP on
> the agent machine (for other purposes), the hypervisor would then show up
> in the UI with this new IP and in "Alert" state.
>
> I solved the problem by moving the IP out of br0 and on to the loopback
> interface.
>
> --
> Sent from the Delta quadrant using Borg technology!
>
> Nux!
> www.nux.ro
>
> ----- Original Message -----
> > From: "li jerry" <di...@hotmail.com>
> > To: "users" <us...@cloudstack.apache.org>, "dev" <
> dev@cloudstack.apache.org>
> > Sent: Monday, 22 April, 2019 14:36:51
> > Subject: Cloudstack-agent gets the local IP address exception
>
> > HI All
> >
> >
> > my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via
> keepalived.
> >
> > After I started the cloudstack-agent, I got vip[10.226.16.10] and I
> couldn't get
> > the correct IP [10.226.16.11];
> >
> > Can I have any way to get the cloudstack agent to get the correct IP
> address?
> >
> >
> >
> > Cloudstack 4.11.2
> > CentOS 7.5
> >
> >
> >
> > br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
> group
> > default qlen 1000
> >    link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
> >    inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
> >       valid_lft forever preferred_lft forever
> >    inet 10.226.16.10/24 scope global secondary br2
> >       valid_lft forever preferred_lft forever
> >    inet6 fe80::1456:f9ff:fe06:6228/64 scope link
> >        valid_lft forever preferred_lft forever
>

Re: Cloudstack-agent gets the local IP address exception

Posted by Nux! <nu...@li.nux.ro>.
I ran into a similar problem when I tried to allocate an additional IP on the agent machine (for other purposes), the hypervisor would then show up in the UI with this new IP and in "Alert" state.

I solved the problem by moving the IP out of br0 and on to the loopback interface.

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "li jerry" <di...@hotmail.com>
> To: "users" <us...@cloudstack.apache.org>, "dev" <de...@cloudstack.apache.org>
> Sent: Monday, 22 April, 2019 14:36:51
> Subject: Cloudstack-agent gets the local IP address exception

> HI All
> 
> 
> my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via keepalived.
> 
> After I started the cloudstack-agent, I got vip[10.226.16.10] and I couldn't get
> the correct IP [10.226.16.11];
> 
> Can I have any way to get the cloudstack agent to get the correct IP address?
> 
> 
> 
> Cloudstack 4.11.2
> CentOS 7.5
> 
> 
> 
> br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group
> default qlen 1000
>    link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>    inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
>       valid_lft forever preferred_lft forever
>    inet 10.226.16.10/24 scope global secondary br2
>       valid_lft forever preferred_lft forever
>    inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>        valid_lft forever preferred_lft forever

Re: Cloudstack-agent gets the local IP address exception

Posted by Nux! <nu...@li.nux.ro>.
I ran into a similar problem when I tried to allocate an additional IP on the agent machine (for other purposes), the hypervisor would then show up in the UI with this new IP and in "Alert" state.

I solved the problem by moving the IP out of br0 and on to the loopback interface.

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "li jerry" <di...@hotmail.com>
> To: "users" <us...@cloudstack.apache.org>, "dev" <de...@cloudstack.apache.org>
> Sent: Monday, 22 April, 2019 14:36:51
> Subject: Cloudstack-agent gets the local IP address exception

> HI All
> 
> 
> my kvm host [ip:10.226.16.11] virtualized a vip[10.226.16.10] via keepalived.
> 
> After I started the cloudstack-agent, I got vip[10.226.16.10] and I couldn't get
> the correct IP [10.226.16.11];
> 
> Can I have any way to get the cloudstack agent to get the correct IP address?
> 
> 
> 
> Cloudstack 4.11.2
> CentOS 7.5
> 
> 
> 
> br2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group
> default qlen 1000
>    link/ether ac:1f:6b:ba:96:ea brd ff:ff:ff:ff:ff:ff
>    inet 10.226.16.11/24 brd 10.226.16.255 scope global noprefixroute br2
>       valid_lft forever preferred_lft forever
>    inet 10.226.16.10/24 scope global secondary br2
>       valid_lft forever preferred_lft forever
>    inet6 fe80::1456:f9ff:fe06:6228/64 scope link
>        valid_lft forever preferred_lft forever