non-unique pxe driver 'instance_name' causes problems

Bug #1236536 reported by aeva black
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
High
Ghe Rivero

Bug Description

Currently, the driver_info['pxe']['instance_name'] property is used to determine the TFTP directory name for the instance's image storage. See ironic/drivers/modules/pxe.py:

188 def _get_image_dir_path(d_info):
189 """Generate the dir for an instances disk."""
190 return os.path.join(CONF.pxe.images_path, d_info['instance_name'])

There is presently no guarantee that the instance_name will be unique. In fact, it can be set and manipulated via Ironic's API at will by the cloud's admin, which could lead to unexpected behavior.

The history of this code is that, when the pxe driver was part of Nova, the instance_name was the instance UUID generated internally by Nova. This is now an external dependency that we can't rely on (not because we can't rely on Nova, but because this resource is writable via Ironic's API and Nova may not be the only client).

We should probably use the node's UUID instead of the instance's UUID, and this will need to be propagated out to dnsmasq's config file // neutron.

aeva black (tenbrae)
Changed in ironic:
importance: Undecided → High
Ghe Rivero (ghe.rivero)
Changed in ironic:
assignee: nobody → Ghe Rivero (ghe.rivero)
aeva black (tenbrae)
Changed in ironic:
status: New → Triaged
aeva black (tenbrae)
Changed in ironic:
milestone: none → icehouse-2
Ghe Rivero (ghe.rivero)
Changed in ironic:
status: Triaged → In Progress
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/65657

Revision history for this message
Ghe Rivero (ghe.rivero) wrote :

So, the actual dir structure is:
/tftpboot/{{node.instance_uuid}}/
/tftpboot/pxelinux.cfg/{{node.MAC_ADDRESS}}
/var/lib/ironic/images/{{node.pxe.instance_name}}

The solution proposed is to use /var/lib/ironic/images/{{node.uuid}} But since the /tftpboot is using {{node.instance_uuid}} it makes sense to have both using the same property to have an easy correlation between both.

Revision history for this message
Ghe Rivero (ghe.rivero) wrote :

The /tftpboot/pxelinux.cfg/{{node.MAC_ADDRESS}} cannot be changed due to the way PXE protocol works, but it's a link to /tftpboot/{{node.instance_uuid}}/ so there is no need to.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

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

commit b9360579ac9edd95c0c50519e242611953b63a61
Author: Ghe Rivero <email address hidden>
Date: Thu Jan 9 10:14:54 2014 +0000

    Fix non-unique pxe driver 'instance_name'

    The driver 'instance_name' property was used to determine
    the image directory name for the instance's image storage.
    Since there is no guarantee that the intance_name will be unique,
    we will use node uuid.

    Change-Id: I781424215bdeb5372ceef2d6f11737e8f003054d
    Closes-Bug: #1236536

Changed in ironic:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ironic:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: icehouse-2 → 2014.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.