Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Trying to create VM from instance template by using Postman API Request

I have tried to create a vm instance from instance template in Google Cloud by using API from Postman.
API Request: 

POST https://compute.googleapis.com/compute/v1/projects/
PROJECT_ID/zones/ZONE/instances?sourceInstanceTemplate=INSTANCE_TEMPLATE_NAME

with body
{
"name": "vm-from-instance-temp",
}

Ref: Create a VM from an instance template  |  Compute Engine Documentation  |  Google Cloud

But I got this error messages.

Internal error. Please try again or contact Google Support. (Code: '5F6EA7386ADEB.5E9855E.460B55DB')
PS: I use GCP Free trial.


unnamed.png

0 1 305
1 REPLY 1

Hello antza,

Reading this post from Github, they explained what might be causing the issue is to should send the id instead of the name for resourcePolicies.

Noticed the data format of resourcePolicies, it is a shortname returned from api but when creating an instance, it requires the format like projects/%s/regions/%s/resourcePolicies/%s. The provider rely on whatever returned from api of the template to create an instance.