You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Dinesh Bandara <di...@wso2.com> on 2014/06/30 13:41:13 UTC

[DISCUSS] Patching exiting cartridge instances with updates

Hi all,

I have faced in to a situation that need to update existing cartridge
instances without interrupt  the process. AFAIU there are two types of
updates that need to be applied.

   1. OS level/ Security updates
   2. Application level updates (Load balancer, PHP, MySQL)


*Patching OS level/ Security updates*

Since this is a mandatory update we have to shutdown the server and then
need to restart it after successfully update the patch. But this will
interrupt the whole process.
Cartridge agent related updates can be consider as OS level update.

*Solution*

   - Spawn a new instance and apply the updates.
   - Terminate exiting instance
   - Repeat the above steps until spawn new instances on behalf of existing
   instances

*Patching Application level updates*

Status of the cartridge instance set into 'Maintenance' mode, apply updates
and then set again as an 'Active' instance

*Expose to user*

Introduce new rest endpoint via SM which will provide the access to patch
selected cluster.

As the first step I would like to start with the "patching OS level
updates".

Highly appreciate your thoughts on this.

Thanks,
-- 
*Dinesh Bandara*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Ramith Jayasinghe <ra...@wso2.com>.
How do you guys plan to keep track of patched servers in cluster?


On Thu, Jul 24, 2014 at 11:20 AM, Akila Ravihansa Perera <ravihansa@wso2.com
> wrote:

> Hi,
>
> I think we have to think about how we are going to push Puppet changes
> to existing cartridge instances. Currently, cartridge instances will
> disable the Puppet agent after init.sh is executed [1]. This prevent
> any further Puppet configurations from being applied.
>
> We will need to introduce a new instance notifier event to signal the
> cartridge agent to enable Puppet agent and get the latest
> configuration from Puppet master.
>
>
> [1]
> https://github.com/apache/stratos/blob/master/tools/puppet3-agent/init.sh#L136
>
> On Thu, Jul 24, 2014 at 11:12 AM, Udara Liyanage <ud...@wso2.com> wrote:
> > Hi Dinesh,
> >
> > This is what I have understood, please correct me if I am wrong.
> >
> > A new API is provided where we can specify a particular cluster need to
> be
> > patched. So the process would be like below?
> >
> >  Update the puppet master with relevant changes.
> >  Call the API to patch a cluster x
> >   AS will select a non patched member per a time from the cluster x
> >   Terminate the instance
> >   Spawn another instance for replacement
> >
> > If there are large number of instances say 100, then it will take long
> time
> > to patch the whole cluster. WDYT letting the devop specify the the
> number of
> > instances that is patched for a time? So if there are large number of
> > instances, he can say like patch 5 members per time?
> >
> >
> >
> > On Thu, Jul 24, 2014 at 11:03 AM, Dinesh Bandara <di...@wso2.com>
> wrote:
> >>
> >>
> >>
> >>
> >> On Thu, Jul 24, 2014 at 10:47 AM, Nirmal Fernando <
> nirmal070125@gmail.com>
> >> wrote:
> >>>
> >>>
> >>>
> >>>
> >>> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com>
> wrote:
> >>>>
> >>>> Hi all,
> >>>>
> >>>> I have faced in to a situation that need to update existing cartridge
> >>>> instances without interrupt  the process. AFAIU there are two types of
> >>>> updates that need to be applied.
> >>>>
> >>>> OS level/ Security updates
> >>>> Application level updates (Load balancer, PHP, MySQL)
> >>>>
> >>>>
> >>>> Patching OS level/ Security updates
> >>>>
> >>>> Since this is a mandatory update we have to shutdown the server and
> then
> >>>> need to restart it after successfully update the patch. But this will
> >>>> interrupt the whole process.
> >>>> Cartridge agent related updates can be consider as OS level update.
> >>>
> >>>
> >>> I don't think we need to. IMO Cartridge agent related updates can be
> >>> applied using the same process of marking the state of the member to
> >>> maintenance mode (before agent restarts).
> >>>>
> >>>> Solution
> >>>>
> >>>> Spawn a new instance and apply the updates.
> >>>> Terminate exiting instance
> >>>> Repeat the above steps until spawn new instances on behalf of existing
> >>>> instances
> >>>
> >>>
> >>> We can't spawn new instances manually. We should let stratos do that.
> To
> >>> do an OS level update etc. we should terminate the instance from the
> IaaS
> >>> level and let Stratos spin a replacement instance (with the new
> updates).
> >>>
> >>> Preferably, we need a Stratos API to automate the manual process
> involved
> >>> here.
> >>
> >> Yes, the above solution need to implement through Startos. sorry I have
> >> missed that line in the first mail
> >>>>
> >>>> Patching Application level updates
> >>>>
> >>>> Status of the cartridge instance set into 'Maintenance' mode, apply
> >>>> updates and then set again as an 'Active' instance
> >>>>
> >>>> Expose to user
> >>>>
> >>>> Introduce new rest endpoint via SM which will provide the access to
> >>>> patch selected cluster.
> >>>
> >>>
> >>> Selected member of a cluster rather.
> >>
> >>
> >> Assume we have 100 members in the cluster, if so user has to do it for
> 100
> >> times
> >>
> >>>>
> >>>>
> >>>> As the first step I would like to start with the "patching OS level
> >>>> updates".
> >>>>
> >>>> Highly appreciate your thoughts on this.
> >>>>
> >>>> Thanks,
> >>>> --
> >>>> Dinesh Bandara
> >>>> Software Engineer
> >>>> WSO2 Inc.; http://wso2.com
> >>>> lean.enterprise.middleware
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Best Regards,
> >>> Nirmal
> >>>
> >>> Nirmal Fernando.
> >>> PPMC Member & Committer of Apache Stratos,
> >>> Senior Software Engineer, WSO2 Inc.
> >>>
> >>> Blog: http://nirmalfdo.blogspot.com/
> >>
> >>
> >>
> >>
> >> --
> >> Dinesh Bandara
> >> Software Engineer
> >> WSO2 Inc.; http://wso2.com
> >> lean.enterprise.middleware
> >>
> >
> >
> >
> > --
> >
> > Udara Liyanage
> > Software Engineer
> > WSO2, Inc.: http://wso2.com
> > lean. enterprise. middleware
> >
> > web: http://udaraliyanage.wordpress.com
> > phone: +94 71 443 6897
>
>
>
> --
> Akila Ravihansa Perera
> Software Engineer
> WSO2 Inc.
> http://wso2.com
>
> Phone: +94 77 64 154 38
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Ramith Jayasinghe
Technical Lead
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

E: ramith@wso2.com
P: +94 777542851

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi,

I think we have to think about how we are going to push Puppet changes
to existing cartridge instances. Currently, cartridge instances will
disable the Puppet agent after init.sh is executed [1]. This prevent
any further Puppet configurations from being applied.

We will need to introduce a new instance notifier event to signal the
cartridge agent to enable Puppet agent and get the latest
configuration from Puppet master.


[1] https://github.com/apache/stratos/blob/master/tools/puppet3-agent/init.sh#L136

On Thu, Jul 24, 2014 at 11:12 AM, Udara Liyanage <ud...@wso2.com> wrote:
> Hi Dinesh,
>
> This is what I have understood, please correct me if I am wrong.
>
> A new API is provided where we can specify a particular cluster need to be
> patched. So the process would be like below?
>
>  Update the puppet master with relevant changes.
>  Call the API to patch a cluster x
>   AS will select a non patched member per a time from the cluster x
>   Terminate the instance
>   Spawn another instance for replacement
>
> If there are large number of instances say 100, then it will take long time
> to patch the whole cluster. WDYT letting the devop specify the the number of
> instances that is patched for a time? So if there are large number of
> instances, he can say like patch 5 members per time?
>
>
>
> On Thu, Jul 24, 2014 at 11:03 AM, Dinesh Bandara <di...@wso2.com> wrote:
>>
>>
>>
>>
>> On Thu, Jul 24, 2014 at 10:47 AM, Nirmal Fernando <ni...@gmail.com>
>> wrote:
>>>
>>>
>>>
>>>
>>> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I have faced in to a situation that need to update existing cartridge
>>>> instances without interrupt  the process. AFAIU there are two types of
>>>> updates that need to be applied.
>>>>
>>>> OS level/ Security updates
>>>> Application level updates (Load balancer, PHP, MySQL)
>>>>
>>>>
>>>> Patching OS level/ Security updates
>>>>
>>>> Since this is a mandatory update we have to shutdown the server and then
>>>> need to restart it after successfully update the patch. But this will
>>>> interrupt the whole process.
>>>> Cartridge agent related updates can be consider as OS level update.
>>>
>>>
>>> I don't think we need to. IMO Cartridge agent related updates can be
>>> applied using the same process of marking the state of the member to
>>> maintenance mode (before agent restarts).
>>>>
>>>> Solution
>>>>
>>>> Spawn a new instance and apply the updates.
>>>> Terminate exiting instance
>>>> Repeat the above steps until spawn new instances on behalf of existing
>>>> instances
>>>
>>>
>>> We can't spawn new instances manually. We should let stratos do that. To
>>> do an OS level update etc. we should terminate the instance from the IaaS
>>> level and let Stratos spin a replacement instance (with the new updates).
>>>
>>> Preferably, we need a Stratos API to automate the manual process involved
>>> here.
>>
>> Yes, the above solution need to implement through Startos. sorry I have
>> missed that line in the first mail
>>>>
>>>> Patching Application level updates
>>>>
>>>> Status of the cartridge instance set into 'Maintenance' mode, apply
>>>> updates and then set again as an 'Active' instance
>>>>
>>>> Expose to user
>>>>
>>>> Introduce new rest endpoint via SM which will provide the access to
>>>> patch selected cluster.
>>>
>>>
>>> Selected member of a cluster rather.
>>
>>
>> Assume we have 100 members in the cluster, if so user has to do it for 100
>> times
>>
>>>>
>>>>
>>>> As the first step I would like to start with the "patching OS level
>>>> updates".
>>>>
>>>> Highly appreciate your thoughts on this.
>>>>
>>>> Thanks,
>>>> --
>>>> Dinesh Bandara
>>>> Software Engineer
>>>> WSO2 Inc.; http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>
>>
>>
>>
>> --
>> Dinesh Bandara
>> Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897



-- 
Akila Ravihansa Perera
Software Engineer
WSO2 Inc.
http://wso2.com

Phone: +94 77 64 154 38
Blog: http://ravihansa3000.blogspot.com

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Udara Liyanage <ud...@wso2.com>.
Hi Dinesh,

This is what I have understood, please correct me if I am wrong.

A new API is provided where we can specify a particular cluster need to be
patched. So the process would be like below?

 Update the puppet master with relevant changes.
 Call the API to patch a cluster x
  AS will select a non patched member per a time from the cluster x
  Terminate the instance
  Spawn another instance for replacement

If there are large number of instances say 100, then it will take long time
to patch the whole cluster. WDYT letting the devop specify the the number
of instances that is patched for a time? So if there are large number of
instances, he can say like patch 5 members per time?



On Thu, Jul 24, 2014 at 11:03 AM, Dinesh Bandara <di...@wso2.com> wrote:

>
>
>
> On Thu, Jul 24, 2014 at 10:47 AM, Nirmal Fernando <ni...@gmail.com>
> wrote:
>
>>
>>
>>
>> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:
>>
>>> Hi all,
>>>
>>> I have faced in to a situation that need to update existing cartridge
>>> instances without interrupt  the process. AFAIU there are two types of
>>> updates that need to be applied.
>>>
>>>    1. OS level/ Security updates
>>>    2. Application level updates (Load balancer, PHP, MySQL)
>>>
>>>
>>> *Patching OS level/ Security updates*
>>>
>>> Since this is a mandatory update we have to shutdown the server and then
>>> need to restart it after successfully update the patch. But this will
>>> interrupt the whole process.
>>> Cartridge agent related updates can be consider as OS level update.
>>>
>>
>> I don't think we need to. IMO Cartridge agent related updates can be
>> applied using the same process of marking the state of the member to
>> maintenance mode (before agent restarts).
>>
>>> *Solution*
>>>
>>>    - Spawn a new instance and apply the updates.
>>>    - Terminate exiting instance
>>>    - Repeat the above steps until spawn new instances on behalf of
>>>    existing instances
>>>
>>>
>> We can't spawn new instances manually. We should let stratos do that. To
>> do an OS level update etc. we should terminate the instance from the IaaS
>> level and let Stratos spin a replacement instance (with the new updates).
>>
>> Preferably, we need a Stratos API to automate the manual process involved
>> here.
>>
> Yes, the above solution need to implement through Startos. sorry I have
> missed that line in the first mail
>
>>
>>>
>>> *Patching Application level updates*
>>>
>>> Status of the cartridge instance set into 'Maintenance' mode, apply
>>> updates and then set again as an 'Active' instance
>>>
>>> *Expose to user*
>>>
>>> Introduce new rest endpoint via SM which will provide the access to
>>> patch selected cluster.
>>>
>>
>> Selected member of a cluster rather.
>>
>
> Assume we have 100 members in the cluster, if so user has to do it for 100
> times
>
>
>>
>>> As the first step I would like to start with the "patching OS level
>>> updates".
>>>
>>> Highly appreciate your thoughts on this.
>>>
>>> Thanks,
>>> --
>>> *Dinesh Bandara*
>>> Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> *Dinesh Bandara*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
>


-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Dinesh Bandara <di...@wso2.com>.
On Thu, Jul 24, 2014 at 11:11 AM, Nirmal Fernando <ni...@gmail.com>
wrote:

>
>
>
> On Thu, Jul 24, 2014 at 11:03 AM, Dinesh Bandara <di...@wso2.com> wrote:
>
>>
>>
>>
>> On Thu, Jul 24, 2014 at 10:47 AM, Nirmal Fernando <nirmal070125@gmail.com
>> > wrote:
>>
>>>
>>>
>>>
>>> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have faced in to a situation that need to update existing cartridge
>>>> instances without interrupt  the process. AFAIU there are two types of
>>>> updates that need to be applied.
>>>>
>>>>    1. OS level/ Security updates
>>>>    2. Application level updates (Load balancer, PHP, MySQL)
>>>>
>>>>
>>>> *Patching OS level/ Security updates*
>>>>
>>>> Since this is a mandatory update we have to shutdown the server and
>>>> then need to restart it after successfully update the patch. But this will
>>>> interrupt the whole process.
>>>> Cartridge agent related updates can be consider as OS level update.
>>>>
>>>
>>> I don't think we need to. IMO Cartridge agent related updates can be
>>> applied using the same process of marking the state of the member to
>>> maintenance mode (before agent restarts).
>>>
>>>> *Solution*
>>>>
>>>>    - Spawn a new instance and apply the updates.
>>>>    - Terminate exiting instance
>>>>    - Repeat the above steps until spawn new instances on behalf of
>>>>    existing instances
>>>>
>>>>
>>> We can't spawn new instances manually. We should let stratos do that. To
>>> do an OS level update etc. we should terminate the instance from the IaaS
>>> level and let Stratos spin a replacement instance (with the new updates).
>>>
>>> Preferably, we need a Stratos API to automate the manual process
>>> involved here.
>>>
>> Yes, the above solution need to implement through Startos. sorry I have
>> missed that line in the first mail
>>
>>>
>>>>
>>>> *Patching Application level updates*
>>>>
>>>> Status of the cartridge instance set into 'Maintenance' mode, apply
>>>> updates and then set again as an 'Active' instance
>>>>
>>>> *Expose to user*
>>>>
>>>> Introduce new rest endpoint via SM which will provide the access to
>>>> patch selected cluster.
>>>>
>>>
>>> Selected member of a cluster rather.
>>>
>>
>> Assume we have 100 members in the cluster, if so user has to do it for
>> 100 times
>>
>
> Well, true that.. but bringing down the cluster as a whole would not be a
> viable solution too. We need some algorithm I guess.
>
Yes, We have to change auto scaling algorithm and need to get the number of
instances we are going to apply patches through API per time. Then Startos
will apply patches until all the members get updated .

>
>>
>>>
>>>> As the first step I would like to start with the "patching OS level
>>>> updates".
>>>>
>>>> Highly appreciate your thoughts on this.
>>>>
>>>> Thanks,
>>>> --
>>>> *Dinesh Bandara*
>>>> Software Engineer
>>>> WSO2 Inc.; http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> *Dinesh Bandara*
>> Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
*Dinesh Bandara*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Nirmal Fernando <ni...@gmail.com>.
On Thu, Jul 24, 2014 at 11:03 AM, Dinesh Bandara <di...@wso2.com> wrote:

>
>
>
> On Thu, Jul 24, 2014 at 10:47 AM, Nirmal Fernando <ni...@gmail.com>
> wrote:
>
>>
>>
>>
>> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:
>>
>>> Hi all,
>>>
>>> I have faced in to a situation that need to update existing cartridge
>>> instances without interrupt  the process. AFAIU there are two types of
>>> updates that need to be applied.
>>>
>>>    1. OS level/ Security updates
>>>    2. Application level updates (Load balancer, PHP, MySQL)
>>>
>>>
>>> *Patching OS level/ Security updates*
>>>
>>> Since this is a mandatory update we have to shutdown the server and then
>>> need to restart it after successfully update the patch. But this will
>>> interrupt the whole process.
>>> Cartridge agent related updates can be consider as OS level update.
>>>
>>
>> I don't think we need to. IMO Cartridge agent related updates can be
>> applied using the same process of marking the state of the member to
>> maintenance mode (before agent restarts).
>>
>>> *Solution*
>>>
>>>    - Spawn a new instance and apply the updates.
>>>    - Terminate exiting instance
>>>    - Repeat the above steps until spawn new instances on behalf of
>>>    existing instances
>>>
>>>
>> We can't spawn new instances manually. We should let stratos do that. To
>> do an OS level update etc. we should terminate the instance from the IaaS
>> level and let Stratos spin a replacement instance (with the new updates).
>>
>> Preferably, we need a Stratos API to automate the manual process involved
>> here.
>>
> Yes, the above solution need to implement through Startos. sorry I have
> missed that line in the first mail
>
>>
>>>
>>> *Patching Application level updates*
>>>
>>> Status of the cartridge instance set into 'Maintenance' mode, apply
>>> updates and then set again as an 'Active' instance
>>>
>>> *Expose to user*
>>>
>>> Introduce new rest endpoint via SM which will provide the access to
>>> patch selected cluster.
>>>
>>
>> Selected member of a cluster rather.
>>
>
> Assume we have 100 members in the cluster, if so user has to do it for 100
> times
>

Well, true that.. but bringing down the cluster as a whole would not be a
viable solution too. We need some algorithm I guess.

>
>
>>
>>> As the first step I would like to start with the "patching OS level
>>> updates".
>>>
>>> Highly appreciate your thoughts on this.
>>>
>>> Thanks,
>>> --
>>> *Dinesh Bandara*
>>> Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> *Dinesh Bandara*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
>


-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Dinesh Bandara <di...@wso2.com>.
On Thu, Jul 24, 2014 at 10:47 AM, Nirmal Fernando <ni...@gmail.com>
wrote:

>
>
>
> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:
>
>> Hi all,
>>
>> I have faced in to a situation that need to update existing cartridge
>> instances without interrupt  the process. AFAIU there are two types of
>> updates that need to be applied.
>>
>>    1. OS level/ Security updates
>>    2. Application level updates (Load balancer, PHP, MySQL)
>>
>>
>> *Patching OS level/ Security updates*
>>
>> Since this is a mandatory update we have to shutdown the server and then
>> need to restart it after successfully update the patch. But this will
>> interrupt the whole process.
>> Cartridge agent related updates can be consider as OS level update.
>>
>
> I don't think we need to. IMO Cartridge agent related updates can be
> applied using the same process of marking the state of the member to
> maintenance mode (before agent restarts).
>
>> *Solution*
>>
>>    - Spawn a new instance and apply the updates.
>>    - Terminate exiting instance
>>    - Repeat the above steps until spawn new instances on behalf of
>>    existing instances
>>
>>
> We can't spawn new instances manually. We should let stratos do that. To
> do an OS level update etc. we should terminate the instance from the IaaS
> level and let Stratos spin a replacement instance (with the new updates).
>
> Preferably, we need a Stratos API to automate the manual process involved
> here.
>
Yes, the above solution need to implement through Startos. sorry I have
missed that line in the first mail

>
>>
>> *Patching Application level updates*
>>
>> Status of the cartridge instance set into 'Maintenance' mode, apply
>> updates and then set again as an 'Active' instance
>>
>> *Expose to user*
>>
>> Introduce new rest endpoint via SM which will provide the access to patch
>> selected cluster.
>>
>
> Selected member of a cluster rather.
>

Assume we have 100 members in the cluster, if so user has to do it for 100
times


>
>> As the first step I would like to start with the "patching OS level
>> updates".
>>
>> Highly appreciate your thoughts on this.
>>
>> Thanks,
>> --
>> *Dinesh Bandara*
>> Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
*Dinesh Bandara*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Nirmal Fernando <ni...@gmail.com>.
On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:

> Hi all,
>
> I have faced in to a situation that need to update existing cartridge
> instances without interrupt  the process. AFAIU there are two types of
> updates that need to be applied.
>
>    1. OS level/ Security updates
>    2. Application level updates (Load balancer, PHP, MySQL)
>
>
> *Patching OS level/ Security updates*
>
> Since this is a mandatory update we have to shutdown the server and then
> need to restart it after successfully update the patch. But this will
> interrupt the whole process.
> Cartridge agent related updates can be consider as OS level update.
>

I don't think we need to. IMO Cartridge agent related updates can be
applied using the same process of marking the state of the member to
maintenance mode (before agent restarts).

> *Solution*
>
>    - Spawn a new instance and apply the updates.
>    - Terminate exiting instance
>    - Repeat the above steps until spawn new instances on behalf of
>    existing instances
>
>
We can't spawn new instances manually. We should let stratos do that. To do
an OS level update etc. we should terminate the instance from the IaaS
level and let Stratos spin a replacement instance (with the new updates).

Preferably, we need a Stratos API to automate the manual process involved
here.

>
>
> *Patching Application level updates*
>
> Status of the cartridge instance set into 'Maintenance' mode, apply
> updates and then set again as an 'Active' instance
>
> *Expose to user*
>
> Introduce new rest endpoint via SM which will provide the access to patch
> selected cluster.
>

Selected member of a cluster rather.

>
> As the first step I would like to start with the "patching OS level
> updates".
>
> Highly appreciate your thoughts on this.
>
> Thanks,
> --
> *Dinesh Bandara*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
>


-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Dinesh,

AFAIR, we introduced a state to the cluster as CLUSTER_INMAINTAINENCE_MODE.
So that cluster monitor will get paused until the cluster become active
again. In that way, we can avoid autoscaler taking any additional decision.
Do you think that we can re-use this state here when we apply the patches?

Thanks,
Reka


On Thu, Jul 24, 2014 at 12:13 PM, Dinesh Bandara <di...@wso2.com> wrote:

>
> On Thu, Jul 24, 2014 at 11:26 AM, Sajith Kariyawasam <sa...@wso2.com>
> wrote:
>
>> What I meant was "rebooting" the same instance [1]
>>
>> [1]
>> http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-reboot.html
>>
>> While rebooting the instance, agent is down for sometime and AS will
> terminate the instance assuming instance is a faulty member. then Stratos
> will spawn a new cartridge instance.
> Another disadvantage it will violate the high availability concept if we
> only have a one instance.
>
>>
>> On Thu, Jul 24, 2014 at 11:21 AM, Sajith Kariyawasam <sa...@wso2.com>
>> wrote:
>>
>>>
>>> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have faced in to a situation that need to update existing cartridge
>>>> instances without interrupt  the process. AFAIU there are two types of
>>>> updates that need to be applied.
>>>>
>>>>    1. OS level/ Security updates
>>>>    2. Application level updates (Load balancer, PHP, MySQL)
>>>>
>>>>
>>>> *Patching OS level/ Security updates*
>>>>
>>>> Since this is a mandatory update we have to shutdown the server and
>>>> then need to restart it after successfully update the patch. But this will
>>>> interrupt the whole process.
>>>> Cartridge agent related updates can be consider as OS level update.
>>>>
>>>> *Solution*
>>>>
>>>>    - Spawn a new instance and apply the updates.
>>>>    - Terminate exiting instance
>>>>
>>>>
>>> Can't we think of restarting the same instance (After executing updates)
>>> rather than terminating and spawning a new one? Because terminating and
>>> starting a new one may incur additional cost, for eg, AFAIK Amazon EC2
>>> rates are based on per-hour, so if the instance terminate / re-spawn
>>> happens in the middle of an hour, it will double the cost per instance
>>>
>>>>
>>>>    -
>>>>    - Repeat the above steps until spawn new instances on behalf of
>>>>    existing instances
>>>>
>>>> *Patching Application level updates*
>>>>
>>>> Status of the cartridge instance set into 'Maintenance' mode, apply
>>>> updates and then set again as an 'Active' instance
>>>>
>>>> *Expose to user*
>>>>
>>>> Introduce new rest endpoint via SM which will provide the access to
>>>> patch selected cluster.
>>>>
>>>> As the first step I would like to start with the "patching OS level
>>>> updates".
>>>>
>>>> Highly appreciate your thoughts on this.
>>>>
>>>> Thanks,
>>>> --
>>>> *Dinesh Bandara*
>>>> Software Engineer
>>>> WSO2 Inc.; http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>>
>>>
>>>
>>> --
>>> *--*
>>> *Sajith Kariyawasam*
>>> *Mobile: +94772269575 <%2B94772269575>*
>>>
>>
>>
>>
>> --
>> *--*
>> *Sajith Kariyawasam*
>> *Mobile: +94772269575 <%2B94772269575>*
>>
>
>
>
> --
> *Dinesh Bandara*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
>


-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Dinesh Bandara <di...@wso2.com>.
On Thu, Jul 24, 2014 at 11:26 AM, Sajith Kariyawasam <sa...@wso2.com>
wrote:

> What I meant was "rebooting" the same instance [1]
>
> [1]
> http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-reboot.html
>
> While rebooting the instance, agent is down for sometime and AS will
terminate the instance assuming instance is a faulty member. then Stratos
will spawn a new cartridge instance.
Another disadvantage it will violate the high availability concept if we
only have a one instance.

>
> On Thu, Jul 24, 2014 at 11:21 AM, Sajith Kariyawasam <sa...@wso2.com>
> wrote:
>
>>
>> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:
>>
>>> Hi all,
>>>
>>> I have faced in to a situation that need to update existing cartridge
>>> instances without interrupt  the process. AFAIU there are two types of
>>> updates that need to be applied.
>>>
>>>    1. OS level/ Security updates
>>>    2. Application level updates (Load balancer, PHP, MySQL)
>>>
>>>
>>> *Patching OS level/ Security updates*
>>>
>>> Since this is a mandatory update we have to shutdown the server and then
>>> need to restart it after successfully update the patch. But this will
>>> interrupt the whole process.
>>> Cartridge agent related updates can be consider as OS level update.
>>>
>>> *Solution*
>>>
>>>    - Spawn a new instance and apply the updates.
>>>    - Terminate exiting instance
>>>
>>>
>> Can't we think of restarting the same instance (After executing updates)
>> rather than terminating and spawning a new one? Because terminating and
>> starting a new one may incur additional cost, for eg, AFAIK Amazon EC2
>> rates are based on per-hour, so if the instance terminate / re-spawn
>> happens in the middle of an hour, it will double the cost per instance
>>
>>>
>>>    -
>>>    - Repeat the above steps until spawn new instances on behalf of
>>>    existing instances
>>>
>>> *Patching Application level updates*
>>>
>>> Status of the cartridge instance set into 'Maintenance' mode, apply
>>> updates and then set again as an 'Active' instance
>>>
>>> *Expose to user*
>>>
>>> Introduce new rest endpoint via SM which will provide the access to
>>> patch selected cluster.
>>>
>>> As the first step I would like to start with the "patching OS level
>>> updates".
>>>
>>> Highly appreciate your thoughts on this.
>>>
>>> Thanks,
>>> --
>>> *Dinesh Bandara*
>>> Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>>
>>
>>
>> --
>> *--*
>> *Sajith Kariyawasam*
>> *Mobile: +94772269575 <%2B94772269575>*
>>
>
>
>
> --
> *--*
> *Sajith Kariyawasam*
> *Mobile: +94772269575 <%2B94772269575>*
>



-- 
*Dinesh Bandara*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Sajith Kariyawasam <sa...@wso2.com>.
What I meant was "rebooting" the same instance [1]

[1]
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-reboot.html


On Thu, Jul 24, 2014 at 11:21 AM, Sajith Kariyawasam <sa...@wso2.com>
wrote:

>
> On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:
>
>> Hi all,
>>
>> I have faced in to a situation that need to update existing cartridge
>> instances without interrupt  the process. AFAIU there are two types of
>> updates that need to be applied.
>>
>>    1. OS level/ Security updates
>>    2. Application level updates (Load balancer, PHP, MySQL)
>>
>>
>> *Patching OS level/ Security updates*
>>
>> Since this is a mandatory update we have to shutdown the server and then
>> need to restart it after successfully update the patch. But this will
>> interrupt the whole process.
>> Cartridge agent related updates can be consider as OS level update.
>>
>> *Solution*
>>
>>    - Spawn a new instance and apply the updates.
>>    - Terminate exiting instance
>>
>>
> Can't we think of restarting the same instance (After executing updates)
> rather than terminating and spawning a new one? Because terminating and
> starting a new one may incur additional cost, for eg, AFAIK Amazon EC2
> rates are based on per-hour, so if the instance terminate / re-spawn
> happens in the middle of an hour, it will double the cost per instance
>
>>
>>    -
>>    - Repeat the above steps until spawn new instances on behalf of
>>    existing instances
>>
>> *Patching Application level updates*
>>
>> Status of the cartridge instance set into 'Maintenance' mode, apply
>> updates and then set again as an 'Active' instance
>>
>> *Expose to user*
>>
>> Introduce new rest endpoint via SM which will provide the access to patch
>> selected cluster.
>>
>> As the first step I would like to start with the "patching OS level
>> updates".
>>
>> Highly appreciate your thoughts on this.
>>
>> Thanks,
>> --
>> *Dinesh Bandara*
>> Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>>
>
>
> --
> *--*
> *Sajith Kariyawasam*
> *Mobile: +94772269575 <%2B94772269575>*
>



-- 
*--*
*Sajith Kariyawasam*
*Mobile: +94772269575*

Re: [DISCUSS] Patching exiting cartridge instances with updates

Posted by Sajith Kariyawasam <sa...@wso2.com>.
On Mon, Jun 30, 2014 at 5:11 PM, Dinesh Bandara <di...@wso2.com> wrote:

> Hi all,
>
> I have faced in to a situation that need to update existing cartridge
> instances without interrupt  the process. AFAIU there are two types of
> updates that need to be applied.
>
>    1. OS level/ Security updates
>    2. Application level updates (Load balancer, PHP, MySQL)
>
>
> *Patching OS level/ Security updates*
>
> Since this is a mandatory update we have to shutdown the server and then
> need to restart it after successfully update the patch. But this will
> interrupt the whole process.
> Cartridge agent related updates can be consider as OS level update.
>
> *Solution*
>
>    - Spawn a new instance and apply the updates.
>    - Terminate exiting instance
>
>
Can't we think of restarting the same instance (After executing updates)
rather than terminating and spawning a new one? Because terminating and
starting a new one may incur additional cost, for eg, AFAIK Amazon EC2
rates are based on per-hour, so if the instance terminate / re-spawn
happens in the middle of an hour, it will double the cost per instance

>
>    -
>    - Repeat the above steps until spawn new instances on behalf of
>    existing instances
>
> *Patching Application level updates*
>
> Status of the cartridge instance set into 'Maintenance' mode, apply
> updates and then set again as an 'Active' instance
>
> *Expose to user*
>
> Introduce new rest endpoint via SM which will provide the access to patch
> selected cluster.
>
> As the first step I would like to start with the "patching OS level
> updates".
>
> Highly appreciate your thoughts on this.
>
> Thanks,
> --
> *Dinesh Bandara*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
>


-- 
*--*
*Sajith Kariyawasam*
*Mobile: +94772269575*