Instance-type constraint in rackspace fails

Bug #1641224 reported by Curtis Hovey
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Seyeong Kim

Bug Description

I am trying restore my controller in rackspace. Rackspace instance names have spaces in them, which Openstack permits

curtis@procession-xenial:Work$ juju restore-backup -m bc-test:controller -b --constraints "instance-type=4GB Standard Instance" --file bc-backup.tar.gz
ERROR malformed constraint "Standard"

curtis@procession-xenial:Work$ juju restore-backup -m bc-test:controller -b --constraints instance-type="4GB Standard Instance" --file bc-backup.tar.gz
ERROR malformed constraint "Standard"

curtis@procession-xenial:Work$ juju restore-backup -m bc-test:controller -b --constraints instance-type=4GB%20Standard$20Instance --file bc-backup.tar.gz
ERROR cannot bootstrap new instance: invalid constraint value: instance-type=4GB%20Standard0Instance
valid values are: [512MB Standard Instance 1GB Standard Instance 2GB Standard Instance 4GB Standard Instance 8GB Standard Instance 15GB Standard Instance 30GB Standard Instance 15 GB Compute v1 30 GB Compute v1 3.75 GB Compute v1 60 GB Compute v1 7.5 GB Compute v1 128 MB Container 16 GB Container 1 GB Container 256 MB Container 2 GB Container 30 GB Container 4 GB Container 512 MB Container 64 MB Container 8 GB Container 1 GB General Purpose v1 2 GB General Purpose v1 4 GB General Purpose v1 8 GB General Purpose v1 120 GB I/O v1 15 GB I/O v1 30 GB I/O v1 60 GB I/O v1 90 GB I/O v1 120 GB Memory v1 15 GB Memory v1 240 GB Memory v1 30 GB Memory v1 60 GB Memory v1 OnMetal General Purpose v2 Large OnMetal General Purpose v2 Medium OnMetal General Purpose v2 Small OnMetal I/O v2 1 GB Performance 2 GB Performance 4 GB Performance 8 GB Performance 120 GB Performance 15 GB Performance 30 GB Performance 60 GB Performance 90 GB Performance]

^ Good luck parsing that Juju is asking for.

Martin Packman (gz)
summary: - Instance-type constrain in rackspace fails
+ Instance-type constraint in rackspace fails
Revision history for this message
Heather Lanigan (hmlanigan) wrote :

Which version of juju are you using?

Revision history for this message
Tim Penhey (thumper) wrote :
Changed in juju:
assignee: nobody → Seyeong Kim (xtrusia)
milestone: none → 2.3-alpha1
status: Triaged → In Progress
Changed in juju:
milestone: 2.3-beta1 → 2.3-beta2
Changed in juju:
milestone: 2.3-beta2 → none
Revision history for this message
Anastasia (anastasia-macmood) wrote :

PR from comment # 2 has been committed since 2.3-beta1. I will mark this report as Fix Released.

Changed in juju:
status: In Progress → Fix Released
milestone: none → 2.3-beta1
Revision history for this message
Goran Miskovic (schkovich) wrote :

I believe that the original problem was not fixed.

Juju is complaining about spaces in the instace_type value.

juju --debug deploy ~/charms/bionic/webserver tomcms --config ~/charms/bionic/cmsadmin.yaml --series bionic --constraints "instance-type=3.75 GB Compute v1"
00:55:20 INFO juju.cmd supercommand.go:57 running juju [2.5.4 gc go1.10.4]
00:55:20 DEBUG juju.cmd supercommand.go:58 args: []string{"/snap/juju/7206/bin/juju", "--debug", "deploy", "~/charms/bionic/webserver", "tomcms", "--config", "~/charms/bionic/cmsadmin.yaml", "--series", "bionic", "--constraints", "instance-type=3.75 GB Compute v1"}
ERROR malformed constraint "GB"
00:55:20 DEBUG cmd supercommand.go:496 error stack:
/build/juju/parts/juju/go/src/github.com/juju/juju/constraints/constraints.go:413: malformed constraint "GB"
/build/juju/parts/juju/go/src/github.com/juju/juju/constraints/constraints.go:318:

Since multiple constraints are separated by space eg --constraints "mem=5G cores=2" parssing value --constraints "instance-type=3.75 GB Compute v1" will obviously fail.

See https://github.com/juju/juju/blob/1db915832ead46583f32341ad04753fb5c93c07d/core/constraints/constraints.go#L328

Perhaps urldecode might be a way to go. urlenclded value as "instance-type=3.75%20GB%20Compute%20v1" will pass validation but unless decoded, the value will not match valid values.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1641224] Re: Instance-type constraint in rackspace fails

Correct, The above string is "instance-type=3.75" and then some other
constraint "GB" that we don't recognize. Looking at the rackspace pricing
page:
https://www.rackspace.com/cloud/servers/pricing

I don't see any instance type names with spaces. I see "Compute1-4" which
matches 3.75GB (and presumably v1 compute).

Am I missing the instance-types that rackspace exposes?

--constraints "instance-type=Compute1-4"

seems like it should work.

On Sun, Apr 14, 2019 at 3:45 AM Goran Miskovic <email address hidden> wrote:

> I believe that the original problem was not fixed.
>
> Juju is complaining about spaces in the instace_type value.
>
> juju --debug deploy ~/charms/bionic/webserver tomcms --config
> ~/charms/bionic/cmsadmin.yaml --series bionic --constraints
> "instance-type=3.75 GB Compute v1"
> 00:55:20 INFO juju.cmd supercommand.go:57 running juju [2.5.4 gc go1.10.4]
> 00:55:20 DEBUG juju.cmd supercommand.go:58 args:
> []string{"/snap/juju/7206/bin/juju", "--debug", "deploy",
> "~/charms/bionic/webserver", "tomcms", "--config",
> "~/charms/bionic/cmsadmin.yaml", "--series", "bionic", "--constraints",
> "instance-type=3.75 GB Compute v1"}
> ERROR malformed constraint "GB"
> 00:55:20 DEBUG cmd supercommand.go:496 error stack:
> /build/juju/parts/juju/go/src/
> github.com/juju/juju/constraints/constraints.go:413: malformed constraint
> "GB"
> /build/juju/parts/juju/go/src/
> github.com/juju/juju/constraints/constraints.go:318:
>
> Since multiple constraints are separated by space eg --constraints
> "mem=5G cores=2" parssing value --constraints "instance-type=3.75 GB
> Compute v1" will obviously fail.
>
> See
>
> https://github.com/juju/juju/blob/1db915832ead46583f32341ad04753fb5c93c07d/core/constraints/constraints.go#L328
>
> Perhaps urldecode might be a way to go. urlenclded value as "instance-
> type=3.75%20GB%20Compute%20v1" will pass validation but unless decoded,
> the value will not match valid values.
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1641224
>
> Title:
> Instance-type constraint in rackspace fails
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1641224/+subscriptions
>

Revision history for this message
Goran Miskovic (schkovich) wrote :

Sounds logical but instance types listed on the RackSpace pricing page such as "Compute1-4" are not the ones used. Instead, flavour names such as "3.75 GB Compute v1" are used.

ERROR cannot add a new machine: invalid constraint value: instance-type=Compute1-4
valid values are: [512MB Standard Instance 1GB Standard Instance 2GB Standard Instance 4GB Standard Instance 8GB Standard Instance 15GB Standard Instance 30GB Standard Instance 1 GB Classic v1 15 GB Classic v1 2 GB Classic v1 256 MB Classic v1 30 GB Classic v1 4 GB Classic v1 512 MB Classic v1 8 GB Classic v1 15 GB Compute v1 30 GB Compute v1 3.75 GB Compute v1 60 GB Compute v1 7.5 GB Compute v1 1 GB General Purpose v1 2 GB General Purpose v1 4 GB General Purpose v1 8 GB General Purpose v1 120 GB I/O v1 15 GB I/O v1 30 GB I/O v1 60 GB I/O v1 90 GB I/O v1 120 GB Memory v1 15 GB Memory v1 240 GB Memory v1 30 GB Memory v1 60 GB Memory v1 OnMetal General Purpose v2 Large OnMetal General Purpose v2 Medium OnMetal General Purpose v2 Small OnMetal I/O v2 1 GB Performance 2 GB Performance 4 GB Performance 8 GB Performance 120 GB Performance 15 GB Performance 30 GB Performance 60 GB Performance 90 GB Performance]

See https://developer.rackspace.com/docs/cloud-servers/v2/general-api-info/flavors/#supported-flavors-for-cloud-servers. "compute1-4" is the id of the flavour named "3.75 GB Compute v1".

Revision history for this message
Goran Miskovic (schkovich) wrote :

As far as I can see, there is no RackSpace specific override. OpenStack provider is checking constraints against "flavor.Name". See https://github.com/juju/juju/blob/89a200d3f68420250d18cb08f2fda4e58c7baaa3/provider/openstack/provider.go#L651

To be true, even if this would be fixed, targetting "compute1-4" flavour would fail since in the RackSpace cloud, the "compute" and "memory" class flavours do not have ephemeral root disks and could be booted from a Cinder volume only. See https://github.com/juju/juju/blob/89a200d3f68420250d18cb08f2fda4e58c7baaa3/provider/rackspace/flavors.go#L23

Nevertheless, I believe that this bug should be re-opened. There is no easy way to target standard/general purpose flavours using only CPU and memory constraints. 2 GB General Purpose instance type (id general1-2) has 2 GB RAM and 2 CPUs like 2GB Standard Instance (id 4). The size is of a disk is different, but "general1-2" instance type has a configurable disk size which creates ambiguity. Scheduler might interpret --constraints "mem=2GB cpu=2 root-disk=80GB" as a request for "general1-2" instance type with 80 GB disk.

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.