[Openstack-operators] Database cleanup scripts?

Matt Riedemann mriedem at linux.vnet.ibm.com
Fri Sep 2 16:24:52 UTC 2016


On 9/2/2016 10:20 AM, Arne Wiebalck wrote:
>
>> On 02 Sep 2016, at 17:08, Matt Fischer <matt at mattfischer.com
>> <mailto:matt at mattfischer.com>> wrote:
>>
>>
>> On Fri, Sep 2, 2016 at 8:57 AM, Abel Lopez <alopgeek at gmail.com
>> <mailto:alopgeek at gmail.com>> wrote:
>>
>>     For cinder, since kilo, we've had 'cinder-manage db purge-deleted'
>>
>>
>> This is the issue we see with this tool in Liberty, I think this might
>> be fixed in M.
>>
>> # cinder-manage db purge 365
>> .... (some stuff works here)
>> ...
>>
>> 2016-09-02 15:07:02.196 203924 ERROR cinder DBReferenceError:
>> (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent
>> row: a foreign key constraint fails
>> (`cinder`.`volume_glance_metadata`, CONSTRAINT
>> `volume_glance_metadata_ibfk_2` FOREIGN KEY (`snapshot_id`) REFERENCES
>> `snapshots` (`id`))') [SQL: u'DELETE FROM snapshots WHERE
>> snapshots.deleted_at < %s'] [parameters: (datetime.datetime(2015, 9,
>> 3, 15, 7, 2, 189701),)]
>>
>
> I think this is fixed here: https://review.openstack.org/#/c/338228/
> (which comes with Newton only).
>
> Cheers,
>  Arne
>
>
> --
> Arne Wiebalck
> CERN IT
>
>
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>

If someone can backport that to stable/mitaka I'll +2 it. It's not a 
clean backport to mitaka.

There are also archive scripts in the osops repo here:

http://git.openstack.org/cgit/openstack/osops-tools-generic/tree/nova/openstack_db_archive.sh

I haven't used ^ personally, but I know it was written because the 
archive scripts in nova-manage were broken until a couple of releases 
back where we fixed the FKey issue.

We're still working on getting a purge instances nova-manage command in 
ocata (don't archive, straight up delete).

-- 

Thanks,

Matt Riedemann




More information about the OpenStack-operators mailing list