How to quickly re-deploy the same charm

Casey Marshall casey.marshall at canonical.com
Fri Aug 18 16:01:45 UTC 2017


With juju 2, you can also use --force-units to upgrade the charm even in an
error state:

juju upgrade-charm --path /path/to/mycharm --force-units mycharm

The unit agent will then usually retry the hook that's failing
automatically, but you can use `juju resolved` on the unit(s) without the
--no-retry flag to cause this to happen sooner. In some cases, this may
resolve the issue. --no-retry will clear the error state *without* retrying
the hook.

There are cases where, especially if you're doing reactive charm
development, the local charm state (and its assumptions) across subsequent
charm updates may get out of sync with pre-existing unitdata, especially if
you've renamed states, changed an interface layer, etc, so you might
benefit from a fresh redeploy if things get "weird" for those reasons.

On Fri, Aug 18, 2017 at 9:50 AM, fengxia <fxia1 at lenovo.com> wrote:

> Did `juju upgrade-charm`. Saw "Added charm...". It works, sometimes, not
> consistently.
> The new code changes are not reflected on juju machine. Why is that? Any
> way to force a reload?
>
>
>
> On 08/18/2017 09:40 AM, Tom Barber wrote:
>
> Yeah you need to do juju resolved charmunit/0 --no-retry to get it out of
> the error state so that the upgrade happens.
>
> On Fri, Aug 18, 2017 at 2:32 PM, fengxia <fxia1 at lenovo.com> wrote:
>
>> Hi Juju,
>>
>> So here is what I got:
>>
>> 1. juju status shows  `mycharm` is in an error state.
>>
>> 2. Fixed the bug and built a new version of the same application charm.
>>
>> 3. `juju upgrade-charm --path /path/to/mycharm mycharm
>>
>> It says `Added charm  local:trusty/mycharm to the model". But nothing
>> happens from there.
>>
>> Did I miss a step somewhere?
>>
>> On 08/18/2017 09:07 AM, Tom Barber wrote:
>>
>> juju upgrade-charm is I suspect what you're looking for .
>>
>> Tom
>>
>>
>> On Fri, Aug 18, 2017 at 1:58 PM, fengxia <fxia1 at lenovo.com> wrote:
>>
>>> Hi Juju,
>>>
>>> I'm testing a locally built charm using `localhost` (LXD) setup.
>>> Everytime `juju deploy` will take a good 5-10 minutes just to download and
>>> install python packages before the charm code runs.
>>>
>>> I'm wondering what's a good practice to cut down this in dev iteration?
>>> So if I build a version 2 of the same charm, can I do `juju deploy
>>> my-charm` again to cause an update/upgrade, so to save the initial install
>>> time?
>>>
>>> Any advice?
>>>
>>> --
>>> Feng xia
>>> Engineer
>>> Lenovo USA
>>>
>>> Phone: 5088011794
>>> fxia1 at lenovo.com
>>>
>>> Lenovo.com
>>> Twitter | Facebook | Instagram | Blogs | Forums
>>>
>>>
>>> --
>>> Juju mailing list
>>> Juju at lists.ubuntu.com
>>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm
>>> an/listinfo/juju
>>>
>>
>>
>>
>> --
>> Tom Barber
>> CTO Spicule LTD
>> tom at spicule.co.uk
>>
>> http://spicule.co.uk
>>
>> @spiculeim <http://twitter.com/spiculeim>
>>
>> Schedule a meeting with me <http://meetme.so/spicule>
>>
>> GB: +44(0)5603641316 <+44%2056%200364%201316>
>> US: +18448141689 <%28844%29%20814-1689>
>>
>> <https://leanpub.com/juju-cookbook>
>>
>>
>> --
>> Feng xia
>> Engineer
>> Lenovo USA
>>
>> Phone: 5088011794 <%28508%29%20801-1794>fxia1 at lenovo.com
>>  	
>> Lenovo.com
>> Twitter | Facebook | Instagram | Blogs | Forums
>>
>>
>
>
> --
> Tom Barber
> CTO Spicule LTD
> tom at spicule.co.uk
>
> http://spicule.co.uk
>
> @spiculeim <http://twitter.com/spiculeim>
>
> Schedule a meeting with me <http://meetme.so/spicule>
>
> GB: +44(0)5603641316 <+44%2056%200364%201316>
> US: +18448141689 <(844)%20814-1689>
>
> <https://leanpub.com/juju-cookbook>
>
>
> --
> Feng xia
> Engineer
> Lenovo USA
>
> Phone: 5088011794 <(508)%20801-1794>fxia1 at lenovo.com
>  	
> Lenovo.com
> Twitter | Facebook | Instagram | Blogs | Forums
>
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20170818/bd2ed627/attachment.html>


More information about the Juju mailing list