Skip to content

Commit e5da88f

Browse files
committed
ci: Use cloud image directly in server create
Also revert bump to Ubuntu 2204 until we bump OpenStack to match.
1 parent 453e534 commit e5da88f

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

hack/ci/gce-project.sh

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -85,37 +85,17 @@ function create_vm {
8585
local machine_type="GCP_MACHINE_TYPE_${name}"
8686
machine_type=${!machine_type}
8787
local servername="${CLUSTER_NAME}-${name}"
88-
local diskname="${CLUSTER_NAME}-disk"
89-
local imagename="${servername}-image"
9088

9189
# Loop over all zones in the GCP region to ignore a full zone.
9290
# We are not able to use 'gcloud compute zones list' as the gcloud.compute.zones.list permission is missing.
9391
for GCP_ZONE in "${GCP_REGION}-a" "${GCP_REGION}-b" "${GCP_REGION}-c"; do
94-
# Check if image was already created.
95-
# Images are not zone specific, but the disk is.
96-
if ! gcloud compute images describe "$imagename" --project "$GCP_PROJECT" >/dev/null; then
97-
# Create the base disk image based on the public Ubuntu 22.04 LTS cloud image
98-
# Note that this has also been verified to work with CentOS 8 as of
99-
# 2021-01-12, but this is not tested regularly.
100-
# To use CentOS 8:
101-
# --image-project centos-cloud --image-family centos-stream-8
102-
if ! gcloud compute disks describe "$diskname" --project "$GCP_PROJECT" --zone "$GCP_ZONE" >/dev/null; then
103-
gcloud compute disks create "$diskname" \
104-
--project "$GCP_PROJECT" \
105-
--image-project ubuntu-os-cloud --image-family ubuntu-2204-lts \
106-
--zone "$GCP_ZONE"
107-
fi
108-
gcloud compute images create "$imagename" \
109-
--project "$GCP_PROJECT" \
110-
--source-disk "$diskname" --source-disk-zone "$GCP_ZONE" \
111-
--licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
112-
fi
113-
11492
if ! gcloud compute instances describe "$servername" --project "$GCP_PROJECT" --zone "$GCP_ZONE" >/dev/null; then
11593
if gcloud compute instances create "$servername" \
11694
--project "$GCP_PROJECT" \
11795
--zone "$GCP_ZONE" \
118-
--image "$imagename" \
96+
--enable-nested-virtualization \
97+
--image-project ubuntu-os-cloud \
98+
--image-family ubuntu-2004-lts \
11999
--boot-disk-size 200G \
120100
--boot-disk-type pd-ssd \
121101
--can-ip-forward \

0 commit comments

Comments
 (0)