You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Andrija Panic <an...@gmail.com> on 2013/12/17 21:55:19 UTC

Can't delete secondary storage - Cannot delete image store with active templates backup!

Hi,

I have just stumbled upon the bug that is (seems to be) described here:
https://issues.apache.org/jira/browse/CLOUDSTACK-2590
Cant delete secodnary storage NFS, with message: Cannot delete image store
with active templates backup!

I'm using the 4.2 RPMs from CS repo.

What I have done:

SCP over all templates (except the system ones, that are replicated) from
S1 to S2 NFS storage,
I have not deleted any ISOs, that are replicated accross all NFS storages...

Than I have updated table "template_store_ref" accordingly (not
template_host_ref, because now in 4.2 template_store_ref is used instead of
template_host_ref. as I was told on mailing list), for each template
separately to point to new host CS, that is I changed the store_id field
with new value. Deplyoument of new VMs from those templates are fine, all
verified.

So when I issue the sql:
mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id in
(SELECT template_id FROM cloud.template_store_ref where store_id=14) and
format='QCOW2';
+--------------------------------------------+---------------------------------+--------------------------------------+---------+
| unique_name                                | name
   | uuid                                 | type    |
+--------------------------------------------+---------------------------------+--------------------------------------+---------+
| routing-3                                  | SystemVM Template (KVM)
    | ea523de2-f588-42b1-81f0-0c0cfbb80841 | SYSTEM  |
| centos55-x86_64                            | CentOS 5.5(64-bit) no GUI
(KVM) | a2a206e9-031d-46ff-b8dd-ce6b4d4fba62 | BUILTIN |
| 258-2-4d49b0c9-0e41-3ea6-98d7-2483a5581807 | systemvm-kvm-4.2
   | c6b7f09b-2c0c-41a5-97ef-aa70fb86c92a | SYSTEM  |
+--------------------------------------------+---------------------------------+--------------------------------------+---------+
3 rows in set (0.00 sec)


As you can see, there are only 3 templates that are of type system and
builtin, no "user" templates on this old NFS storage...

Still I'm unable to delete the NFS secondary storage, with the message:
2013-12-17 21:46:43,696 DEBUG [cloud.api.ApiServlet]
(catalina-exec-25:null) ===START===  91.185.114.xxx -- GET
 command=deleteImageStore&id=c2c6ba11-eb85-45fc-9536-c1d6fa171572&response=json&sessionkey=hUArls%2BzzxZSBN6ibVqXnzPCngs%3D&_=1387313204777
2013-12-17 21:46:43,710 INFO  [cloud.api.ApiServer] (catalina-exec-25:null)
Cannot delete image store with active templates backup!

THis is all that I have in management log...


Is there any chance that the DELETE operation reads from the old
template_host_ref table instead of the new one that is used now,
template_store_ref...?
Should I also update the template_host_ref along with the
template_store_ref... ?

Any help would be really appriciated...
Andrija



-- 



Andrija Panić
--------------------------------------
  http://admintweets.com
--------------------------------------

[SOLVED] Re: Can't delete secondary storage - Cannot delete image store with active templates backup!

Posted by Nitin Mehta <Ni...@citrix.com>.
Andrija - Glad that you were able to get through this and thanks for
raising the bug.
I am taking the liberty to add the [SOLVED] tag.

Thanks,
-Nitin

On 18/12/13 8:18 AM, "Andrija Panic" <an...@gmail.com> wrote:

