-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCP: Specify and randomize GCE region used for image import
The GCP image import method currently use the Cloud Build API with Google's Daisy workflow. This workflow creates multiple GCE resources during its execution. Although the desired Region for the imported image is specified as a workflow argument, this has no effect on the GCE Zone used by the workflow for created resources. By default it seems to default to "us-central1-a" Zone. As a result, there are common cases of resources being exhausted in the default zone. Add a method, which translates provided Google Storage Region to a GCE Region, which is needed mainly for multi and dual Storage Regions. Add a method, which returns a list of available GCE Zones for a given GCE Region. Modify the ComputeImageImport() method to translate the provided Google Storage Region to list of corresponding GCE Regions. If the provided Storage Region is not multi or dual Region, then the list contains only a single item, the provided Region. Then pick a random Region from the list. Subsequently get available GCE Zones within the Region and pick a random one for use by the workflow. Specify the GCE Zone to use as a build step argument. This change should be completely transparent to the API user. Signed-off-by: Tomas Hozza <[email protected]>
- Loading branch information
1 parent
a825b87
commit 27c5aaf
Showing
1 changed file
with
144 additions
and
0 deletions.
There are no files selected for viewing
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