You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Swapnil Patil <sw...@gmail.com> on 2015/06/19 17:35:07 UTC

Retrieving EC2 instance id from its public IP address

Hi Imesh,

As discussed in the last hangout. I tried if we can get instance id using
public IP of the ec2 instance. It is indeed possible to do this.

I have committed code for this in the client for AWS API [1].

So just wondering if this is what we should use instead of making changes
to expose instance id through topology.

[1] :
https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112


Thanks and Regards,
Swapnil

Re: Retrieving EC2 instance id from its public IP address

Posted by Swapnil Patil <sw...@gmail.com>.
Hi Imesh,

Thanks for the feedback.

Yes, as we have earlier communicated on how to expose instance id, I have
few changes to be done in my mind. I will make these changes and we can
then go through them to see if what I have done is correct or not and if
anything else needs to be done.

Okay, we will take care of this while documenting.

Thanks and Regards,
Swapnil

On Sun, Jun 21, 2015 at 9:04 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Swapnil,
>
> Thanks for the details, yes may be we can go ahead and add the Instance Id
> to the Member definition in the messaging component Topology. We will also
> need to add it to the load balancer Topology (load balancer has a separate
> structure).
>
> Please note that Autoscaler also use the term "Instance Id" to refer
> Application Instances, Group Instances & Cluster Instances. May be we need
> to clearly document this.
>
> Thanks
>
> On Sun, Jun 21, 2015 at 2:14 PM, Swapnil Patil <sw...@gmail.com>
> wrote:
>
>> Hi Imesh,
>>
>> Yes we can do that. But it doesn't reduce the time taken by the method
>> call. It is more or less same as when filters are used.
>>
>> I was wondering if Asanka also needs instance id for GCE load balancer
>> support and how he is doing it? Whether he can also use some mechanism like
>> this or he does need to expose instance id through topology?
>>
>> If he needs to expose instance id through topology then I think we should
>> also use instance id from topology instead of this API call.
>>
>> Thanks and Regards,
>> Swapnil
>>
>> On Sun, Jun 21, 2015 at 2:26 AM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>
>>> Hi Swapnil,
>>>
>>> May be we can do a instance query without any filters and then find the
>>> required instances that match the IP addresses locally.
>>>
>>> Thanks
>>>
>>> On Fri, Jun 19, 2015 at 9:17 PM, Swapnil Patil <sw...@gmail.com>
>>> wrote:
>>>
>>>> Just one concern here.
>>>>
>>>> I measured the time required for this method call. It is around 3
>>>> seconds. And this is just for one instance. In the production when we have
>>>> numerous instances, we can use batching to reduce total time but still the
>>>> time taken will be above 3 seconds.
>>>>
>>>> Thanks and Regards,
>>>> Swapnil
>>>>
>>>> On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <sw...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> As discussed in the last hangout. I tried if we can get instance id
>>>>> using public IP of the ec2 instance. It is indeed possible to do this.
>>>>>
>>>>> I have committed code for this in the client for AWS API [1].
>>>>>
>>>>> So just wondering if this is what we should use instead of making
>>>>> changes to expose instance id through topology.
>>>>>
>>>>> [1] :
>>>>> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>>>>>
>>>>>
>>>>> Thanks and Regards,
>>>>> Swapnil
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Senior Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Senior Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: Retrieving EC2 instance id from its public IP address

Posted by Imesh Gunaratne <im...@apache.org>.
Thanks Asanka! Great work! Yes please arrange a hangout to analyze the
implementation details. I will also join.

Thanks

On Sun, Jun 21, 2015 at 2:54 PM, Asanka Sanjaya Herath <an...@gmail.com>
wrote:

