Handle hard drive overflow when downloading/caching images in PXE cache

Bug #1316168 reported by Dmitry Tantsur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Dmitry Tantsur

Bug Description

1. When image is exceeding free disk space, try to purge cache
2. If it is still not enough, fail without trying to download

Dmitry Tantsur (divius)
Changed in ironic:
assignee: nobody → Dmitry "Divius" Tantsur (divius)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/92625

Changed in ironic:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/94371

Ruby Loo (rloo)
Changed in ironic:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/92625
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=7562dac1e27c13fca44e18f38f1c1874a7cf13b4
Submitter: Jenkins
Branch: master

commit 7562dac1e27c13fca44e18f38f1c1874a7cf13b4
Author: Dmitry Tantsur <email address hidden>
Date: Wed May 7 18:04:33 2014 +0200

    Consider free disk space before downloading images into cache

    This patch makes PXE driver ensure it has enough disk space
    to actually download required images. If it does not, it tries
    to make some space by starting cache clean up.

    While it would be better to have this code in ImageCache itself,
    by keeping it in PXE module we have the ability to clean up
    both caches, not only current one, thus reclaiming more space.
    We clean up instance image cache first, because:
    1. It's probably larger
    2. Instance images are not required for running instances,
       so they are more likely to be cleaned

    In the follow-up patch I'll implement hints for clean_up()
    call on how much space we need. Otherwise clean_up procedure
    may think that nothing needs to be cleaned even though
    we don't have enough space for new downloads.

    This patch also adds ironic.common.images.download_size() helper
    and makes master_dir attribute of ImageCache public.
    One more side-effect on implementation is that values in pxe_info
    dict are now tuples (as they are supposed to be), not lists.

    Change-Id: I1e7294b6e7155d83e72cfd144abdca858cab0aae
    Partial-Bug: #1316168

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/94371
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=581ffa98d2fe56e2919b06f2caec3043fd745339
Submitter: Jenkins
Branch: master

commit 581ffa98d2fe56e2919b06f2caec3043fd745339
Author: Dmitry Tantsur <email address hidden>
Date: Tue May 20 15:47:37 2014 +0200

    PXE to pass hints to ImageCache on how much space to reclaim

    After previous patch PXE triggers cache clean up, if there's not enough
    disk space for deployment. However, standard clean up may reclaim too
    little space, due to configuration. This patch implements hints to
    ImageCache, so that it tries to reclaim exactly required amount
    of disk space.

    Note that this amount is calculated as total size of images multiplied
    by two as an attempt to account for images converting to raw format.

    Change-Id: I8f95b7e6334a37e9e6e98278a5b61a9ace7221b5
    Closes-Bug: #1316168

Changed in ironic:
status: In Progress → Fix Committed
Changed in ironic:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.