[
https://issues.apache.org/jira/browse/CLOUDSTACK-9555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15872177#comment-15872177
]
Marcelo Lima commented on CLOUDSTACK-9555:
------------------------------------------
I found this bug in 4.5.2.2 too
(local) 🐵 > deploy virtualmachine zoneid=df33046e-ab2a-429c-8653-09d869a9d7aa
templateid=c686e11d-b2a8-4a22-81e4-3cd02ea1c557
serviceofferingid=5a21d3b3-9496-4bc1-a84b-d5247783b48c
networkids=65935029-b2fc-4f4f-b122-ba05298fe46c name=test-lotic
displayname=test-lotic
Error 431: The template 228 is not available for use
workaround is update the table
mysql> select * from template_zone_ref where template_id=228;
+-----+---------+-------------+---------------------+---------------------+---------------------+
| id | zone_id | template_id | created | last_updated |
removed |
+-----+---------+-------------+---------------------+---------------------+---------------------+
| 71 | 1 | 228 | 2015-09-09 22:55:27 | 2017-02-17 16:42:09 |
2017-02-17 16:42:09 |
| 174 | 2 | 228 | 2016-05-06 03:31:41 | 2016-05-06 03:31:41 |
NULL |
+-----+---------+-------------+---------------------+---------------------+---------------------+
mysql> update template_zone_ref set removed=NULL where id=71;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from template_zone_ref where template_id=228;
+-----+---------+-------------+---------------------+---------------------+---------+
| id | zone_id | template_id | created | last_updated |
removed |
+-----+---------+-------------+---------------------+---------------------+---------+
| 71 | 1 | 228 | 2015-09-09 22:55:27 | 2017-02-17 16:42:09 |
NULL |
| 174 | 2 | 228 | 2016-05-06 03:31:41 | 2016-05-06 03:31:41 |
NULL |
+-----+---------+-------------+---------------------+---------------------+---------+
Now I can use template 228 in zone 1
> when a template is deleted and then copied over again , it is still marked as
> Removed in template_zone_ref table
> ----------------------------------------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-9555
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9555
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Usage
> Affects Versions: 4.9.0, 4.5.2.2
> Environment: All Hypervisors
> Reporter: subhash yedugundla
> Fix For: 4.10.0.0
>
>
> Charging of template stops in the following use case
> Step1:Register a Template(Name:A) to Zone1
> Step2:Copy the template(Name:A) to Zone 2
> Step3:Delete the template(Name:A) of only Zone2
> Step4:Copy the template(Name:A) to Zone 2
> Step5:Check the charging of the template
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)