> Hi Swapnil and Imesh,
>
> I have implemented a way to retrieve the instance ID my adding a new field
> to org.apache.stratos.load.balancer.common.domain.Member class and doing
> relevant changes
> to org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder
> class.
> You can see it by analyzing commits here[1]. I'm about to discuss this
> implantation in next hangout, since I'm not sure that I followed the
> correct way or not. And it seems like in GCE too we can use the private IP
> to retrieve the instance ID.
>
> [1]. https://github.com/asankasanjaya/stratos
>
> On Sun, Jun 21, 2015 at 2:34 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi Swapnil,
>>
>> Thanks for the details, yes may be we can go ahead and add the Instance
>> Id to the Member definition in the messaging component Topology. We will
>> also need to add it to the load balancer Topology (load balancer has a
>> separate structure).
>>
>> Please note that Autoscaler also use the term "Instance Id" to refer
>> Application Instances, Group Instances & Cluster Instances. May be we need
>> to clearly document this.
>>
>> Thanks
>>
>> On Sun, Jun 21, 2015 at 2:14 PM, Swapnil Patil <sw...@gmail.com>
>> wrote:
>>
>>> Hi Imesh,
>>>
>>> Yes we can do that. But it doesn't reduce the time taken by the method
>>> call. It is more or less same as when filters are used.
>>>
>>> I was wondering if Asanka also needs instance id for GCE load balancer
>>> support and how he is doing it? Whether he can also use some mechanism like
>>> this or he does need to expose instance id through topology?
>>>
>>> If he needs to expose instance id through topology then I think we
>>> should also use instance id from topology instead of this API call.
>>>
>>> Thanks and Regards,
>>> Swapnil
>>>
>>> On Sun, Jun 21, 2015 at 2:26 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Hi Swapnil,
>>>>
>>>> May be we can do a instance query without any filters and then find the
>>>> required instances that match the IP addresses locally.
>>>>
>>>> Thanks
>>>>
>>>> On Fri, Jun 19, 2015 at 9:17 PM, Swapnil Patil <sw...@gmail.com>
>>>> wrote:
>>>>
>>>>> Just one concern here.
>>>>>
>>>>> I measured the time required for this method call. It is around 3
>>>>> seconds. And this is just for one instance. In the production when we have
>>>>> numerous instances, we can use batching to reduce total time but still the
>>>>> time taken will be above 3 seconds.
>>>>>
>>>>> Thanks and Regards,
>>>>> Swapnil
>>>>>
>>>>> On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <swapnil.rp15@gmail.com
>>>>> > wrote:
>>>>>
>>>>>> Hi Imesh,
>>>>>>
>>>>>> As discussed in the last hangout. I tried if we can get instance id
>>>>>> using public IP of the ec2 instance. It is indeed possible to do this.
>>>>>>
>>>>>> I have committed code for this in the client for AWS API [1].
>>>>>>
>>>>>> So just wondering if this is what we should use instead of making
>>>>>> changes to expose instance id through topology.
>>>>>>
>>>>>> [1] :
>>>>>> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>>>>>>
>>>>>>
>>>>>> Thanks and Regards,
>>>>>> Swapnil
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Senior Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Senior Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Thanks,
> Regards,
> ASH
>



-- 
Imesh Gunaratne

Senior Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: Retrieving EC2 instance id from its public IP address

Posted by Swapnil Patil <sw...@gmail.com>.
Hi Asanka,

Thanks for your input.

I went through your changes. I also have figured out similar approach.

We will see how things go in hangout and what do you decide on this
approach.

Thanks and Regards,
Swapnil

On Sun, Jun 21, 2015 at 9:24 AM, Asanka Sanjaya Herath <an...@gmail.com>
wrote:

> Hi Swapnil and Imesh,
>
> I have implemented a way to retrieve the instance ID my adding a new field
> to org.apache.stratos.load.balancer.common.domain.Member class and doing
> relevant changes
> to org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder
> class.
> You can see it by analyzing commits here[1]. I'm about to discuss this
> implantation in next hangout, since I'm not sure that I followed the
> correct way or not. And it seems like in GCE too we can use the private IP
> to retrieve the instance ID.
>
> [1]. https://github.com/asankasanjaya/stratos
>
> On Sun, Jun 21, 2015 at 2:34 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi Swapnil,
>>
>> Thanks for the details, yes may be we can go ahead and add the Instance
>> Id to the Member definition in the messaging component Topology. We will
>> also need to add it to the load balancer Topology (load balancer has a
>> separate structure).
>>
>> Please note that Autoscaler also use the term "Instance Id" to refer
>> Application Instances, Group Instances & Cluster Instances. May be we need
>> to clearly document this.
>>
>> Thanks
>>
>> On Sun, Jun 21, 2015 at 2:14 PM, Swapnil Patil <sw...@gmail.com>
>> wrote:
>>
>>> Hi Imesh,
>>>
>>> Yes we can do that. But it doesn't reduce the time taken by the method
>>> call. It is more or less same as when filters are used.
>>>
>>> I was wondering if Asanka also needs instance id for GCE load balancer
>>> support and how he is doing it? Whether he can also use some mechanism like
>>> this or he does need to expose instance id through topology?
>>>
>>> If he needs to expose instance id through topology then I think we
>>> should also use instance id from topology instead of this API call.
>>>
>>> Thanks and Regards,
>>> Swapnil
>>>
>>> On Sun, Jun 21, 2015 at 2:26 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Hi Swapnil,
>>>>
>>>> May be we can do a instance query without any filters and then find the
>>>> required instances that match the IP addresses locally.
>>>>
>>>> Thanks
>>>>
>>>> On Fri, Jun 19, 2015 at 9:17 PM, Swapnil Patil <sw...@gmail.com>
>>>> wrote:
>>>>
>>>>> Just one concern here.
>>>>>
>>>>> I measured the time required for this method call. It is around 3
>>>>> seconds. And this is just for one instance. In the production when we have
>>>>> numerous instances, we can use batching to reduce total time but still the
>>>>> time taken will be above 3 seconds.
>>>>>
>>>>> Thanks and Regards,
>>>>> Swapnil
>>>>>
>>>>> On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <swapnil.rp15@gmail.com
>>>>> > wrote:
>>>>>
>>>>>> Hi Imesh,
>>>>>>
>>>>>> As discussed in the last hangout. I tried if we can get instance id
>>>>>> using public IP of the ec2 instance. It is indeed possible to do this.
>>>>>>
>>>>>> I have committed code for this in the client for AWS API [1].
>>>>>>
>>>>>> So just wondering if this is what we should use instead of making
>>>>>> changes to expose instance id through topology.
>>>>>>
>>>>>> [1] :
>>>>>> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>>>>>>
>>>>>>
>>>>>> Thanks and Regards,
>>>>>> Swapnil
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Senior Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Senior Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Thanks,
> Regards,
> ASH
>

Re: Retrieving EC2 instance id from its public IP address

Posted by Asanka Sanjaya Herath <an...@gmail.com>.
Hi Swapnil and Imesh,

I have implemented a way to retrieve the instance ID my adding a new field
to org.apache.stratos.load.balancer.common.domain.Member class and doing
relevant changes
to org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder
class.
You can see it by analyzing commits here[1]. I'm about to discuss this
implantation in next hangout, since I'm not sure that I followed the
correct way or not. And it seems like in GCE too we can use the private IP
to retrieve the instance ID.

[1]. https://github.com/asankasanjaya/stratos

