Juju --constraints "zones=NAME WITH SPACES" fails because of space chars

Bug #1847259 reported by Pedro Guimarães
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Achilleas Anagnostopoulos
2.8
Fix Released
High
Achilleas Anagnostopoulos

Bug Description

Juju: 2.6.9

Juju fails when defining constraints with space-separated values since it depends on spaces for its list. So, a constraint list like:

--constraints "mem=A cores=B zones=NAME WITH SPACES"

Will obviously fail. But there is no alternative to add spaces to that name, like:

--constraints "mem=A cores=B zones=NAME\ WITH\ SPACES"
or
--constraints "mem=A cores=B zones='NAME WITH SPACES'"

summary: - Juju --constraints "zones=NAME WITH SPACES" fails because of spaces
+ Juju --constraints "zones=NAME WITH SPACES" fails because of space
+ chars
Revision history for this message
Pedro Guimarães (pguimaraes) wrote :

Current work-around available is to run "add-machine" to force VMs to be created to the right place. It still demands a step before "juju deploy" and will always demand 2 steps at deployment:
1) juju add-machine
2) juju add-unit --to=NEW_MACHINE

Revision history for this message
Richard Harding (rharding) wrote : Re: [Bug 1847259] Re: Juju --constraints "zones=NAME WITH SPACES" fails because of space chars

Is the add machine command accepting the space argument with the space
characters in the name?

On Tue, Oct 8, 2019, 10:30 AM Pedro Guimarães <email address hidden>
wrote:

> Current work-around available is to run "add-machine" to force VMs to be
> created to the right place. It still demands a step before "juju deploy"
> and will always demand 2 steps at deployment:
> 1) juju add-machine
> 2) juju add-unit --to=NEW_MACHINE
>
> --
> You received this bug notification because you are subscribed to juju.
> https://bugs.launchpad.net/bugs/1847259
>
> Title:
> Juju --constraints "zones=NAME WITH SPACES" fails because of space
> chars
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1847259/+subscriptions
>

Revision history for this message
Pedro Guimarães (pguimaraes) wrote :

Hi Richard,

The full command we're running is:
juju add-machine zone="ZONENAME WITH SPACES" --constraints="root-disk-source=... mem=8 cores=4"

So, for "zone=" yes, it is accepting and working fine.

Revision history for this message
Richard Harding (rharding) wrote :

@nammn can you work with Achilleas on this as a future chunk of work please? The main thing is that one string accepts the spaces and the other doesn't.

@Pedro I assume these spaces are out of our hands to unblock your progress?

Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.7-beta1
assignee: nobody → Nam Nguyen (nammn)
Revision history for this message
Tim Penhey (thumper) wrote :

Reducing to field-high as there is a work-around for this.

Revision history for this message
Pedro Guimarães (pguimaraes) wrote :

Actually, I think there is a broader issue here, because I've moved from cluster to host names, hence:

From:
machines:
  # VMs
  "0": # ETCD #1
    constraints: cores=4 mem=8
    zone: CLUSTER WITH SPACES ON NAME/RESOURCE_POOL

To:
machines:
  # VMs
  "0": # ETCD #1
    constraints: cores=4 mem=8
    zone: HOSTNAME/RESOURCE_POOL

And it does not work. It also does not work if I set HOSTNAME/RESOURCE_POOL as --constraints zones

I am following section: https://jaas.ai/docs/vsphere-cloud#heading--troubleshooting

Revision history for this message
Pedro Guimarães (pguimaraes) wrote :

So, the issue with spaces on names is real, I can see Juju complaining about those spaces.
However, I think there is another issue related to declaring those machines on a bundle.

Funny, "juju add-machine zone=SOMETHING" does work in this case

Revision history for this message
Christian Muirhead (2-xtian) wrote :

My understanding is that if you have a cluster you can't directly put VMs on specific hosts in the cluster - it's the cluster's job to decide where to put them. (I can't test this locally though.)

Revision history for this message
Christian Muirhead (2-xtian) wrote :

To clarify, I think that's why `--constraints zones=HOSTNAME/RESOURCE_POOL` isn't doing what you want in this case.

Changed in juju:
assignee: Nam Nguyen (nammn) → nobody
Changed in juju:
milestone: 2.7-beta1 → 2.7-rc1
Changed in juju:
milestone: 2.7-rc1 → none
Revision history for this message
José Pekkarinen (koalinux) wrote :

Hi,

There is a PR now for this bug:

https://github.com/juju/juju/pull/11500

Thanks!

José.

Changed in juju:
milestone: none → 2.7.7
status: Triaged → Fix Committed
assignee: nobody → Achilleas Anagnostopoulos (achilleasa)
Revision history for this message
Achilleas Anagnostopoulos (achilleasa) wrote :

After discussing the caveats for the solution that landed with PR #11500, we decided to go for a more streamlined solution (escape spaces with slashes) that retains the validation logic (don't allow the operator to specify the same constraint type more than once) from the original code and will land https://github.com/juju/juju/pull/11519 as a followup fix.

Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.