Baremetal pxe driver doesn't delete /tftpboot/{uuid}/*

Bug #1101048 reported by aeva black
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
aeva black

Bug Description

Baremetal PXE driver deactivate_bootloader() is failing to delete tftp images when driver.destroy() is called. This results in a non-empty /tftpboot/{instance-uuid}/ directory being left behind on the compute node after an instance is deleted.

I believe this happens because the instance parameter passed to driver.destroy() does not contain ['extra_specs']['deploy_kernel_id'] or ['extra_specs']['deploy_ramdisk_id']. These these were passed to driver.spawn(), so I had assumed they were passed to driver.destroy() as well. This can be confirmed by logging the exception within the first try: block of deactivate_bootloader().

One solution is to pass extra_specs to driver.destroy().
Another solution is for deactivate_bootloader() to blindly delete all files under the /tftpboot/{instance-uuid}/ directory.

Tags: baremetal
aeva black (tenbrae)
tags: added: baremetal
Changed in nova:
assignee: nobody → Devananda (devananda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/20039
Committed: http://github.com/openstack/nova/commit/e306beac9297f4311aa3989e93b0bd19eb4d7c77
Submitter: Jenkins
Branch: master

commit e306beac9297f4311aa3989e93b0bd19eb4d7c77
Author: Devananda van der Veen <email address hidden>
Date: Fri Jan 18 09:40:37 2013 -0800

    PXE driver should rmtree directories it created

    Baremetal PXE driver was failing to delete the per-instance tftpboot and
    image directories which it created when the instance was deleted. This
    happened partly because of dangling files within the directory, and
    partly because 'unlink' does not remove directories and the error was
    squelched.

    Now, when destroy()ing an instance, PXE driver will call shutil.rmtree()
    on the per-instance directories which it created.

    Fixes bug 1101048.

    Change-Id: I682d0264288add488ea23e5d5200357b7be52dd9

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-3 → 2013.1
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.