>Submited bug:
>https://issues.apache.org/jira/browse/CLOUDSTACK-5543
>
>
>
>On 18 December 2013 16:54, Andrija Panic <an...@gmail.com> wrote:
>
>> Nitin, You was tight...I issued the SQL statement:
>>
>> delete FROM cloud.template_store_ref where store_id=14 and template_id
>>in
>> (select id from vm_template where type='user' and format='iso');
>>
>> So deleted all references for all "user" ISOs from old NFS
>>(store_id=14),
>> and then I was able to delete the storage from GUI.
>>
>> This should be submited as a BUG, this is not normal and expected
>> behaviour.
>>
>> Since all ISOs are replicated to all SS/NFS, eather enable option from
>>GUI
>> to delete all ISOs reference to storage to be removed, or simply do NOT
>> take into account ISOs when checking if it is OK to delete SS/NFS...
>>
>> Thanks Nitin.
>>
>>
>>
>> On 18 December 2013 10:06, Andrija Panic <an...@gmail.com>
>>wrote:
>>
>>> Hi Nitin, yes that is true, ISOs does exist, which can be seen from the
>>> result of the query you sent.(lot of ISOs that are "user" type, and
>>>those 3
>>> templates I already sent that are system/builtin type)
>>>
>>> But how am I supposed to delete them ? Manualy from DB - I don't see
>>>any
>>> other way... ?
>>>
>>> Thanks
>>>
>>>
>>> On 17 December 2013 23:23, Nitin Mehta <Ni...@citrix.com> wrote:
>>>
>>>> Andrija - I think the issue is that the ISOs are still existing for
>>>>that
>>>> store. What is the result of the query below ?
>>>>
>>>>
>>>> mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where
>>>>id
>>>> in
>>>> (SELECT template_id FROM cloud.template_store_ref where store_id=14)
>>>>
>>>>
>>>> On 17/12/13 12:55 PM, "Andrija Panic" <an...@gmail.com> wrote:
>>>>
>>>> >Hi,
>>>> >
>>>> >I have just stumbled upon the bug that is (seems to be) described
>>>>here:
>>>> >https://issues.apache.org/jira/browse/CLOUDSTACK-2590
>>>> >Cant delete secodnary storage NFS, with message: Cannot delete image
>>>> store
>>>> >with active templates backup!
>>>> >
>>>> >I'm using the 4.2 RPMs from CS repo.
>>>> >
>>>> >What I have done:
>>>> >
>>>> >SCP over all templates (except the system ones, that are replicated)
>>>> from
>>>> >S1 to S2 NFS storage,
>>>> >I have not deleted any ISOs, that are replicated accross all NFS
>>>> >storages...
>>>> >
>>>> >Than I have updated table "template_store_ref" accordingly (not
>>>> >template_host_ref, because now in 4.2 template_store_ref is used
>>>>instead
>>>> >of
>>>> >template_host_ref. as I was told on mailing list), for each template
>>>> >separately to point to new host CS, that is I changed the store_id
>>>>field
>>>> >with new value. Deplyoument of new VMs from those templates are fine,
>>>> all
>>>> >verified.
>>>> >
>>>> >So when I issue the sql:
>>>> >mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template
>>>>where id
>>>> >in
>>>> >(SELECT template_id FROM cloud.template_store_ref where store_id=14)
>>>>and
>>>> >format='QCOW2';
>>>>
>>>> 
>>>>>+--------------------------------------------+------------------------
>>>>>----
>>>> >-----+--------------------------------------+---------+
>>>> >| unique_name                                | name
>>>> >   | uuid                                 | type    |
>>>>
>>>> 
>>>>>+--------------------------------------------+------------------------
>>>>>----
>>>> >-----+--------------------------------------+---------+
>>>> >| routing-3                                  | SystemVM Template
>>>>(KVM)
>>>> >    | ea523de2-f588-42b1-81f0-0c0cfbb80841 | SYSTEM  |
>>>> >| centos55-x86_64                            | CentOS 5.5(64-bit) no
>>>>GUI
>>>> >(KVM) | a2a206e9-031d-46ff-b8dd-ce6b4d4fba62 | BUILTIN |
>>>> >| 258-2-4d49b0c9-0e41-3ea6-98d7-2483a5581807 | systemvm-kvm-4.2
>>>> >   | c6b7f09b-2c0c-41a5-97ef-aa70fb86c92a | SYSTEM  |
>>>>
>>>> 
>>>>>+--------------------------------------------+------------------------
>>>>>----
>>>> >-----+--------------------------------------+---------+
>>>> >3 rows in set (0.00 sec)
>>>> >
>>>> >
>>>> >As you can see, there are only 3 templates that are of type system
>>>>and
>>>> >builtin, no "user" templates on this old NFS storage...
>>>> >
>>>> >Still I'm unable to delete the NFS secondary storage, with the
>>>>message:
>>>> >2013-12-17 21:46:43,696 DEBUG [cloud.api.ApiServlet]
>>>> >(catalina-exec-25:null) ===START===  91.185.114.xxx -- GET
>>>> >
>>>>
>>>> 
>>>>>command=deleteImageStore&id=c2c6ba11-eb85-45fc-9536-c1d6fa171572&respo
>>>>>nse=
>>>> >json&sessionkey=hUArls%2BzzxZSBN6ibVqXnzPCngs%3D&_=1387313204777
>>>> >2013-12-17 21:46:43,710 INFO  [cloud.api.ApiServer]
>>>> >(catalina-exec-25:null)
>>>> >Cannot delete image store with active templates backup!
>>>> >
>>>> >THis is all that I have in management log...
>>>> >
>>>> >
>>>> >Is there any chance that the DELETE operation reads from the old
>>>> >template_host_ref table instead of the new one that is used now,
>>>> >template_store_ref...?
>>>> >Should I also update the template_host_ref along with the
>>>> >template_store_ref... ?
>>>> >
>>>> >Any help would be really appriciated...
>>>> >Andrija
>>>> >
>>>> >
>>>> >
>>>> >--
>>>> >
>>>> >
>>>> >
>>>> >Andrija Panić
>>>> >--------------------------------------
>>>> >  http://admintweets.com
>>>> >--------------------------------------
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> Andrija Panić
>>> --------------------------------------
>>>   http://admintweets.com
>>> --------------------------------------
>>>
>>
>>
>>
>> --
>>
>> Andrija Panić
>> --------------------------------------
>>   http://admintweets.com
>> --------------------------------------
>>
>
>
>
>-- 
>
>Andrija Panić
>--------------------------------------
>  http://admintweets.com
>--------------------------------------


Re: Can't delete secondary storage - Cannot delete image store with active templates backup!

Posted by Andrija Panic <an...@gmail.com>.
Submited bug:
https://issues.apache.org/jira/browse/CLOUDSTACK-5543



On 18 December 2013 16:54, Andrija Panic <an...@gmail.com> wrote:

> Nitin, You was tight...I issued the SQL statement:
>
> delete FROM cloud.template_store_ref where store_id=14 and template_id in
> (select id from vm_template where type='user' and format='iso');
>
> So deleted all references for all "user" ISOs from old NFS (store_id=14),
> and then I was able to delete the storage from GUI.
>
> This should be submited as a BUG, this is not normal and expected
> behaviour.
>
> Since all ISOs are replicated to all SS/NFS, eather enable option from GUI
> to delete all ISOs reference to storage to be removed, or simply do NOT
> take into account ISOs when checking if it is OK to delete SS/NFS...
>
> Thanks Nitin.
>
>
>
> On 18 December 2013 10:06, Andrija Panic <an...@gmail.com> wrote:
>
>> Hi Nitin, yes that is true, ISOs does exist, which can be seen from the
>> result of the query you sent.(lot of ISOs that are "user" type, and those 3
>> templates I already sent that are system/builtin type)
>>
>> But how am I supposed to delete them ? Manualy from DB - I don't see any
>> other way... ?
>>
>> Thanks
>>
>>
>> On 17 December 2013 23:23, Nitin Mehta <Ni...@citrix.com> wrote:
>>
>>> Andrija - I think the issue is that the ISOs are still existing for that
>>> store. What is the result of the query below ?
>>>
>>>
>>> mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id
>>> in
>>> (SELECT template_id FROM cloud.template_store_ref where store_id=14)
>>>
>>>
>>> On 17/12/13 12:55 PM, "Andrija Panic" <an...@gmail.com> wrote:
>>>
>>> >Hi,
>>> >
>>> >I have just stumbled upon the bug that is (seems to be) described here:
>>> >https://issues.apache.org/jira/browse/CLOUDSTACK-2590
>>> >Cant delete secodnary storage NFS, with message: Cannot delete image
>>> store
>>> >with active templates backup!
>>> >
>>> >I'm using the 4.2 RPMs from CS repo.
>>> >
>>> >What I have done:
>>> >
>>> >SCP over all templates (except the system ones, that are replicated)
>>> from
>>> >S1 to S2 NFS storage,
>>> >I have not deleted any ISOs, that are replicated accross all NFS
>>> >storages...
>>> >
>>> >Than I have updated table "template_store_ref" accordingly (not
>>> >template_host_ref, because now in 4.2 template_store_ref is used instead
>>> >of
>>> >template_host_ref. as I was told on mailing list), for each template
>>> >separately to point to new host CS, that is I changed the store_id field
>>> >with new value. Deplyoument of new VMs from those templates are fine,
>>> all
>>> >verified.
>>> >
>>> >So when I issue the sql:
>>> >mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id
>>> >in
>>> >(SELECT template_id FROM cloud.template_store_ref where store_id=14) and
>>> >format='QCOW2';
>>>
>>> >+--------------------------------------------+----------------------------
>>> >-----+--------------------------------------+---------+
>>> >| unique_name                                | name
>>> >   | uuid                                 | type    |
>>>
>>> >+--------------------------------------------+----------------------------
>>> >-----+--------------------------------------+---------+
>>> >| routing-3                                  | SystemVM Template (KVM)
>>> >    | ea523de2-f588-42b1-81f0-0c0cfbb80841 | SYSTEM  |
>>> >| centos55-x86_64                            | CentOS 5.5(64-bit) no GUI
>>> >(KVM) | a2a206e9-031d-46ff-b8dd-ce6b4d4fba62 | BUILTIN |
>>> >| 258-2-4d49b0c9-0e41-3ea6-98d7-2483a5581807 | systemvm-kvm-4.2
>>> >   | c6b7f09b-2c0c-41a5-97ef-aa70fb86c92a | SYSTEM  |
>>>
>>> >+--------------------------------------------+----------------------------
>>> >-----+--------------------------------------+---------+
>>> >3 rows in set (0.00 sec)
>>> >
>>> >
>>> >As you can see, there are only 3 templates that are of type system and
>>> >builtin, no "user" templates on this old NFS storage...
>>> >
>>> >Still I'm unable to delete the NFS secondary storage, with the message:
>>> >2013-12-17 21:46:43,696 DEBUG [cloud.api.ApiServlet]
>>> >(catalina-exec-25:null) ===START===  91.185.114.xxx -- GET
>>> >
>>>
>>> >command=deleteImageStore&id=c2c6ba11-eb85-45fc-9536-c1d6fa171572&response=
>>> >json&sessionkey=hUArls%2BzzxZSBN6ibVqXnzPCngs%3D&_=1387313204777
>>> >2013-12-17 21:46:43,710 INFO  [cloud.api.ApiServer]
>>> >(catalina-exec-25:null)
>>> >Cannot delete image store with active templates backup!
>>> >
>>> >THis is all that I have in management log...
>>> >
>>> >
>>> >Is there any chance that the DELETE operation reads from the old
>>> >template_host_ref table instead of the new one that is used now,
>>> >template_store_ref...?
>>> >Should I also update the template_host_ref along with the
>>> >template_store_ref... ?
>>> >
>>> >Any help would be really appriciated...
>>> >Andrija
>>> >
>>> >
>>> >
>>> >--
>>> >
>>> >
>>> >
>>> >Andrija Panić
>>> >--------------------------------------
>>> >  http://admintweets.com
>>> >--------------------------------------
>>>
>>>
>>
>>
>> --
>>
>> Andrija Panić
>> --------------------------------------
>>   http://admintweets.com
>> --------------------------------------
>>
>
>
>
> --
>
> Andrija Panić
> --------------------------------------
>   http://admintweets.com
> --------------------------------------
>



-- 

Andrija Panić
--------------------------------------
  http://admintweets.com
--------------------------------------

Re: Can't delete secondary storage - Cannot delete image store with active templates backup!

Posted by Andrija Panic <an...@gmail.com>.
Nitin, You was tight...I issued the SQL statement:

delete FROM cloud.template_store_ref where store_id=14 and template_id in
(select id from vm_template where type='user' and format='iso');

So deleted all references for all "user" ISOs from old NFS (store_id=14),
and then I was able to delete the storage from GUI.

This should be submited as a BUG, this is not normal and expected behaviour.

Since all ISOs are replicated to all SS/NFS, eather enable option from GUI
to delete all ISOs reference to storage to be removed, or simply do NOT
take into account ISOs when checking if it is OK to delete SS/NFS...

Thanks Nitin.



On 18 December 2013 10:06, Andrija Panic <an...@gmail.com> wrote:

> Hi Nitin, yes that is true, ISOs does exist, which can be seen from the
> result of the query you sent.(lot of ISOs that are "user" type, and those 3
> templates I already sent that are system/builtin type)
>
> But how am I supposed to delete them ? Manualy from DB - I don't see any
> other way... ?
>
> Thanks
>
>
> On 17 December 2013 23:23, Nitin Mehta <Ni...@citrix.com> wrote:
>
>> Andrija - I think the issue is that the ISOs are still existing for that
>> store. What is the result of the query below ?
>>
>>
>> mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id
>> in
>> (SELECT template_id FROM cloud.template_store_ref where store_id=14)
>>
>>
>> On 17/12/13 12:55 PM, "Andrija Panic" <an...@gmail.com> wrote:
>>
>> >Hi,
>> >
>> >I have just stumbled upon the bug that is (seems to be) described here:
>> >https://issues.apache.org/jira/browse/CLOUDSTACK-2590
>> >Cant delete secodnary storage NFS, with message: Cannot delete image
>> store
>> >with active templates backup!
>> >
>> >I'm using the 4.2 RPMs from CS repo.
>> >
>> >What I have done:
>> >
>> >SCP over all templates (except the system ones, that are replicated) from
>> >S1 to S2 NFS storage,
>> >I have not deleted any ISOs, that are replicated accross all NFS
>> >storages...
>> >
>> >Than I have updated table "template_store_ref" accordingly (not
>> >template_host_ref, because now in 4.2 template_store_ref is used instead
>> >of
>> >template_host_ref. as I was told on mailing list), for each template
>> >separately to point to new host CS, that is I changed the store_id field
>> >with new value. Deplyoument of new VMs from those templates are fine, all
>> >verified.
>> >
>> >So when I issue the sql:
>> >mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id
>> >in
>> >(SELECT template_id FROM cloud.template_store_ref where store_id=14) and
>> >format='QCOW2';
>>
>> >+--------------------------------------------+----------------------------
>> >-----+--------------------------------------+---------+
>> >| unique_name                                | name
>> >   | uuid                                 | type    |
>>
>> >+--------------------------------------------+----------------------------
>> >-----+--------------------------------------+---------+
>> >| routing-3                                  | SystemVM Template (KVM)
>> >    | ea523de2-f588-42b1-81f0-0c0cfbb80841 | SYSTEM  |
>> >| centos55-x86_64                            | CentOS 5.5(64-bit) no GUI
>> >(KVM) | a2a206e9-031d-46ff-b8dd-ce6b4d4fba62 | BUILTIN |
>> >| 258-2-4d49b0c9-0e41-3ea6-98d7-2483a5581807 | systemvm-kvm-4.2
>> >   | c6b7f09b-2c0c-41a5-97ef-aa70fb86c92a | SYSTEM  |
>>
>> >+--------------------------------------------+----------------------------
>> >-----+--------------------------------------+---------+
>> >3 rows in set (0.00 sec)
>> >
>> >
>> >As you can see, there are only 3 templates that are of type system and
>> >builtin, no "user" templates on this old NFS storage...
>> >
>> >Still I'm unable to delete the NFS secondary storage, with the message:
>> >2013-12-17 21:46:43,696 DEBUG [cloud.api.ApiServlet]
>> >(catalina-exec-25:null) ===START===  91.185.114.xxx -- GET
>> >
>>
>> >command=deleteImageStore&id=c2c6ba11-eb85-45fc-9536-c1d6fa171572&response=
>> >json&sessionkey=hUArls%2BzzxZSBN6ibVqXnzPCngs%3D&_=1387313204777
>> >2013-12-17 21:46:43,710 INFO  [cloud.api.ApiServer]
>> >(catalina-exec-25:null)
>> >Cannot delete image store with active templates backup!
>> >
>> >THis is all that I have in management log...
>> >
>> >
>> >Is there any chance that the DELETE operation reads from the old
>> >template_host_ref table instead of the new one that is used now,
>> >template_store_ref...?
>> >Should I also update the template_host_ref along with the
>> >template_store_ref... ?
>> >
>> >Any help would be really appriciated...
>> >Andrija
>> >
>> >
>> >
>> >--
>> >
>> >
>> >
>> >Andrija Panić
>> >--------------------------------------
>> >  http://admintweets.com
>> >--------------------------------------
>>
>>
>
>
> --
>
> Andrija Panić
> --------------------------------------
>   http://admintweets.com
> --------------------------------------
>



