Google Compute Engine - cloud-init 25.1.2 documentation (original) (raw)
Toggle table of contents sidebar
The GCE datasource gets its data from the internal compute meta-data server. The instance metadata service can be queried at the URLhttp://meta-data.google.internal/computeMetadata/v1/
from within an instance. For more information see the GCE metadata docs.
Currently, the default project and instance level meta-data keysproject/attributes/sshKeys
and instance/attributes/ssh-keys
are merged to provide public-keys
.
user-data
and user-data-encoding
can be provided to cloud-init
by setting those custom meta-data keys for an instance.
Configuration¶
The following configuration can be set for the datasource in system configuration (in /etc/cloud/cloud.cfg
or/etc/cloud/cloud.cfg.d/
).
The settings that may be configured are:
retries
The number of retries that should be attempted for a http request. This value is used only aftermetadata_url
is selected.
Default: 5sec_between_retries
The amount of wait time between retries when crawling the instance metadata service.
Default: 1
Example¶
An example configuration with the default values is provided below:
datasource: GCE: retries: 5 sec_between_retries: 1