Issue:
The functionality for transitioning a cloned template from the draft state to the Preview or Publish state is not working as expected for GCP customers. When attempting to change the state, the template reverts to the draft state without any reported errors. This issue specifically affects cloned templates and not new ones.
Error:
In the GCP console, the template instance will have the following error in the log explorer.
Location zone violates constraint constraints/gcp.resourceLocations on the resource projects/<project name>/zones/instance
Please Note: Currently, there are no errors displayed in the Workspot Control. However, in upcoming Control releases, this error will be detected and presented within the Control interface.
Cause:
GCP resource locations constraint Organization Policy limiting the locations as a result of the instance template failing to get created.
For more details please refer: https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations
Reason:
When a customer administrator attempts to change the Cloned Template state from Draft to publish/preview, Workspot Control tries to publish the Template as a global instance template. Thus, the same template can be used in any region. However, due to constraints imposed by the GCP Organization Policy Service regarding resource locations, the Template VM encounters failure in creating a global instance template.
For more details, please refer: https://cloud.google.com/compute/docs/instance-templates