Exception while trying to create instance template on GCP

Viewed 589

I'm trying to create an instance template using f1-micro, with all the default except service account. Using the one I created, with my custom vpc and custom role.

Creating instance template "frontend-it" failed. Error: Invalid JSON payload received. Unknown name "enableFlowLogs" at
 'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "description" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "privateIpGoogleAccess" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "logConfig" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "gatewayAddress" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "network" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "allowSubnetCidrRoutesOverlap" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "id" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "fingerprint" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "kind" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "privateIpv6GoogleAccess" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "creationTimestamp" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "purpose" at 
'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field. Invalid JSON payload received. Unknown name "region" at
 'like_instance_model.networking_model.network_interfaces[0].subnetwork': Cannot find field.

What can could it be ?

Best regards people.

3 Answers

Work around just in case anyone is interested

  1. select the source template
  2. create similar
  3. add/modify/change the new template according to requirements
  4. instead of clicking create at the bottom of the page, click on "command line"
  5. RUN IN CLOUDSHELL and execute and authorize the command

I had the same issue and followed Narender Gakka's workaround and still got an error.

Looks like the a flag was removed from templates. Older templates may include this flag but creating similar trys to add this deprecated(?) flag.

ERROR: (gcloud.beta.compute.instance-templates.create-with-container) unrecognized arguments: --reservation-affinity=any

I also encountered this issue that failed to copy instance template for all of my custom vpcs. It can be created by changing to default vpc. My solution is to

  1. Add a new subnet VPC Networks => MyVPC => Subnets => Add subnet => asia-east1-subnet2
  2. Copy an existing instance template
  3. Expand Management, security, disks, networking, sole tenancy => Networking => Subnet change to the subnet you just created and then change back to your original subnet
  4. then you can press Create
Related