bare metal deploy uses non-scripting mode fdisk, breaks on quantal

Bug #1088652 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Chris Krelle

Bug Description

On quantal, fdisk has changed its UI (which it is allowed to as its not a scripting tool).

So we see:
nova-deploy-helper generates: sudo fdisk /dev/disk/by-path/ip-192.168.2.52:3260-iscsi-iqn-a44d23cd-a890-400f-ac84-bbf693acca8e-lun-1

Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-4194303, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-4194303, default 4194303): +1024M

Command (m for help): t Selected partition 1 Hex code (type L to list codes): 1 Changed system type of partition 1 to 1 (FAT12)

^ generated from the keystrokes 'n,p,1,,+1024M,t,1,82,w' the 1 is meant to be partition selection, but newer fdisk doesn't ask when there is only one partition available!

A better tool to use is /sbin/sfdisk which has a scripting interface - for instance,
sudo sfdisk $IMAGE_BLOCK_DEVICE << EOF
1 - - *
0 0;
0 0;
0 0;
EOF

Will make a new partition table, allocate everything to the first partition.

Tags: baremetal
Revision history for this message
Robert Collins (lifeless) wrote :

(and sgdisk for GPT tables once we get real big disks ;))

aeva black (tenbrae)
Changed in nova:
assignee: nobody → Devananda van der Veen (devananda)
milestone: none → havana-1
aeva black (tenbrae)
Changed in nova:
assignee: Devananda van der Veen (devananda) → Chris Krelle (nobodycam)
status: Triaged → In Progress
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/24484

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

Reviewed: https://review.openstack.org/24484
Committed: http://github.com/openstack/nova/commit/0ee0eba0efc264b94856d2e6b43a5fabe3eeaac0
Submitter: Jenkins
Branch: master

commit 0ee0eba0efc264b94856d2e6b43a5fabe3eeaac0
Author: Chris Krelle <email address hidden>
Date: Thu Mar 14 15:14:01 2013 -0700

    Switch nova-baremetal-deploy-helper to use sfdisk.

    This patch changes make_partitions function to use sfdisk instead
    of fdisk. Also added logging of cmd, stdout, and stderr should
    command fail.

    Fixes Bug 1088652

    Change-Id: Ia2711a5450900c95598253f2a7b02e7c3e83a3d8
    Authored-by: Chris Krelle <email address hidden>

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