On Sun, Jun 21, 2015 at 2:34 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Swapnil,
>
> Thanks for the details, yes may be we can go ahead and add the Instance Id
> to the Member definition in the messaging component Topology. We will also
> need to add it to the load balancer Topology (load balancer has a separate
> structure).
>
> Please note that Autoscaler also use the term "Instance Id" to refer
> Application Instances, Group Instances & Cluster Instances. May be we need
> to clearly document this.
>
> Thanks
>
> On Sun, Jun 21, 2015 at 2:14 PM, Swapnil Patil <sw...@gmail.com>
> wrote:
>
>> Hi Imesh,
>>
>> Yes we can do that. But it doesn't reduce the time taken by the method
>> call. It is more or less same as when filters are used.
>>
>> I was wondering if Asanka also needs instance id for GCE load balancer
>> support and how he is doing it? Whether he can also use some mechanism like
>> this or he does need to expose instance id through topology?
>>
>> If he needs to expose instance id through topology then I think we should
>> also use instance id from topology instead of this API call.
>>
>> Thanks and Regards,
>> Swapnil
>>
>> On Sun, Jun 21, 2015 at 2:26 AM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>
>>> Hi Swapnil,
>>>
>>> May be we can do a instance query without any filters and then find the
>>> required instances that match the IP addresses locally.
>>>
>>> Thanks
>>>
>>> On Fri, Jun 19, 2015 at 9:17 PM, Swapnil Patil <sw...@gmail.com>
>>> wrote:
>>>
>>>> Just one concern here.
>>>>
>>>> I measured the time required for this method call. It is around 3
>>>> seconds. And this is just for one instance. In the production when we have
>>>> numerous instances, we can use batching to reduce total time but still the
>>>> time taken will be above 3 seconds.
>>>>
>>>> Thanks and Regards,
>>>> Swapnil
>>>>
>>>> On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <sw...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Imesh,
>>>>>
>>>>> As discussed in the last hangout. I tried if we can get instance id
>>>>> using public IP of the ec2 instance. It is indeed possible to do this.
>>>>>
>>>>> I have committed code for this in the client for AWS API [1].
>>>>>
>>>>> So just wondering if this is what we should use instead of making
>>>>> changes to expose instance id through topology.
>>>>>
>>>>> [1] :
>>>>> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>>>>>
>>>>>
>>>>> Thanks and Regards,
>>>>> Swapnil
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Senior Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Senior Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Thanks,
Regards,
ASH

Re: Retrieving EC2 instance id from its public IP address

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Swapnil,

Thanks for the details, yes may be we can go ahead and add the Instance Id
to the Member definition in the messaging component Topology. We will also
need to add it to the load balancer Topology (load balancer has a separate
structure).

Please note that Autoscaler also use the term "Instance Id" to refer
Application Instances, Group Instances & Cluster Instances. May be we need
to clearly document this.

Thanks

On Sun, Jun 21, 2015 at 2:14 PM, Swapnil Patil <sw...@gmail.com>
wrote:

> Hi Imesh,
>
> Yes we can do that. But it doesn't reduce the time taken by the method
> call. It is more or less same as when filters are used.
>
> I was wondering if Asanka also needs instance id for GCE load balancer
> support and how he is doing it? Whether he can also use some mechanism like
> this or he does need to expose instance id through topology?
>
> If he needs to expose instance id through topology then I think we should
> also use instance id from topology instead of this API call.
>
> Thanks and Regards,
> Swapnil
>
> On Sun, Jun 21, 2015 at 2:26 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Hi Swapnil,
>>
>> May be we can do a instance query without any filters and then find the
>> required instances that match the IP addresses locally.
>>
>> Thanks
>>
>> On Fri, Jun 19, 2015 at 9:17 PM, Swapnil Patil <sw...@gmail.com>
>> wrote:
>>
>>> Just one concern here.
>>>
>>> I measured the time required for this method call. It is around 3
>>> seconds. And this is just for one instance. In the production when we have
>>> numerous instances, we can use batching to reduce total time but still the
>>> time taken will be above 3 seconds.
>>>
>>> Thanks and Regards,
>>> Swapnil
>>>
>>> On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <sw...@gmail.com>
>>> wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> As discussed in the last hangout. I tried if we can get instance id
>>>> using public IP of the ec2 instance. It is indeed possible to do this.
>>>>
>>>> I have committed code for this in the client for AWS API [1].
>>>>
>>>> So just wondering if this is what we should use instead of making
>>>> changes to expose instance id through topology.
>>>>
>>>> [1] :
>>>> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>>>>
>>>>
>>>> Thanks and Regards,
>>>> Swapnil
>>>>
>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Senior Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>


