Add a method to filter unsupported instance types #6958

Merged
merged 1 commit into from Feb 9, 2017

Conversation

Projects
None yet
3 participants
Contributor

reedobrien commented Feb 9, 2017

Description of change

This PR adds a method to filter out unstupported instance types. At least where we know they are unsupported but still in the offer list.

Why is this change needed?
Trying to deploy to a region that has types listed but not available results in failed deployments.

QA steps

How do we verify that the change works?

  1. Build juju from this branch
  2. juju bootstrap aws/ap-northeast-2 aws/test --credential credentials
  3. jujuj deploy ubuntu

It should work.

Documentation changes

N/A

Does it affect current user workflow? CLI? API?
N/A

Bug reference

Refs: https://bugs.launchpad.net/juju/+bug/1663047

Contributor

reedobrien commented Feb 9, 2017

!!build!!

Contributor

reedobrien commented Feb 9, 2017

!!baronbomburst!!

Looks good - I guess if there were more overrides we could pull them from a file. Weird that there's no way to determine this from the data. Do they expect people to try to launch them and just fail?

@@ -73,7 +73,7 @@ func Main() (int, error) {
defer fout.Close()
}
- tmpl, err := template.New("instanceTypes").Parse(`
+ tmpl := template.Must(template.New("instanceTypes").Parse(`
+// See: https://bugs.launchpad.net/juju/+bug/1663047
+func supported(region, instanceType string) bool {
+ switch region {
+ case "ap-northeast-2":
@babbageclunk

babbageclunk Feb 9, 2017

Member

There's no way in the offer list data to see that these aren't actually available?

@reedobrien

reedobrien Feb 9, 2017

Contributor

Correct. They are listed with prices in the offer list, but if you try to launch one, it fails with an unsupported error.

@reedobrien

reedobrien Feb 9, 2017

Contributor

Sadly there's no API to ask what instance types are available in a region. Which has been a requested API since 2012 at least.

Contributor

reedobrien commented Feb 9, 2017

$$merge$$

Contributor

jujubot commented Feb 9, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Feb 9, 2017

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/10266

@jujubot jujubot merged commit 94553f7 into juju:develop Feb 9, 2017

1 check passed

github-check-merge-juju Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details

@reedobrien reedobrien deleted the reedobrien:bug/1663047 branch Feb 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment