Brian Dorsey
Brian Dorsey

Reputation: 4688

My Google Compute Engine instances hang during boot using the v1 API

In the serial console, I see:

<snip>
Booting from Hard Disk...
Booting from 0000:7c00

… instance hangs

Specifically creating the instance with the v1 API results in a hang:

API_VERSION = 'v1'
gce_service = build('compute', API_VERSION)
...
request = gce_service.instances().insert(
       project=PROJECT_ID, body=instance, zone=DEFAULT_ZONE)

While creating the instance with the v1beta16 API boots successfully:

API_VERSION = 'v1beta16'
gce_service = build('compute', API_VERSION)
...
request = gce_service.instances().insert(
   project=PROJECT_ID, body=instance, zone=DEFAULT_ZONE)

Upvotes: 1

Views: 939

Answers (1)

Brian Dorsey
Brian Dorsey

Reputation: 4688

You may experience this issue because of changes in how kernels are handled in the v1 API compared to the v1beta16 API. In v1beta16, Compute Engine injected a Google-supplied kernel at boot time. As of v1, Compute Engine now uses stock kernels from the boot image or persistent disk. This allows far more flexibility, but does require a one time manual step to update persistent disks and images created before v1. You can use the detailed steps provided in the transition guide to help you update your disk or image.

If you just need to start your instances quickly, you can use the deprecated v1beta16 API to do so. Example using gcutil:

$ gcutil addinstance INSTANCE_NAME --disk=DISK_NAME,boot --service_version=v1beta16

Upvotes: 1

Related Questions