Juju machine deployment


Hello ,

I’m looking for more clarification on Juju machines , I have deployed my charm to local machine by using this juju deploy ~/scanningCharm/trusty/scanningNode and when I connect the machine using juju ssh 0 I have noticed juju it treating the machine and charm folder separately !


i’m not sure if i’m missing something while deploying on the machine, but I need more clarification on how to deploy on a machine and using the tools that i have install in charm hooks directly without having to enter the whole path.


Yes, Juju treats machines as different than application units. The idea is that a single machine might have several different applications on it and each of them runs hooks in their own context.

When you run hooks you’ll find the default working paths and such are in the path to the charm. When you look in the unit-scanningnode-7 there’s a “charm” directory that contains your hooks that get run. That’s the space the charm lives in and can expect to reach/interact with. It shouldn’t need to reach over to the machine folder in normal use.

What are you trying to do that you’re interested in diving across the machine?


Thanks for the explanation !

i’m working in project that has scanning node which will contains 5 tools for scanning domains and Ips , i’m trying to install then in one VM so I can call the VM through SSH and run needed commands. but the thing is I have to separate each tool in folders instead on using them in one hook file , so what do you suggest here ?

  1. Can I create multiple charms for these tools in deploy it in one VM ?
  2. Some tools needs to take the output of other tools , do Juju relations work in this situation ?

thanks in advance


Yes! When deploying a charm, use the --to option. This option is also supported when adding units and at bootstrap time. The “Deploying Applications - advanced” page includes the section “Deploying to Specific Machines”. If that page is unclear, please ask again here and we will provide more information.

Yes. Several charms, such as the pgbouncer charm, act as proxies for other charms.