-- 
Imesh Gunaratne

Senior Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: Retrieving EC2 instance id from its public IP address

Posted by Swapnil Patil <sw...@gmail.com>.
Hi Imesh,

Yes we can do that. But it doesn't reduce the time taken by the method
call. It is more or less same as when filters are used.

I was wondering if Asanka also needs instance id for GCE load balancer
support and how he is doing it? Whether he can also use some mechanism like
this or he does need to expose instance id through topology?

If he needs to expose instance id through topology then I think we should
also use instance id from topology instead of this API call.

Thanks and Regards,
Swapnil

On Sun, Jun 21, 2015 at 2:26 AM, Imesh Gunaratne <im...@apache.org> wrote:

> Hi Swapnil,
>
> May be we can do a instance query without any filters and then find the
> required instances that match the IP addresses locally.
>
> Thanks
>
> On Fri, Jun 19, 2015 at 9:17 PM, Swapnil Patil <sw...@gmail.com>
> wrote:
>
>> Just one concern here.
>>
>> I measured the time required for this method call. It is around 3
>> seconds. And this is just for one instance. In the production when we have
>> numerous instances, we can use batching to reduce total time but still the
>> time taken will be above 3 seconds.
>>
>> Thanks and Regards,
>> Swapnil
>>
>> On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <sw...@gmail.com>
>> wrote:
>>
>>> Hi Imesh,
>>>
>>> As discussed in the last hangout. I tried if we can get instance id
>>> using public IP of the ec2 instance. It is indeed possible to do this.
>>>
>>> I have committed code for this in the client for AWS API [1].
>>>
>>> So just wondering if this is what we should use instead of making
>>> changes to expose instance id through topology.
>>>
>>> [1] :
>>> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>>>
>>>
>>> Thanks and Regards,
>>> Swapnil
>>>
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Senior Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>

Re: Retrieving EC2 instance id from its public IP address

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Swapnil,

May be we can do a instance query without any filters and then find the
required instances that match the IP addresses locally.

Thanks

On Fri, Jun 19, 2015 at 9:17 PM, Swapnil Patil <sw...@gmail.com>
wrote:

> Just one concern here.
>
> I measured the time required for this method call. It is around 3 seconds.
> And this is just for one instance. In the production when we have numerous
> instances, we can use batching to reduce total time but still the time
> taken will be above 3 seconds.
>
> Thanks and Regards,
> Swapnil
>
> On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <sw...@gmail.com>
> wrote:
>
>> Hi Imesh,
>>
>> As discussed in the last hangout. I tried if we can get instance id using
>> public IP of the ec2 instance. It is indeed possible to do this.
>>
>> I have committed code for this in the client for AWS API [1].
>>
>> So just wondering if this is what we should use instead of making changes
>> to expose instance id through topology.
>>
>> [1] :
>> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>>
>>
>> Thanks and Regards,
>> Swapnil
>>
>
>


-- 
Imesh Gunaratne

Senior Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: Retrieving EC2 instance id from its public IP address

Posted by Swapnil Patil <sw...@gmail.com>.
Just one concern here.

I measured the time required for this method call. It is around 3 seconds.
And this is just for one instance. In the production when we have numerous
instances, we can use batching to reduce total time but still the time
taken will be above 3 seconds.

Thanks and Regards,
Swapnil

On Fri, Jun 19, 2015 at 3:35 PM, Swapnil Patil <sw...@gmail.com>
wrote:

> Hi Imesh,
>
> As discussed in the last hangout. I tried if we can get instance id using
> public IP of the ec2 instance. It is indeed possible to do this.
>
> I have committed code for this in the client for AWS API [1].
>
> So just wondering if this is what we should use instead of making changes
> to expose instance id through topology.
>
> [1] :
> https://github.com/swaprp15/AWS_ELB_Client/commit/c0df56e570c5d05063ec27c1d210087e3120e112
>
>
> Thanks and Regards,
> Swapnil
>