openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #15402
Re: Node Disk Cleaning Script
-
To:
Алексей Кайтаз <alexey@xxxxxxxxx>
-
From:
Pádraig Brady <P@xxxxxxxxxxxxxx>
-
Date:
Thu, 02 Aug 2012 18:33:14 +0100
-
Cc:
openstack@xxxxxxxxxxxxxxxxxxx
-
In-reply-to:
<CAJEapq==++fOLXHGrXn6b_6a+6hAqttm2AN=Kir=Hhu_cJgcTA@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0
On 08/02/2012 12:12 PM, Алексей Кайтаз wrote:
> Hi!
> I hope this script will usefull for somebody.
>
> #!/bin/bash
> cd /var/lib/nova/instances
> find -name "disk*" | xargs -n1 qemu-img info | grep backing | sed -e's/.*file: //' -e 's/ .*//' | sort | uniq > /tmp/ignore
> while read i; do
> ARGS="$ARGS \( ! -path $i \) "
> done < /tmp/ignore
> find /var/lib/nova/instances/_base/ -type f $ARGS -delete
This is done automatically by nova when you enable this in /etc/nova/nova.conf
remove_unused_base_images = True
That is done in Fedora/EPEL packages for the last while,
and will default on in the next folsom release.
cheers,
Pádraig.
Follow ups
References