Re: How to open port with juju when no application is instlaled?

2017-11-23 Thread Akshat Jiwan Sharma
> Is there a reason you prefer to install it manually?

Well actually I'm installing openresty <https://openresty.org/en/> and
there is no charm available for it at the moment

But thanks for your idea about installing some other charm that I can use,
expose it and then use the open port functionality.
That will work for me.

Best,
Akshat

On Thu, Nov 23, 2017 at 11:39 PM, John Meinel <j...@arbash-meinel.com>
wrote:

> I believe there is an nginx charm, which you could have installed with
> "juju deploy nginx --to X"  (where X is the machine id of the postgres
> charm), and then used "juju expose nginx".
> Is there a reason you prefer to install it manually?
> One other option would be to co-locate the "ubuntu" charm and than use
> open port from there, if you really don't want any other applications
> installed.
> Generally we model ports-to-be-opened as part of an application, rather
> than on a machine. So there's likely to be friction there without an
> application to expose.
>
> John
> =:->
>
> On Thu, Nov 23, 2017 at 9:54 PM, Akshat Jiwan Sharma <
> akshatji...@gmail.com> wrote:
>
>> Hi,
>>
>> I've used juju to deploy postgres on aws. On the same machine I've
>> installed an nginx server manually (i.e without juju) that listens on ports
>> 80 and 443. I want both of these ports to be open but juju command
>> open-port only works when an application is exposed.
>>
>>
>>
>> *open-portopen-port registers a port or range to open on the
>> public-interface. On public clouds the port will only be open while the
>> application is exposed.*
>>
>> Now according to juju I only have one application (postgres) on my
>> machine, that I don't want exposed anyway. However I do want ports 80 and
>> 443 to be accessible  publicly. Is adding a policy to aws manually my only
>> option here?
>>
>>
>> Thanks,
>>
>> Akshat
>>
>>
>>
>> --
>> Juju mailing list
>> Juju@lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm
>> an/listinfo/juju
>>
>>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


How to open port with juju when no application is instlaled?

2017-11-23 Thread Akshat Jiwan Sharma
Hi,

I've used juju to deploy postgres on aws. On the same machine I've
installed an nginx server manually (i.e without juju) that listens on ports
80 and 443. I want both of these ports to be open but juju command
open-port only works when an application is exposed.



*open-portopen-port registers a port or range to open on the
public-interface. On public clouds the port will only be open while the
application is exposed.*

Now according to juju I only have one application (postgres) on my machine,
that I don't want exposed anyway. However I do want ports 80 and 443 to be
accessible  publicly. Is adding a policy to aws manually my only option
here?


Thanks,

Akshat
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Side effects of resizing a juju machine

2017-11-15 Thread Akshat Jiwan Sharma
Just what I wanted to hear Andew, thanks!



On Thu, Nov 16, 2017 at 10:47 AM, Andrew Wilkins <
andrew.wilk...@canonical.com> wrote:

> On Thu, Nov 16, 2017 at 11:38 AM Akshat Jiwan Sharma <
> akshatji...@gmail.com> wrote:
>
>> Hi everyone,
>>
>> A couple of times I've noticed that the capacity of a machine provisioned
>> by juju is much more than what I require for my workload. I was wondering
>> that  if I were to manually resize the machine would it break any of juju
>> services?
>>
>
> Juju won't care, you will just have some incorrect information in "juju
> status". We record hardware characteristics for each machine, but it's used
> only for describing machines to the user.
>
> FWIW, I've just tested this:
>  - juju bootstrap azure --bootstrap-constraints
> instance-type=instance-type=Standard_DS12_v2
>  - juju switch controller && juju deploy ubuntu --to 0
> Then resized the machine to Standard_D4s_v3 via the Azure Portal. Juju
> came back up fine, as did the unit.
>
> Some charms might take a snapshot of hardware details when they're
> installed, but I'm not aware of which if any would do that. But Juju itself
> doesn't care.
>
> Cheers,
> Andrew
>
>
>> Thanks,
>> Akshat
>> --
>> Juju mailing list
>> Juju@lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>> mailman/listinfo/juju
>>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Side effects of resizing a juju machine

2017-11-15 Thread Akshat Jiwan Sharma
Thanks Junien, unfortunately I found out about constraints only after
deploying my apps.
Based on my understanding constraints just manage the minimum
specifications.
I need to have an upper bound on the maximum because in my case the auto
selected machine
configurations are already more than what I need.

Is there a way to control the max config that I may have missed?

something like --mem=2g such that a machine can't have more than 2gb of
memory?

Best,
Akshat



On Thu, Nov 16, 2017 at 12:21 PM, Junien Fridrick <
junien.fridr...@canonical.com> wrote:

> On Thu, Nov 16, 2017 at 09:07:42AM +0530, Akshat Jiwan Sharma wrote:
> > Hi everyone,
> >
> > A couple of times I've noticed that the capacity of a machine provisioned
> > by juju is much more than what I require for my workload. I was wondering
> > that  if I were to manually resize the machine would it break any of juju
> > services?
>
> Hi Akshat,
>
> Are you specifying constraints when you deploy your applications ? You
> should able to control the size of the machines deployed by juju with
> them.
>
> See https://jujucharms.com/docs/stable/charms-constraints and
> https://jujucharms.com/docs/stable/reference-constraints
>
> Cheers
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Side effects of resizing a juju machine

2017-11-15 Thread Akshat Jiwan Sharma
Hi everyone,

A couple of times I've noticed that the capacity of a machine provisioned
by juju is much more than what I require for my workload. I was wondering
that  if I were to manually resize the machine would it break any of juju
services?

Thanks,
Akshat
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: open-port: command not found

