baremetal-deploy-helper fails to create partitions

Bug #1166112 reported by Arata Notsu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Arata Notsu

Bug Description

sfdisk says 'bad input'. The input is, for example, "1 10240 83;\n- 1024 82;\n0 0;\n0 0;\n". If "--force" option is passed to sfdisk, it results in:

   Device Boot Start End MiB #blocks Id System
/dev/sdb1 0+ 10244- 10245- 10490444+ 83 Linux
/dev/sdb2 10236+ 11264- 1028- 1052257+ 82 Linux swap / Solaris
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty

The start of the second partition is set in the first partition. It seems
sfdisk's bug (I tried this in Ubuntu x86_64 12.04 and 12.10).

The following is the log:

2013-04-08 18:37:59 ERROR [nova.virt.baremetal.deploy_helper] Cmd : sudo nova-rootwrap /etc/nova/rootwrap.conf sfdisk -uM /dev/disk/by-path/ip-192.168.175.13:3260-iscsi-iqn-aa5d940b-dbdd-43b4-b8e7-812dafeb6882-lun-1
2013-04-08 18:37:59 ERROR [nova.virt.baremetal.deploy_helper] StdOut :
Disk /dev/disk/by-path/ip-192.168.175.13:3260-iscsi-iqn-aa5d940b-dbdd-43b4-b8e7-812dafeb6882-lun-1: 36481 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End MiB #blocks Id System
/dev/disk/by-path/ip-192.168.175.13:3260-iscsi-iqn-aa5d940b-dbdd-43b4-b8e7-812dafeb6882-lun-1-part1 0 - 0 0 0 Empty
/dev/disk/by-path/ip-192.168.175.13:3260-iscsi-iqn-aa5d940b-dbdd-43b4-b8e7-812dafeb6882-lun-1-part2 0 - 0 0 0 Empty
/dev/disk/by-path/ip-192.168.175.13:3260-iscsi-iqn-aa5d940b-dbdd-43b4-b8e7-812dafeb6882-lun-1-part3 0 - 0 0 0 Empty
/dev/disk/by-path/ip-192.168.175.13:3260-iscsi-iqn-aa5d940b-dbdd-43b4-b8e7-812dafeb6882-lun-1-part4 0 - 0 0 0 Empty

2013-04-08 18:37:59 ERROR [nova.virt.baremetal.deploy_helper] StdErr : Checking that no-one is using this disk right now ...
OK
Warning: bad partition start (earliest 10245)

sfdisk: bad input

Tags: baremetal
Arata Notsu (arata776)
description: updated
Arata Notsu (arata776)
description: updated
Arata Notsu (arata776)
description: updated
Revision history for this message
Arata Notsu (arata776) wrote :

I found that we can avoid the problem using an input such as ",1024,82;" instead of "- 1024 82".

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/26474

Changed in nova:
assignee: nobody → Arata Notsu (arata776)
status: New → In Progress
Revision history for this message
aeva black (tenbrae) wrote :

The existing sfdisk code has been working for several folks on the TripleO team, but your fix also appears valid. I'm going to test it in our environment...

tags: added: baremetal
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/26474
Committed: http://github.com/openstack/nova/commit/773de421cfc148352a2e133c849bfe1ab311cda7
Submitter: Jenkins
Branch: master

commit 773de421cfc148352a2e133c849bfe1ab311cda7
Author: Arata Notsu <email address hidden>
Date: Tue Apr 9 21:43:52 2013 +0900

    baremetal: Change input for sfdisk

    To prevent sfdisk stopping with "bad input", use a empty string
    instead of "-" (and doing so requires using "," as a separator).

    Fixes bug 1166112

    Change-Id: I5e4cffaa326fbafd1583d55744f921a40b3ae76f

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