Created
April 1, 2022 08:57
-
-
Save dex4er/9aae00a8022a2018793b87fe79e2cbfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
gcloud compute images list --project $PROJECT | |
else | |
gcloud compute images export --project $PROJECT \ | |
--async \ | |
--image "$1" \ | |
--destination-uri "gs://$BUCKET/$1.vmdk" \ | |
--export-format=vmdk \ | |
--network projects/$SERVICE_PROJECT/global/networks/$NETWORK \ | |
--subnet projects/$SERVICE_PROJECT/regions/$REGION/subnetworks/$SUBNETWORK \ | |
--zone $ZONE | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment