anchor.diff:        zone: europe-west1-a
   discovery:
         seed_providers: gce
  -      gce:
  -            tags: elasticsearch, dev
  ---------------------------------------------------
  -
  -[[discovery-gce-usage-port]]
  -==== Changing default transport port
  -
  -By default, Elasticsearch GCE plugin assumes that you run Elasticsearch on 9300 default port.
  -But you can specify the port value Elasticsearch is meant to use using google compute engine metadata `es_port`:
  -
  -[[discovery-gce-usage-port-create]]
  -===== When creating instance
  -
  -Add `--metadata es_port=9301` option:
  -
  -[source,sh]
  ---------------------------------------------------
  -# when creating first instance
  -gcloud compute instances create myesnode1 \
  -       --scopes=compute-rw,storage-full \
  -       --metadata es_port=9301
  -
  -# when creating an instance from an image
  -gcloud compute instances create myesnode2 --image=elasticsearch-1-0-0-RC1 \
  -       --zone europe-west1-a --machine-type f1-micro --scopes=compute-rw \
  -       --metadata es_port=9301
  ---------------------------------------------------
  -
  -[[discovery-gce-usage-port-run]]
  -===== On a running instance
  -
  -[source,sh]
  ---------------------------------------------------
  -gcloud compute instances add-metadata myesnode1 \
  -       --zone europe-west1-a \
  -       --metadata es_port=9301
  ---------------------------------------------------
  -
  -
  -[[discovery-gce-usage-tips]]
  -==== GCE Tips
  -
  -[[discovery-gce-usage-tips-projectid]]
  -===== Store project id locally
  -
  -If you don't want to repeat the project id each time, you can save it in the local gcloud config
  -
  -[source,sh]
  ---------------------------------------------------
  -gcloud config set project es-cloud
  ---------------------------------------------------
  -
  -[[discovery-gce-usage-tips-permissions]]
  -===== Machine Permissions
  -
  -If you have created a machine without the correct permissions, you will see `403 unauthorized` error messages. To change machine permission on an existing instance, first stop the instance then Edit. Scroll down to `Access Scopes` to change permission. The other way to alter these permissions is to delete the instance (NOT THE DISK). Then create another with the correct permissions.
  -
  -Creating machines with gcloud::
  -+
  ---
  -Ensure the following flags are set:
  -
  -[source,text]
  ---------------------------------------------------
  ---scopes=compute-rw
  ---------------------------------------------------
  ---
  -
  -Creating with console (web)::
  -+
  ---
  -When creating an instance using the web portal, click _Show advanced options_.
  -
  -At the bottom of the page, under `PROJECT ACCESS`, choose `>> Compute >> Read Write`.
  ---
  -
  -Creating with knife google::
  -+
  ---
  -Set the service account scopes when creating the machine:
  -
  -[source,sh]
  ---------------------------------------------------
  -knife google server create www1 \
  -    -m n1-standard-1 \
  -    -I debian-8 \
  -    -Z us-central1-a \
  -    -i ~/.ssh/id_rsa \
  -    -x jdoe \
  -    --gce-service-account-scopes https://www.googleapis.com/auth/compute.full_control
  ---------------------------------------------------
  -
  -Or, you may use the alias:
  -
  -[source,sh]
  ---------------------------------------------------
  -    --gce-service-account-scopes compute-rw
  ---------------------------------------------------
  ---
  -
  -[[discovery-gce-usage-testing]]
  -==== Testing GCE
  -
  -Integrations tests in this plugin require working GCE configuration and
  -therefore disabled by default. To enable tests prepare a config file
  -elasticsearch.yml with the following content:
  -
  -[source,yaml]
  ---------------------------------------------------
  -cloud:
  -  gce:
  -      project_id: es-cloud
  -      zone: europe-west1-a
  -discovery:
  -      seed_providers: gce
   --------------------------------------------------
   
   Replaces `project_id` and `zone` with your settings.
  
positive.code: --------------------------------------------------
  cloud:
    gce:
        project_id: <your-google-project-id>
        zone: ["<your-zone1>", "<your-zone2>"]
  discovery:
        seed_providers: gce
  --------------------------------------------------
  
  
  
negative.code: --------------------------------------------------
  cloud:
    gce:
      project_id: <your-google-project-id>
      zone: <your-zone>
  discovery:
    seed_providers: gce
  --------------------------------------------------
  
  The following gce settings (prefixed with `cloud.gce`) are supported:
  