Skip to content

Commit

Permalink
provisioning/gcp: add line breaks and ZONE info
Browse files Browse the repository at this point in the history
The line breaks make it nicer to be able to view the full commands
without scrolling. Adding ZONE= info here prevents an interactive
question being asked on the `gcloud` CLI when starting an instance.
  • Loading branch information
dustymabe authored and jlebon committed Apr 29, 2024
1 parent 0cc0fb5 commit 9b6e6bf
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions modules/ROOT/pages/provisioning-gcp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ You can inspect the current state of an image family as follows:
[source, bash]
----
STREAM='stable'
gcloud compute images describe-from-family --project "fedora-coreos-cloud" "fedora-coreos-${STREAM}"
gcloud compute images describe-from-family \
--project "fedora-coreos-cloud" "fedora-coreos-${STREAM}"
----

== Launching a VM instance
Expand All @@ -45,8 +46,12 @@ NOTE: Currently, we don't support logging in using SSH through the GCP web conso
[source, bash]
----
STREAM='stable'
VM_NAME='fcos-node01'
gcloud compute instances create --image-project "fedora-coreos-cloud" --image-family "fedora-coreos-${STREAM}" "${VM_NAME}"
NAME='fcos-node01'
ZONE='us-central-1a'
gcloud compute instances create \
--image-project "fedora-coreos-cloud" \
--image-family "fedora-coreos-${STREAM}" \
--zone "${ZONE} "${NAME}"
----

TIP: You can find out the instance's assigned IP by running `gcloud compute instances list`
Expand All @@ -68,9 +73,14 @@ From the command-line, use `--metadata-from-file`:
[source, bash]
----
STREAM='stable'
VM_NAME='fcos-node01'
NAME='fcos-node01'
ZONE='us-central-1a'
CONFIG='example.ign'
gcloud compute instances create --metadata-from-file "user-data=${CONFIG}" --image-project "fedora-coreos-cloud" --image-family "fedora-coreos-${STREAM}" "${VM_NAME}"
gcloud compute instances create \
--image-project "fedora-coreos-cloud" \
--image-family "fedora-coreos-${STREAM}" \
--metadata-from-file "user-data=${CONFIG}" \
--zone "${ZONE} "${NAME}"
----

NOTE: By design, https://cloud.google.com/compute/docs/startupscript[startup scripts] are not supported on FCOS. Instead, it is recommended to encode any startup logic as systemd service units in the Ignition configuration.
Expand Down

0 comments on commit 9b6e6bf

Please sign in to comment.