ACS 4.18.1
As the title says:

- The template_zone_ref record for the given template is missing/not present
- The template_store_ref record for the given template is present/populated.
- Template is present on the Secondary Storage
- ACS shows the template as Ready/Installed, while in reality, ACS consider it absent in that Zone (when you try to use it) - due to missing zone ref records.
Reproduce the issue (with systemVM template specifically, can be tested with User templates):
- Disable the zone, delete SSVM/CPVM
- in the DB, remove the record for the systemVM template from the template_zone_ref
- Enable the Zone, observer SSVM/CPVM created in DB but not started
- Observer the mgmt logs having error: com.cloud.utils.exception.CloudRuntimeException: Unable to orchestrate start VM instance {"id":4,"instanceName":"v-4-VM","type":"ConsoleProxy","uuid":"c4bc6e96-d0ff-49ef-84c0-2e3f9d209092"} due to [Template for the VM instance can not be found in the zone ID: %s, VM instance configuration needs to be updated].
This can be fixed by simply adding a record back to the zone ref table, for the correct template_id and that's all.
Problem: The UI (and/or API) should not show template as Ready and available only based on the template_store_ref
Proposal: improve it to explain that either 1) Template is not ready in the given Zone or 2) Say that the template is installed, but not "registered" in that specific Zone
ACS 4.18.1
As the title says:
Reproduce the issue (with systemVM template specifically, can be tested with User templates):
This can be fixed by simply adding a record back to the zone ref table, for the correct template_id and that's all.
Problem: The UI (and/or API) should not show template as Ready and available only based on the template_store_ref
Proposal: improve it to explain that either 1) Template is not ready in the given Zone or 2) Say that the template is installed, but not "registered" in that specific Zone