Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1121

Unable to specify non-default zone when creating GCE template

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.9.2
    • None
    • jclouds-labs-google
    • None

    Description

      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:

      google-compute-default-region: us-central1
      google-compute-default-zone: us-central1-a
      

      (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'.

      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
      

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rosenblue Erin Collins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: