Comment 14 for bug 1567169

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

Matt,

I know it is possible to do service collocation in a single bundle.

Not sure it is the same for new bundles used for the same model:

juju --version
2.2-rc1-xenial-amd64

cat glance-ss.yaml
series: xenial
services:
  glance-simplestreams-sync:
    charm: cs:xenial/glance-simplestreams-sync
    num_units: 1
    to:
    - glance/0
  keystone:
    charm: cs:xenial/keystone
    num_units: 0 # a hack to be able to add a relation to keystone
relations:
  - [ glance-simplestreams-sync, keystone ]

# no application in the bundle
juju deploy glance-ss.yaml
ERROR the provided bundle has the following errors:
placement "glance/0" refers to an application not defined in this bundle

After adding glance to avoid the first issue, we cannot set num_units to something other than 0 as Juju would then allocate a new machine:

cat glance-ss.yaml
series: xenial
services:
  glance-simplestreams-sync:
    charm: cs:xenial/glance-simplestreams-sync
    num_units: 1
    to:
    - glance/0
  keystone:
    charm: cs:xenial/keystone
    num_units: 0
  glance:
    charm: cs:xenial/glance
    num_units: 0
relations:
  - [ glance-simplestreams-sync, keystone ]

However, in this case Juju figures out that there are no glance units defined - just the application:

juju deploy glance-ss.yaml
ERROR the provided bundle has the following errors:
placement "glance/0" specifies a unit greater than the 0 unit(s) started by the target application