-- 

Andrija Panić
--------------------------------------
  http://admintweets.com
--------------------------------------

Re: Can't delete secondary storage - Cannot delete image store with active templates backup!

Posted by Andrija Panic <an...@gmail.com>.
Hi Nitin, yes that is true, ISOs does exist, which can be seen from the
result of the query you sent.(lot of ISOs that are "user" type, and those 3
templates I already sent that are system/builtin type)

But how am I supposed to delete them ? Manualy from DB - I don't see any
other way... ?

Thanks


On 17 December 2013 23:23, Nitin Mehta <Ni...@citrix.com> wrote:

> Andrija - I think the issue is that the ISOs are still existing for that
> store. What is the result of the query below ?
>
>
> mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id in
> (SELECT template_id FROM cloud.template_store_ref where store_id=14)
>
>
> On 17/12/13 12:55 PM, "Andrija Panic" <an...@gmail.com> wrote:
>
> >Hi,
> >
> >I have just stumbled upon the bug that is (seems to be) described here:
> >https://issues.apache.org/jira/browse/CLOUDSTACK-2590
> >Cant delete secodnary storage NFS, with message: Cannot delete image store
> >with active templates backup!
> >
> >I'm using the 4.2 RPMs from CS repo.
> >
> >What I have done:
> >
> >SCP over all templates (except the system ones, that are replicated) from
> >S1 to S2 NFS storage,
> >I have not deleted any ISOs, that are replicated accross all NFS
> >storages...
> >
> >Than I have updated table "template_store_ref" accordingly (not
> >template_host_ref, because now in 4.2 template_store_ref is used instead
> >of
> >template_host_ref. as I was told on mailing list), for each template
> >separately to point to new host CS, that is I changed the store_id field
> >with new value. Deplyoument of new VMs from those templates are fine, all
> >verified.
> >
> >So when I issue the sql:
> >mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id
> >in
> >(SELECT template_id FROM cloud.template_store_ref where store_id=14) and
> >format='QCOW2';
> >+--------------------------------------------+----------------------------
> >-----+--------------------------------------+---------+
> >| unique_name                                | name
> >   | uuid                                 | type    |
> >+--------------------------------------------+----------------------------
> >-----+--------------------------------------+---------+
> >| routing-3                                  | SystemVM Template (KVM)
> >    | ea523de2-f588-42b1-81f0-0c0cfbb80841 | SYSTEM  |
> >| centos55-x86_64                            | CentOS 5.5(64-bit) no GUI
> >(KVM) | a2a206e9-031d-46ff-b8dd-ce6b4d4fba62 | BUILTIN |
> >| 258-2-4d49b0c9-0e41-3ea6-98d7-2483a5581807 | systemvm-kvm-4.2
> >   | c6b7f09b-2c0c-41a5-97ef-aa70fb86c92a | SYSTEM  |
> >+--------------------------------------------+----------------------------
> >-----+--------------------------------------+---------+
> >3 rows in set (0.00 sec)
> >
> >
> >As you can see, there are only 3 templates that are of type system and
> >builtin, no "user" templates on this old NFS storage...
> >
> >Still I'm unable to delete the NFS secondary storage, with the message:
> >2013-12-17 21:46:43,696 DEBUG [cloud.api.ApiServlet]
> >(catalina-exec-25:null) ===START===  91.185.114.xxx -- GET
> >
> >command=deleteImageStore&id=c2c6ba11-eb85-45fc-9536-c1d6fa171572&response=
> >json&sessionkey=hUArls%2BzzxZSBN6ibVqXnzPCngs%3D&_=1387313204777
> >2013-12-17 21:46:43,710 INFO  [cloud.api.ApiServer]
> >(catalina-exec-25:null)
> >Cannot delete image store with active templates backup!
> >
> >THis is all that I have in management log...
> >
> >
> >Is there any chance that the DELETE operation reads from the old
> >template_host_ref table instead of the new one that is used now,
> >template_store_ref...?
> >Should I also update the template_host_ref along with the
> >template_store_ref... ?
> >
> >Any help would be really appriciated...
> >Andrija
> >
> >
> >
> >--
> >
> >
> >
> >Andrija Panić
> >--------------------------------------
> >  http://admintweets.com
> >--------------------------------------
>
>


-- 

Andrija Panić
--------------------------------------
  http://admintweets.com
--------------------------------------

Re: Can't delete secondary storage - Cannot delete image store with active templates backup!

Posted by Nitin Mehta <Ni...@citrix.com>.
Andrija - I think the issue is that the ISOs are still existing for that
store. What is the result of the query below ?


mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id in
(SELECT template_id FROM cloud.template_store_ref where store_id=14)


On 17/12/13 12:55 PM, "Andrija Panic" <an...@gmail.com> wrote:

>Hi,
>
>I have just stumbled upon the bug that is (seems to be) described here:
>https://issues.apache.org/jira/browse/CLOUDSTACK-2590
>Cant delete secodnary storage NFS, with message: Cannot delete image store
>with active templates backup!
>
>I'm using the 4.2 RPMs from CS repo.
>
>What I have done:
>
>SCP over all templates (except the system ones, that are replicated) from
>S1 to S2 NFS storage,
>I have not deleted any ISOs, that are replicated accross all NFS
>storages...
>
>Than I have updated table "template_store_ref" accordingly (not
>template_host_ref, because now in 4.2 template_store_ref is used instead
>of
>template_host_ref. as I was told on mailing list), for each template
>separately to point to new host CS, that is I changed the store_id field
>with new value. Deplyoument of new VMs from those templates are fine, all
>verified.
>
>So when I issue the sql:
>mysql> SELECT unique_name,name,uuid,type FROM cloud.vm_template where id
>in
>(SELECT template_id FROM cloud.template_store_ref where store_id=14) and
>format='QCOW2';
>+--------------------------------------------+----------------------------
>-----+--------------------------------------+---------+
>| unique_name                                | name
>   | uuid                                 | type    |
>+--------------------------------------------+----------------------------
>-----+--------------------------------------+---------+
>| routing-3                                  | SystemVM Template (KVM)
>    | ea523de2-f588-42b1-81f0-0c0cfbb80841 | SYSTEM  |
>| centos55-x86_64                            | CentOS 5.5(64-bit) no GUI
>(KVM) | a2a206e9-031d-46ff-b8dd-ce6b4d4fba62 | BUILTIN |
>| 258-2-4d49b0c9-0e41-3ea6-98d7-2483a5581807 | systemvm-kvm-4.2
>   | c6b7f09b-2c0c-41a5-97ef-aa70fb86c92a | SYSTEM  |
>+--------------------------------------------+----------------------------
>-----+--------------------------------------+---------+
>3 rows in set (0.00 sec)
>
>
>As you can see, there are only 3 templates that are of type system and
>builtin, no "user" templates on this old NFS storage...
>
>Still I'm unable to delete the NFS secondary storage, with the message:
>2013-12-17 21:46:43,696 DEBUG [cloud.api.ApiServlet]
>(catalina-exec-25:null) ===START===  91.185.114.xxx -- GET
> 
>command=deleteImageStore&id=c2c6ba11-eb85-45fc-9536-c1d6fa171572&response=
>json&sessionkey=hUArls%2BzzxZSBN6ibVqXnzPCngs%3D&_=1387313204777
>2013-12-17 21:46:43,710 INFO  [cloud.api.ApiServer]
>(catalina-exec-25:null)
>Cannot delete image store with active templates backup!
>
>THis is all that I have in management log...
>
>
>Is there any chance that the DELETE operation reads from the old
>template_host_ref table instead of the new one that is used now,
>template_store_ref...?
>Should I also update the template_host_ref along with the
>template_store_ref... ?
>
>Any help would be really appriciated...
>Andrija
>
>
>
>-- 
>
>
>
>Andrija Panić
>--------------------------------------
>  http://admintweets.com
>--------------------------------------