common.utils.mkfs() needs to run as root

Bug #1271243 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Lucas Alvares Gomes

Bug Description

The mkfs() function at common.utils.py needs run execute with the run_as_root flag set to True, we also need to add the mkfs command to the rootwrap filters.

OUTPUT:

2014-01-21 14:33:56.367 15574 DEBUG ironic.openstack.common.processutils [req-8f985dd1-b500-4b93-a557-6ffb84281e71 admin admin] Running cmd (subprocess): mkfs -t ext3 -F -L ephemeral0 /dev/disk/by-path/ip-192.0.2.16:3260-iscsi-iqn-418f83df-c415-4bf3-89a5-b89fa15b6a32-lun-1-part1 execute /opt/stack/ironic/ironic/openstack/common/processutils.py:142
2014-01-21 14:33:56.385 15574 DEBUG ironic.openstack.common.processutils [req-8f985dd1-b500-4b93-a557-6ffb84281e71 admin admin] Result was 1 execute /opt/stack/ironic/ironic/openstack/common/processutils.py:167
2014-01-21 14:33:56.385 15574 ERROR ironic.drivers.modules.deploy_utils [req-8f985dd1-b500-4b93-a557-6ffb84281e71 admin admin] Deploy to address 192.0.2.16 failed.
2014-01-21 14:33:56.385 15574 ERROR ironic.drivers.modules.deploy_utils [req-8f985dd1-b500-4b93-a557-6ffb84281e71 admin admin] Command: mkfs -t ext3 -F -L ephemeral0 /dev/disk/by-path/ip-192.0.2.16:3260-iscsi-iqn-418f83df-c415-4bf3-89a5-b89fa15b6a32-lun-1-part1
2014-01-21 14:33:56.385 15574 ERROR ironic.drivers.modules.deploy_utils [req-8f985dd1-b500-4b93-a557-6ffb84281e71 admin admin] StdOut: ''
2014-01-21 14:33:56.386 15574 ERROR ironic.drivers.modules.deploy_utils [req-8f985dd1-b500-4b93-a557-6ffb84281e71 admin admin] StdErr: 'mke2fs 1.42.5 (29-Jul-2012)\nmkfs.ext3: Permission denied while trying to determine filesystem size\n'

Changed in ironic:
importance: Undecided → High
assignee: nobody → Lucas Alvares Gomes (lucasagomes)
milestone: none → icehouse-2
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/68182

Changed in ironic:
status: New → In Progress
Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

Setting it to medium as the mkfs() method is not currently being used by the code in trunk (there's patches upstream waiting for review that uses the function: ephemeral parition)

Changed in ironic:
importance: High → Medium
aeva black (tenbrae)
Changed in ironic:
milestone: icehouse-2 → icehouse-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

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

commit 7553dbfd6802a797bc52091994882bf8e3dd956c
Author: Lucas Alvares Gomes <email address hidden>
Date: Tue Jan 21 16:55:44 2014 +0000

    Run mkfs as root

    The mkfs command requires root permission to write the filesystem on
    certain devices. This patch is adding the run_as_root=True flag for the
    execute() in the mkfs() function in common/utils.py, and is also adding
    the mkfs to the rootwrap filters.

    Closes-Bug: #1271243
    Change-Id: I44e21c287510f355907fa45cbcb14b7f8c493a96

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-3 → 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.