[
https://issues.apache.org/jira/browse/JCLOUDS-1121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15343130#comment-15343130
]
Erin Collins commented on JCLOUDS-1121:
---------------------------------------
[~nelsonjr] contacted me with some sample code, and I am unable to reproduce
the error as seen before.
Since JCLOUDS-1121 was filed, I did realize that I have been handling the
machineTypes incorrectly - not choosing the machineType in the same zone. I
went back and re-verified, but the locationId does not get reset based on the
location of the machineType, so that's not it. I'm stumped as well. So I am
not sure why that was happening at the time, but it looks like we can close
that bug as cannot reproduce.
Thank you [~nelsonjr]!
> Unable to specify non-default zone when creating GCE template
> -------------------------------------------------------------
>
> Key: JCLOUDS-1121
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1121
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-labs-google
> Affects Versions: 1.9.2
> Reporter: Erin Collins
>
> I'm having trouble when specifying a GCE zone to provision new instances.
> We have these paramaters set in our GCE project metadata in the google
> console:
> {noformat}
> google-compute-default-region: us-central1
> google-compute-default-zone: us-central1-a
> {noformat}
> (as described here:
> https://cloud.google.com/compute/docs/gcloud-compute/#default-properties)
> To provision an instance, we create a template like the following. However,
> when I specify 'us-central1-f' for the zone, the template defaults back to
> 'us-central1-a'.
> {code}
> def context = ContextBuilder.newBuilder(new
> GoogleComputeEngineProviderMetadata())
> .credentials(identity, credential)
> .overrides(overrides)
> .modules(getModules())
> .buildView(ComputeServiceContext.class)
> ComputeService computeSvc = ctx().getComputeService()
> TemplateBuilder templateBuilder = computeSvc.templateBuilder()
> templateBuilder.locationId('us-central1-f') <- When this returns, the zone in
> the templateBuilder object actually points to us-central1-a
> {code}
> So, I'm assuming jclouds is picking up the default zone from the metadata?
> As a workaround for now, I believe I can just change our default zone in the
> metadata and move our new provisioning over to us-central1-f, but that won't
> allow us to give users the option of provisioning in a specific zone other
> than the default one.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)