2017-11-01 Thread Akshat Jiwan Sharma
Thanks Marco and Andrew for the great discussion. I admit that I was a bit
confused while running the `open-port` command.

>"Different machines will run different applications"

This is exactly what confused me. I'm actually running two applications on
a single machine (wordpress and mysql). So when I wanted to open the port
for that machine it was with the understanding  that it would in turn make
it available to any service running on that machine. Where as the open-port
command understood the context in terms of units or applications as Andrew
pointed out.

Besides Marco's suggestion if we could update the docs to indicate what
commands are run in what context that would be really helpful. For example
if you look at nginx's documentation
<http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens>
taking a random directive like server_tokens you can see that command can
run in http, server and location blocks.


> Syntax: *server_tokens* on | off | build | *string*;
Default:

server_tokens on;

Context: http, server, location

Would it make sense to do something like that in juju's documentation as
well?

Thanks,
Akshat

On Thu, Oct 26, 2017 at 3:59 PM, Marco Ceppi <marco.ce...@canonical.com>
wrote:

> I think the use case is pretty apparent from the start of this thread,
> it's opaque to a user that --all does not result in the same execution
> environment as --unit or --application. It seems --all should be
> disambiguated to --all-machines and possibly an --all-units feature. I
> could see wanting to collect information from hook tools of all units in a
> deploy, network-get for example, or other commands.
>
> Marco
>
>
> On Mon, Oct 23, 2017 at 11:20 AM Andrew Wilkins <
> andrew.wilk...@canonical.com> wrote:
>
>> On Mon, Oct 23, 2017 at 5:12 PM Marco Ceppi <marco.ce...@canonical.com>
>> wrote:
>>
>>> On Mon, Oct 23, 2017, 03:59 Andrew Wilkins <andrew.wilk...@canonical.com>
>>> wrote:
>>>
>>>> On Mon, Oct 23, 2017 at 4:20 AM Akshat Jiwan Sharma <
>>>> akshatji...@gmail.com> wrote:
>>>>
>>>>> HI,
>>>>>
>>>>> I'm trying to manually expose a port on a juju machine. According to this
>>>>> answer
>>>>> <https://askubuntu.com/questions/808176/how-to-manually-open-a-port-in-juju>
>>>>> I should be able to do something like this:-
>>>>>
>>>>>  juju run  "open-port 443" --all
>>>>>
>>>>> However when I type this in my shell it throws an error
>>>>>
>>>>> open-port: command not found
>>>>>
>>>>
>>>> The different between the command you're running, and the one on
>>>> AskUbuntu, is that you're not passing --unit. When you pass --unit, it runs
>>>> the command in the context of a unit on the machine. You must be running in
>>>> the context of a unit to use "hook tools", such as open-port.
>>>>
>>>
>>> It seems weird that `juju run` behaves differently when using --unit and
>>> --all, is there a particular reason for that? I wouldn't expect the above
>>> command to fail.
>>>
>>
>> `juju run` supports running commands in either a machine or unit context.
>> Only if you run within a unit context do you get access to hook tools.
>> Hooks require a unit context.
>>
>> "--all" means "all machines", so the command runs in a machine context,
>> for each machine. You could have multiple units on a machine, so we can't
>> automatically choose a unit. Even if we could, what would be the use case
>> for doing that? Different machines will run different applications, which
>> will each have their own firewall requirements.
>>
>> Cheers,
>> Andrew
>>
>
> --
> Juju mailing list
> j...@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev


Re: Disk ID for a provisioned instance

2017-10-31 Thread Akshat Jiwan Sharma
This is very helpful! Thanks.

On Tue, Oct 31, 2017 at 11:23 AM, Andrew Wilkins <
andrew.wilk...@canonical.com> wrote:

> On Tue, Oct 31, 2017 at 1:40 PM Akshat Jiwan Sharma <akshatji...@gmail.com>
> wrote:
>
>> Thanks Andrew. I'm using google cloud platform. But also planning to use
>> aws in the future.
>>
>
> For AWS, we tag the root disk EBS volume with:
>
>key=Name
>value=${INST_ID}-root
>
> So if you add a machine in Juju and it gets assigned the instance ID
> "inst-foo", then the root disk EBS volume will have a Name tag with the
> value "inst-foo-root".
>
> I don't know if we can guarantee that this will remain true forever, but
> it hasn't changed in a long time.
>
> HTH,
> Andrew
>
>
>> On Tue, Oct 31, 2017 at 8:23 AM, Andrew Wilkins <
>> andrew.wilk...@canonical.com> wrote:
>>
>>> On Tue, Oct 31, 2017 at 10:37 AM Akshat Jiwan Sharma <
>>> akshatji...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'd like to automate backups for my server provisioned via juju. For
>>>> that I'm planning to use terraform. To take a snapshot of the disk,
>>>> terraform needs a disk id.
>>>>
>>>> Is there a way I can get disk ID using juju commands? Juju show machine
>>>> only gives the capacity of the disk not its id.
>>>>
>>>
>>> Not at the moment. We'll need to extend the data model and update the
>>> providers to support this. We do record information about volumes that Juju
>>> provisions, but that excludes the root/OS disk.
>>>
>>> On a machine that I deployed on google cloud platform the disk id is
>>>> same as the instance id. Can I assume that the disk id is same as the
>>>> instance id everywhere?
>>>>
>>>
>>> No, that's not a safe assumption in general. Which cloud providers are
>>> you using?
>>>
>>> Thanks,
>>>> Akshat
>>>> --
>>>> Juju mailing list
>>>> Juju@lists.ubuntu.com
>>>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>>>> mailman/listinfo/juju
>>>>
>>>
>>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Disk ID for a provisioned instance

2017-10-30 Thread Akshat Jiwan Sharma
Thanks Andrew. I'm using google cloud platform. But also planning to use
aws in the future.

On Tue, Oct 31, 2017 at 8:23 AM, Andrew Wilkins <
andrew.wilk...@canonical.com> wrote:

> On Tue, Oct 31, 2017 at 10:37 AM Akshat Jiwan Sharma <
> akshatji...@gmail.com> wrote:
>
>> Hi,
>>
>> I'd like to automate backups for my server provisioned via juju. For that
>> I'm planning to use terraform. To take a snapshot of the disk, terraform
>> needs a disk id.
>>
>> Is there a way I can get disk ID using juju commands? Juju show machine
>> only gives the capacity of the disk not its id.
>>
>
> Not at the moment. We'll need to extend the data model and update the
> providers to support this. We do record information about volumes that Juju
> provisions, but that excludes the root/OS disk.
>
> On a machine that I deployed on google cloud platform the disk id is same
>> as the instance id. Can I assume that the disk id is same as the instance
>> id everywhere?
>>
>
> No, that's not a safe assumption in general. Which cloud providers are you
> using?
>
> Thanks,
>> Akshat
>> --
>> Juju mailing list
>> Juju@lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>> mailman/listinfo/juju
>>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Disk ID for a provisioned instance

2017-10-30 Thread Akshat Jiwan Sharma
Hi,

I'd like to automate backups for my server provisioned via juju. For that
I'm planning to use terraform. To take a snapshot of the disk, terraform
needs a disk id.

Is there a way I can get disk ID using juju commands? Juju show machine
only gives the capacity of the disk not its id.

On a machine that I deployed on google cloud platform the disk id is same
as the instance id. Can I assume that the disk id is same as the instance
id everywhere?

Thanks,
Akshat
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Remote Access with Juju

2017-10-29 Thread Akshat Jiwan Sharma
Hi,

You can run commands on a juju deployed machine using juju run.
For the most part juju run command would be more than sufficient
but there is also an option to ssh into a machine.
Here is summary of juju run command from the documentation
.

Usage: juju run [options] 

Summary:

Run the commands on the remote targets specified.
Openvpn is a charm like any other.
Once you've deployed openvpn on a machine you can then  `juju run`
from your terminal to execute arbitrary commands on that machine.

The run command also takes in parameters that allow you to specify the
targets
based upon applications and models instead of machine identifiers.

ex:-

 juju run --all --model=controller:model 'ls'

This will run "ls" command on all the machines with that match the
"controller:model" key

Essentially all you have to do is to somehow identify the targets on which
you want to run
your commands. And you do that by using one of the many options that the
command provides
to filter the targets.

Hope that helps!

Thanks,
Akshat


On Sun, Oct 29, 2017 at 4:30 AM, Naas Si Ahmed 
wrote:

> I'm working on a Juju project which requires remote configuration.
>
> Does Juju provide any solution to remotely access to services ?
>
> And what about the charm openvpn?
>
> Thanks.
>
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: open-port: command not found

2017-10-27 Thread Akshat Jiwan Sharma
Thanks Marco and Andrew for the great discussion. I admit that I was a bit
confused while running the `open-port` command.

>"Different machines will run different applications"

This is exactly what confused me. I'm actually running two applications on
a single machine (wordpress and mysql). So when I wanted to open the port
for that machine it was with the understanding  that it would in turn make
it available to any service running on that machine. Where as the open-port
command understood the context in terms of units or applications as Andrew
pointed out.

Besides Marco's suggestion if we could update the docs to indicate what
commands are run in what context that would be really helpful. For example
if you look at nginx's documentation
<http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens>
taking a random directive like server_tokens you can see that command can
run in http, server and location blocks.


> Syntax: *server_tokens* on | off | build | *string*;
Default:

server_tokens on;

Context: http, server, location

Would it make sense to do something like that in juju's documentation as
well?

Thanks,
Akshat

On Thu, Oct 26, 2017 at 3:59 PM, Marco Ceppi <marco.ce...@canonical.com>
wrote:

> I think the use case is pretty apparent from the start of this thread,
> it's opaque to a user that --all does not result in the same execution
> environment as --unit or --application. It seems --all should be
> disambiguated to --all-machines and possibly an --all-units feature. I
> could see wanting to collect information from hook tools of all units in a
> deploy, network-get for example, or other commands.
>
> Marco
>
>
> On Mon, Oct 23, 2017 at 11:20 AM Andrew Wilkins <
> andrew.wilk...@canonical.com> wrote:
>
>> On Mon, Oct 23, 2017 at 5:12 PM Marco Ceppi <marco.ce...@canonical.com>
>> wrote:
>>
>>> On Mon, Oct 23, 2017, 03:59 Andrew Wilkins <andrew.wilk...@canonical.com>
>>> wrote:
>>>
>>>> On Mon, Oct 23, 2017 at 4:20 AM Akshat Jiwan Sharma <
>>>> akshatji...@gmail.com> wrote:
>>>>
>>>>> HI,
>>>>>
>>>>> I'm trying to manually expose a port on a juju machine. According to this
>>>>> answer
>>>>> <https://askubuntu.com/questions/808176/how-to-manually-open-a-port-in-juju>
>>>>> I should be able to do something like this:-
>>>>>
>>>>>  juju run  "open-port 443" --all
>>>>>
>>>>> However when I type this in my shell it throws an error
>>>>>
>>>>> open-port: command not found
>>>>>
>>>>
>>>> The different between the command you're running, and the one on
>>>> AskUbuntu, is that you're not passing --unit. When you pass --unit, it runs
>>>> the command in the context of a unit on the machine. You must be running in
>>>> the context of a unit to use "hook tools", such as open-port.
>>>>
>>>
>>> It seems weird that `juju run` behaves differently when using --unit and
>>> --all, is there a particular reason for that? I wouldn't expect the above
>>> command to fail.
>>>
>>
>> `juju run` supports running commands in either a machine or unit context.
>> Only if you run within a unit context do you get access to hook tools.
>> Hooks require a unit context.
>>
>> "--all" means "all machines", so the command runs in a machine context,
>> for each machine. You could have multiple units on a machine, so we can't
>> automatically choose a unit. Even if we could, what would be the use case
>> for doing that? Different machines will run different applications, which
>> will each have their own firewall requirements.
>>
>> Cheers,
>> Andrew
>>
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: open-port: command not found

2017-10-22 Thread Akshat Jiwan Sharma
wow! thanks a lot once more!!

On Mon, Oct 23, 2017 at 8:44 AM, Andrew Wilkins <
andrew.wilk...@canonical.com> wrote:

> On Mon, Oct 23, 2017 at 11:09 AM Akshat Jiwan Sharma <
> akshatji...@gmail.com> wrote:
>
>> Thanks Andrew. Just one more question how does the open-port command
>> behave with respect to the  firewalls with cloud providers. Specifically
>> I'm asking in context of google cloud platform which by default only allows
>> port 80 and 443(IIRC). So after running this command will I have to adjust
>> firewall rules there as well?
>>
>
> That's exactly what open-port/expose is controlling :)
>
> When you run open-port (or close-port), you're updating Juju's database to
> say which ports should be open for the unit. When you run "juju expose", it
> updates Juju's database to say that the "open" ports for the units of the
> specified application should now be exposed. Juju will then update the
> cloud firewall to come in line with what's in the Juju database.
>
> Cheers,
> Andrew
>
>
>> Thanks,
>> Akshat
>>
>> On Mon, Oct 23, 2017 at 7:28 AM, Andrew Wilkins <
>> andrew.wilk...@canonical.com> wrote:
>>
>>> On Mon, Oct 23, 2017 at 4:20 AM Akshat Jiwan Sharma <
>>> akshatji...@gmail.com> wrote:
>>>
>>>> HI,
>>>>
>>>> I'm trying to manually expose a port on a juju machine. According to this
>>>> answer
>>>> <https://askubuntu.com/questions/808176/how-to-manually-open-a-port-in-juju>
>>>> I should be able to do something like this:-
>>>>
>>>>  juju run  "open-port 443" --all
>>>>
>>>> However when I type this in my shell it throws an error
>>>>
>>>> open-port: command not found
>>>>
>>>
>>> The different between the command you're running, and the one on
>>> AskUbuntu, is that you're not passing --unit. When you pass --unit, it runs
>>> the command in the context of a unit on the machine. You must be running in
>>> the context of a unit to use "hook tools", such as open-port.
>>>
>>> I can verify that the application on this particular controller is
>>>> already exposed and it thus satisfies the requirement for running this
>>>> command.
>>>>
>>>> >"The port range will only be open while the application is exposed."
>>>>
>>>> Can you help me understand what I'm doing wrong?
>>>>
>>>
>>> Ports are managed on a per-unit basis, so you need to execute the "run"
>>> command against a unit or application, using --unit or --application
>>> respectively.
>>>
>>> Once you've run open-port, you'll need to run "juju expose
>>> " for the ports to actually be opened up.
>>>
>>> Thanks,
>>>> Akshat
>>>> --
>>>> Juju mailing list
>>>> Juju@lists.ubuntu.com
>>>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>>>> mailman/listinfo/juju
>>>>
>>>
>>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: open-port: command not found

2017-10-22 Thread Akshat Jiwan Sharma
Thanks Andrew. Just one more question how does the open-port command behave
with respect to the  firewalls with cloud providers. Specifically I'm
asking in context of google cloud platform which by default only allows
port 80 and 443(IIRC). So after running this command will I have to adjust
firewall rules there as well?

Thanks,
Akshat

On Mon, Oct 23, 2017 at 7:28 AM, Andrew Wilkins <
andrew.wilk...@canonical.com> wrote:

> On Mon, Oct 23, 2017 at 4:20 AM Akshat Jiwan Sharma <akshatji...@gmail.com>
> wrote:
>
>> HI,
>>
>> I'm trying to manually expose a port on a juju machine. According to this
>> answer
>> <https://askubuntu.com/questions/808176/how-to-manually-open-a-port-in-juju>
>> I should be able to do something like this:-
>>
>>  juju run  "open-port 443" --all
>>
>> However when I type this in my shell it throws an error
>>
>> open-port: command not found
>>
>
> The different between the command you're running, and the one on
> AskUbuntu, is that you're not passing --unit. When you pass --unit, it runs
> the command in the context of a unit on the machine. You must be running in
> the context of a unit to use "hook tools", such as open-port.
>
> I can verify that the application on this particular controller is already
>> exposed and it thus satisfies the requirement for running this command.
>>
>> >"The port range will only be open while the application is exposed."
>>
>> Can you help me understand what I'm doing wrong?
>>
>
> Ports are managed on a per-unit basis, so you need to execute the "run"
> command against a unit or application, using --unit or --application
> respectively.
>
> Once you've run open-port, you'll need to run "juju expose "
> for the ports to actually be opened up.
>
> Thanks,
>> Akshat
>> --
>> Juju mailing list
>> Juju@lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>> mailman/listinfo/juju
>>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


open-port: command not found

2017-10-22 Thread Akshat Jiwan Sharma
HI,

I'm trying to manually expose a port on a juju machine. According to this
answer

I should be able to do something like this:-

 juju run  "open-port 443" --all

However when I type this in my shell it throws an error

open-port: command not found

I can verify that the application on this particular controller is already
exposed and it thus satisfies the requirement for running this command.

>"The port range will only be open while the application is exposed."

Can you help me understand what I'm doing wrong?

Thanks,
Akshat
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: What is the best way to work with multiple models in a controller using the cli?

2017-10-05 Thread Akshat Jiwan Sharma
Thanks a lot Ian!

On Thu, Oct 5, 2017 at 1:22 PM, Ian Booth <ian.bo...@canonical.com> wrote:

> Hey
>
> The -m argument is what you want. It accepts wither just a model name or a
> controller:model for when you have multiple controllers. eg
>
> $ juju status -m prod
> $ juju status -m ctrl:prod
>
> The first command above works on the prod model on the current controller.
> The
> second selects a specific controller regardless of the current one. The
> second
> way is the safest unless you really are only using one controller.
>
> Also, you can set the JUJU_MODEL env var. That's useful for when you open
> different terminal windows and want to work on a different model in each
> window
> without using -m each time.
>
> On 05/10/17 17:43, Akshat Jiwan Sharma wrote:
> > Hi,
> >
> > I have deployed a few models using the local juju controller and I want
> > to execute a bunch of commands on a particular model using the juju-cli.
> >
> > Lets say I have these three models defined on my controller
> >
> > - model1
> > - model2
> > - model3
> >
> > This is the sequence of commands I want to run
> >
> > 1. List all the machines in model1
> > 2. Add storage unit to model2
> > 3. Add a relation between applications in model3
> >
> > These operations may be run in any order. That is first I might run op 2
> > then op 3 and then op1.
> > The only constraint is that an operation must be run on a particular
> model.
> > Right now I go about this task like so:-
> >
> > juju switch model1 && juju machines
> >
> >  This works fine. I get all my machines listed for model1. The problem
> with
> > this  approach is that I'm not sure if
> > another command is executing a juju switch somewhere and suddenly the
> model
> > I'm operating changes from model1 to model2.
> >
> > For instance suppose that these two commands are run one after the other
> >
> > juju switch model1 && juju list machines
> > juju switch model3 && juju add-relation app1 app2
> >
> > Now how can I be certain that for second command I'm operating on model
> 3?
> > As far as I understand juju switches are global.
> > Meaning a `switch` makes a change "permanent" to all the other commands
> > that follow.
> >
> > My question is how do I "lock" the execution of a certain command to a
> > particular model?
> >
> > Thanks,
> > Akshat
> >
> >
> >
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


What is the best way to work with multiple models in a controller using the cli?

2017-10-05 Thread Akshat Jiwan Sharma
Hi,

I have deployed a few models using the local juju controller and I want
to execute a bunch of commands on a particular model using the juju-cli.

Lets say I have these three models defined on my controller

- model1
- model2
- model3

This is the sequence of commands I want to run

1. List all the machines in model1
2. Add storage unit to model2
3. Add a relation between applications in model3

These operations may be run in any order. That is first I might run op 2
then op 3 and then op1.
The only constraint is that an operation must be run on a particular model.
Right now I go about this task like so:-

juju switch model1 && juju machines

 This works fine. I get all my machines listed for model1. The problem with
this  approach is that I'm not sure if
another command is executing a juju switch somewhere and suddenly the model
I'm operating changes from model1 to model2.

For instance suppose that these two commands are run one after the other

juju switch model1 && juju list machines
juju switch model3 && juju add-relation app1 app2

Now how can I be certain that for second command I'm operating on model 3?
As far as I understand juju switches are global.
Meaning a `switch` makes a change "permanent" to all the other commands
that follow.

My question is how do I "lock" the execution of a certain command to a
particular model?

Thanks,
Akshat
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: What determines the charm series?

2017-09-26 Thread Akshat Jiwan Sharma
Thanks Rick!

On 26-Sep-2017 20:00, "Rick Harding" <rick.hard...@canonical.com> wrote:

> The series is defined in the metadata.yaml. Charms now support a list of
> series and the preference for the charm is determined by the order in the
> list.
>
> Before the support for one charm to support multiple series at once, users
> had to publish them directly to a specific series which is why you're not
> seeing it in the older charms.
>
> You can force a deploy to a series at deploy time. To quote juju deploy
> --help
>
> If '--series' is not specified, the charm's default series is used. The
> default
> series for a charm is the first one specified in the charm metadata. If the
> specified series is not supported by the charm, this results in an error,
> unless '--force' is used.
>
> If you want to see if the charm will work on the latest series try using
> that --force option.
>
> On Tue, Sep 26, 2017 at 10:25 AM Akshat Jiwan Sharma <
> akshatji...@gmail.com> wrote:
>
>> Hello Everyone,
>>
>> I was looking at wordpress charm on the juju store and I noticed that the
>> recommended version supported Trusty and Precise series. Where as one
>> community version supported xenial and trusty series.
>>
>> I downloaded the recommended  <https://jujucharms.com/wordpress/trusty/5> 
>> charm
>> package from the store and tried to look at code but I could not see where
>> exactly the series definition is set. However in one of the community
>> editions <https://jujucharms.com/u/ionutbalutoiu/wordpress/1> the series
>> was mentioned in the metadata.yml file.
>>
>> Is there any way I can use the recommended wordpress charm on my xenial
>> machine. Currently when I try to deploy I get the following error:-
>>
>> "cannot add application "wordpress": cannot deploy to machine 0: series
>> does not match"
>>
>> Thanks,
>> Akshat
>> --
>> Juju mailing list
>> Juju@lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/
>> mailman/listinfo/juju
>>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


What determines the charm series?

2017-09-26 Thread Akshat Jiwan Sharma
Hello Everyone,

I was looking at wordpress charm on the juju store and I noticed that the
recommended version supported Trusty and Precise series. Where as one
community version supported xenial and trusty series.

I downloaded the recommended   charm
package from the store and tried to look at code but I could not see where
exactly the series definition is set. However in one of the community
editions  the series
was mentioned in the metadata.yml file.

Is there any way I can use the recommended wordpress charm on my xenial
machine. Currently when I try to deploy I get the following error:-

"cannot add application "wordpress": cannot deploy to machine 0: series
does not match"

Thanks,
Akshat
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: How to use the same controller from multiple devices on JaaS?

2017-09-13 Thread Akshat Jiwan Sharma
Hello Jang,

I asked a similar question a couple of days back and got great answers from
the community. I think you might find John's response
 on how
JAAS works quite helpful (even though it is not directly related to your
question). In simple terms JAAS is a hosted controller. To use JAAS from
your local machine you just have to login to it from your terminal.
Assuming that you have juju installed, on the device you want to access
JAAS from, you simply have to type this command (as described
 on JAAS website):-

`juju login jaas`

and after completing the authentication process you should be able to use
jass just like you would a local controller from your machine.

In other words if you want to use JAAS you don't need to bootstrap any
controllers on your machine. You only need to authenticate your machine
with the JAAS controller that is already hosted for you on the cloud.

>so I added another azure credential from another laptop

Once you have connected to JAAS from your machine you should be able to use
all the credentials that you've added to JAAS.

Does that answer your question?

Best,
Akshat

On Wed, Sep 13, 2017 at 9:38 PM, Jang Taehee  wrote:

> Hello, I'm a newbie and have a question about controller in cloud.
>
> I'm using Microsoft Azure cloud and added 1 controller.
> I want to use this controller from other laptop, so I added another azure
> credential from another laptop. But it didn't reacted any juju commands.
> How can I use juju commands from multiple devices to one controller?
>
> Thank you.
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Juju-gui only show localhost as the deployment option

2017-09-01 Thread Akshat Jiwan Sharma
Many thanks Fen for the detailed guide and for starting a great discussion.
I have a couple of ideas that I'd like to share as well as a few followups
to your write-up.

>The catch is, of course, the manual step of selecting the proper
controller.

Yes in addition to deploying the container on a particular cloud, right?
Switching between providers or selecting them manually does not look like
that much of a trouble to me,but taking care of controllers across
providers does. So if the controller management can be simplified (like
JAAS has, for instance) that's a bigger win for me.  This is the question
that I was actually trying to ask but could not articulate well. What is
stopping me from using a JUJU container deployed on aws to deploy charms on
google compute platform? Is it the way juju has been desgined or is it
something I'm missing?

On your point number 2 I think essentially what we're talking about is
bootstrapping juju across cloud providers? So once that is done we can use
juju as it is (I guess I'm oversimplifying the high availability part
here). I think conjure-up <https://conjure-up.io/> simplifies this
bootstrap process quite a bit. But I just came to know about it so I may be
wrong in my understanding about some of its capabilities.

The the other thing that I've been thinking about is terraform+juju
integration. Since juju allows shell scripts
<https://github.com/juju/plugins/blob/master/juju-public-ip> to be used as
plugins we should be able to call all of terraform commands directly from
juju (wrapped inside a helpful script).   Together they give me cross cloud
ops ability. Of course it would be even more sweet if we could figure out a
way to translate juju models into tf files.

BTW I'd love to know more about how lennovo is using juju.

Best,
Akshat

On Wed, Aug 30, 2017 at 8:26 PM, fengxia <fx...@lenovo.com> wrote:

> Akshat,
>
> Just to chip in some of my thoughts on this since we (disclosure, I'm a
> researcher at Lenovo) have had extensive discussions on a similar use case
> and consequently come down to the same challenge as you are currently
> looking at.
>
> 1. Juju CLI allows user to select controller, which essentially leads to a
> particular cloud/provider (these two are 1-1 mapping). Therefore, in
> practice it already supports multi-cloud scenario (last time I counted 12
> clouds out of box including local LXD and manual). The catch is, of course,
> the manual step of selecting the proper controller.
>
> 2. There are two schools of thought -- whether to have Juju being more
> intelligent so to handle multiple clouds `automatically` (for example, in
> bundle YAML specify which cloud a charm should be deployed to, which is one
> step further than OS series), or using Juju as-is and utilize something
> else as a wrapper to facilitate such mixed-cloud automation. The former
> option minimize tech stack so there is one set of technology to learn and
> manage; the latter gives flexibility, mitigate vendor lock in... I think
> the theme is not new, so it's really a matter of design preference
>
> Juju team has done 90% of the heavy liftings. The former will require more
> in-depth of Juju knowledge, the latter requires less. I think the
> requirements, however, is clear, that there is a higher level of
> abstraction required above the current Juju existence so to drive this.
>
>
>
> On 08/30/2017 04:27 AM, Akshat Jiwan Sharma wrote:
>
> Thank you Feng,
>
> As I understand for now there is no way to use multiple providers with
> juju either with a GUI or command line.
>
> My goal is to be able to allow users to deploy charms (mostly
> wordpress/drupal/ghost) on a cloud of their choice. Anything that allows me
> to do this is acceptable. The only requirement is maximum cloud coverage.
> So for a multi cloud setup what options do I have?
>
> - Should I go for one controller per cloud setup?
> - Can juju api <https://godoc.org/github.com/juju/juju/api> help me write
> some custom code that'll allow me to do what I want? If so what should I be
> looking for in the documentation?
> - Since juju runs in an lxc  would it be a good idea to create clone
> containers that can switch the cloud environment on demand? Or would this
> cause more problems that it'll solve?
>
> Thank you once more for being patient with the questions and for all the
> answers! Much appreciated
>
> Best,
> Akshat
>
> On Wed, Aug 30, 2017 at 7:56 AM, fengxia <fx...@lenovo.com> wrote:
>
>> Hi Akshat,
>>
>> Juju controller does not support multiple cloud/provider. It's like a
>> switch board, juju can only talk to one controller at a time.
>> However, I do think there are use case of supporting multiple clouds with
>> one orchestrator. I'm not sure whether juju team has 

Re: Juju-gui only show localhost as the deployment option

2017-09-01 Thread Akshat Jiwan Sharma
Yes indeed it answers all my questions Rick. That's all I have for now but
I'll come back to you if I have any more!

Best,
Akshat

On Fri, Sep 1, 2017 at 5:57 PM, Rick Harding <rick.hard...@canonical.com>
wrote:

> Sure thin Akshat. Pricing is still ongoing as we learn from the beta how
> the back end costs work out. Our goal is definitely to use scale and our
> expertise to have using JAAS be cheaper than your own infrastructure.
> There's likely to be different pricing levels based on things like support
> requirements. As we know more I'll make sure we spread the word.
>
> As to conjure-up. It's a great client for Juju and JAAS. You'd use
> conjure-up and it has an option to perform the deployment against JAAS as
> the controller vs creating your own. In that way it's all compatible. You'd
> just use the conjure-up tool you know/love and target it to JAAS for doing
> the operating of the running model in the end.
>
> Hope that helps and don't hesitate to let me know if you have any other
> questions.
>
>
> On Fri, Sep 1, 2017 at 8:18 AM Akshat Jiwan Sharma <akshatji...@gmail.com>
> wrote:
>
>> Hi Rick,
>>
>> Thank you for mentioning JAAS. It does indeed solve many of my problems.
>> It would be great if you could let me know a bit about pricing. I
>> understand that it's in Beta at the moment. But when it launches will the
>> pricing be based on number of models/number or deployments or some other
>> criteria. Some sort of an idea around pricing would be very helpful.
>>
>> Overall it looks like JAAS already does what I'm trying to do. And if the
>> pricing is on a similar level as compared to what it would be when I'd
>> deploy juju on my own then it becomes a no brainier.
>>
>> Also I was watching the Getting started with Juju
>> <https://www.youtube.com/watch?v=OBseJVHuVXI=PLW1vKndgh8gJS4upPNaXiYYHnCmFdWk03>
>> video on youtube and I learnt about conjure-up. I'm assuming that JAAS will
>> be compatible with all of conjure up commands? Or is conjure-up a slightly
>> different workflow as compared to juju?
>>
>> Best,
>> Akshat
>>
>> On Wed, Aug 30, 2017 at 10:44 PM, Rick Harding <
>> rick.hard...@canonical.com> wrote:
>>
>>> Just to toss, out. JAAS [1] is built to be Juju as a Service across
>>> clouds doing some of the extra work to enable users to have a single
>>> dashboard across a wide array of clouds and regions. Give it a try and I'd
>>> love to chat about any feedback on where JAAS does or doesn't fit for the
>>> needs you're having.
>>>
>>> 1: https://jujucharms.com
>>>
>>> On Wed, Aug 30, 2017 at 10:59 AM fengxia <fx...@lenovo.com> wrote:
>>>
>>>> Akshat,
>>>>
>>>> Just to chip in some of my thoughts on this since we (disclosure, I'm a
>>>> researcher at Lenovo) have had extensive discussions on a similar use case
>>>> and consequently come down to the same challenge as you are currently
>>>> looking at.
>>>>
>>>> 1. Juju CLI allows user to select controller, which essentially leads
>>>> to a particular cloud/provider (these two are 1-1 mapping). Therefore, in
>>>> practice it already supports multi-cloud scenario (last time I counted 12
>>>> clouds out of box including local LXD and manual). The catch is, of course,
>>>> the manual step of selecting the proper controller.
>>>>
>>>> 2. There are two schools of thought -- whether to have Juju being more
>>>> intelligent so to handle multiple clouds `automatically` (for example, in
>>>> bundle YAML specify which cloud a charm should be deployed to, which is one
>>>> step further than OS series), or using Juju as-is and utilize something
>>>> else as a wrapper to facilitate such mixed-cloud automation. The former
>>>> option minimize tech stack so there is one set of technology to learn and
>>>> manage; the latter gives flexibility, mitigate vendor lock in... I think
>>>> the theme is not new, so it's really a matter of design preference
>>>>
>>>> Juju team has done 90% of the heavy liftings. The former will require
>>>> more in-depth of Juju knowledge, the latter requires less. I think the
>>>> requirements, however, is clear, that there is a higher level of
>>>> abstraction required above the current Juju existence so to drive this.
>>>>
>>>>
>>>>
>>>> On 08/30/2017 04:27 AM, Akshat Jiwan Sharma wrote:
>>>>
>>>> Thank you Feng,
>>>>
>

Re: Juju-gui only show localhost as the deployment option

2017-09-01 Thread Akshat Jiwan Sharma
Hi Rick,

Thank you for mentioning JAAS. It does indeed solve many of my problems. It
would be great if you could let me know a bit about pricing. I understand
that it's in Beta at the moment. But when it launches will the pricing be
based on number of models/number or deployments or some other criteria.
Some sort of an idea around pricing would be very helpful.

Overall it looks like JAAS already does what I'm trying to do. And if the
pricing is on a similar level as compared to what it would be when I'd
deploy juju on my own then it becomes a no brainier.

Also I was watching the Getting started with Juju
<https://www.youtube.com/watch?v=OBseJVHuVXI=PLW1vKndgh8gJS4upPNaXiYYHnCmFdWk03>
video on youtube and I learnt about conjure-up. I'm assuming that JAAS will
be compatible with all of conjure up commands? Or is conjure-up a slightly
different workflow as compared to juju?

Best,
Akshat

On Wed, Aug 30, 2017 at 10:44 PM, Rick Harding <rick.hard...@canonical.com>
wrote:

> Just to toss, out. JAAS [1] is built to be Juju as a Service across clouds
> doing some of the extra work to enable users to have a single dashboard
> across a wide array of clouds and regions. Give it a try and I'd love to
> chat about any feedback on where JAAS does or doesn't fit for the needs
> you're having.
>
> 1: https://jujucharms.com
>
> On Wed, Aug 30, 2017 at 10:59 AM fengxia <fx...@lenovo.com> wrote:
>
>> Akshat,
>>
>> Just to chip in some of my thoughts on this since we (disclosure, I'm a
>> researcher at Lenovo) have had extensive discussions on a similar use case
>> and consequently come down to the same challenge as you are currently
>> looking at.
>>
>> 1. Juju CLI allows user to select controller, which essentially leads to
>> a particular cloud/provider (these two are 1-1 mapping). Therefore, in
>> practice it already supports multi-cloud scenario (last time I counted 12
>> clouds out of box including local LXD and manual). The catch is, of course,
>> the manual step of selecting the proper controller.
>>
>> 2. There are two schools of thought -- whether to have Juju being more
>> intelligent so to handle multiple clouds `automatically` (for example, in
>> bundle YAML specify which cloud a charm should be deployed to, which is one
>> step further than OS series), or using Juju as-is and utilize something
>> else as a wrapper to facilitate such mixed-cloud automation. The former
>> option minimize tech stack so there is one set of technology to learn and
>> manage; the latter gives flexibility, mitigate vendor lock in... I think
>> the theme is not new, so it's really a matter of design preference
>>
>> Juju team has done 90% of the heavy liftings. The former will require
>> more in-depth of Juju knowledge, the latter requires less. I think the
>> requirements, however, is clear, that there is a higher level of
>> abstraction required above the current Juju existence so to drive this.
>>
>>
>>
>> On 08/30/2017 04:27 AM, Akshat Jiwan Sharma wrote:
>>
>> Thank you Feng,
>>
>> As I understand for now there is no way to use multiple providers with
>> juju either with a GUI or command line.
>>
>> My goal is to be able to allow users to deploy charms (mostly
>> wordpress/drupal/ghost) on a cloud of their choice. Anything that allows me
>> to do this is acceptable. The only requirement is maximum cloud coverage.
>> So for a multi cloud setup what options do I have?
>>
>> - Should I go for one controller per cloud setup?
>> - Can juju api <https://godoc.org/github.com/juju/juju/api> help me
>> write some custom code that'll allow me to do what I want? If so what
>> should I be looking for in the documentation?
>> - Since juju runs in an lxc  would it be a good idea to create clone
>> containers that can switch the cloud environment on demand? Or would this
>> cause more problems that it'll solve?
>>
>> Thank you once more for being patient with the questions and for all the
>> answers! Much appreciated
>>
>> Best,
>> Akshat
>>
>> On Wed, Aug 30, 2017 at 7:56 AM, fengxia <fx...@lenovo.com> wrote:
>>
>>> Hi Akshat,
>>>
>>> Juju controller does not support multiple cloud/provider. It's like a
>>> switch board, juju can only talk to one controller at a time.
>>> However, I do think there are use case of supporting multiple clouds
>>> with one orchestrator. I'm not sure whether juju team has sth like that on
>>> its roadmap, or maybe using some other tools for the purpose?
>>> On 08/29/2017 09:59 AM, Akshat Jiwan Sharma wrote:
>>>
>>> Is the

Re: Juju-gui only show localhost as the deployment option

2017-08-30 Thread Akshat Jiwan Sharma
Thank you Feng,

As I understand for now there is no way to use multiple providers with juju
either with a GUI or command line.

My goal is to be able to allow users to deploy charms (mostly
wordpress/drupal/ghost) on a cloud of their choice. Anything that allows me
to do this is acceptable. The only requirement is maximum cloud coverage.
So for a multi cloud setup what options do I have?

- Should I go for one controller per cloud setup?
- Can juju api <https://godoc.org/github.com/juju/juju/api> help me write
some custom code that'll allow me to do what I want? If so what should I be
looking for in the documentation?
- Since juju runs in an lxc  would it be a good idea to create clone
containers that can switch the cloud environment on demand? Or would this
cause more problems that it'll solve?

Thank you once more for being patient with the questions and for all the
answers! Much appreciated

Best,
Akshat

On Wed, Aug 30, 2017 at 7:56 AM, fengxia <fx...@lenovo.com> wrote:

> Hi Akshat,
>
> Juju controller does not support multiple cloud/provider. It's like a
> switch board, juju can only talk to one controller at a time.
> However, I do think there are use case of supporting multiple clouds with
> one orchestrator. I'm not sure whether juju team has sth like that on its
> roadmap, or maybe using some other tools for the purpose?
> On 08/29/2017 09:59 AM, Akshat Jiwan Sharma wrote:
>
> Is there a way I can configure multiple providers using the Juju-GUI? Also
> is there a way I can configure cloud providers based on user access roles?
> For example a user with access to a particular model can deploy only to a
> specific cloud provider.
>
> If one controller can manage multiple clouds and one controller can have
> many users then what is the mapping of the relationship between the users
> and the clouds?
>
> Thanks,
> Akshat
>
>
>
> --
> Feng xia
> Engineer
> Lenovo USA
>
> Phone: 5088011794fx...@lenovo.com
>   
> Lenovo.com
> Twitter | Facebook | Instagram | Blogs | Forums
>
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/juju
>
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju