disk-setup unable to partition disks

Bug #1311463 reported by Daniel Rogers
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Dan Watkins
cloud-init (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Won't Fix
Medium
Unassigned
Trusty
Won't Fix
Medium
Unassigned
Utopic
Won't Fix
Medium
Unassigned

Bug Description

The problem is with is_disk_used in cc_disk_setup.py

use_count is an array, which doesn't have a splitlines attribute. This is broken on ubuntu precise 12.04 with the latest updates.

def is_disk_used(device):
    """
    Check if the device is currently used. Returns true if the device
    has either a file system or a partition entry
    is no filesystem found on the disk.
    """

    # If the child count is higher 1, then there are child nodes
    # such as partition or device mapper nodes
    use_count = [x for x in enumerate_disk(device)]
    if len(use_count.splitlines()) > 1:
        return True

    # If we see a file system, then its used
    _, check_fstype, _ = check_fs(device)
    if check_fstype:
        return True

    return False

Related branches

Scott Moser (smoser)
Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium
Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
trialotto (trialotto) wrote :

Problem should not occur on Ubuntu Trusty 14.04.1 LTS

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cloud-init (Ubuntu Precise):
status: New → Confirmed
Changed in cloud-init (Ubuntu Trusty):
status: New → Confirmed
Revision history for this message
Aaron U'Ren (aauren) wrote :

@smoser - As long as this bug remains there is effectively no way to use the disk_setup options in cloud-init with overwrite protection enabled. Since the enumerate_disk function already takes care of splitting the lines, fixing this bug should be a simple matter of just removing ".splitlines()" on line 308.

Revision history for this message
Aaron U'Ren (aauren) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "disk-setup_unable_to_partition_disks.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in cloud-init (Ubuntu Utopic):
assignee: nobody → Ben Howard (utlemming)
Changed in cloud-init (Ubuntu Trusty):
assignee: nobody → Ben Howard (utlemming)
Changed in cloud-init (Ubuntu Precise):
assignee: nobody → Ben Howard (utlemming)
milestone: none → precise-updates
Changed in cloud-init (Ubuntu Trusty):
milestone: none → trusty-updates
Changed in cloud-init (Ubuntu Utopic):
milestone: none → utopic-updates
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Ben, are you actually working on this or should someone else move the patch forward? The window for vivid (which needs to be fixed first is closing)

Dan Watkins (oddbloke)
Changed in cloud-init:
assignee: nobody → Dan Watkins (daniel-thewatkins)
Dan Watkins (oddbloke)
Changed in cloud-init:
status: Confirmed → In Progress
Dan Watkins (oddbloke)
Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.7~bzr1106-0ubuntu1

---------------
cloud-init (0.7.7~bzr1106-0ubuntu1) wily; urgency=medium

  * New upstream snapshot.
    * Azure: remove strict dependency on walinux-agent, but still utilize
      it for the time being.
    * fix read_seeded that is used in seeding user-data and meta-data
      from additional locations (LP: #1455233)
    * fix bug preventing partitioning of disks in many cases. (LP: #1311463)
    * Azure: do not override hostname if user has set it (LP: #1375252)
    * Fix GCE datasource not handling per-instance SSH keys (LP: #1403617)
    * Allow specifying of uid in user/group config.

 -- Scott Moser <email address hidden> Fri, 15 May 2015 17:04:19 -0400

Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released
Mathew Hodson (mhodson)
Changed in cloud-init (Ubuntu Utopic):
status: Confirmed → Won't Fix
Changed in cloud-init (Ubuntu Precise):
importance: Undecided → Medium
Changed in cloud-init (Ubuntu Trusty):
importance: Undecided → Medium
tags: added: precise trusty
Dan Watkins (oddbloke)
Changed in cloud-init:
status: Fix Committed → Fix Released
Mathew Hodson (mhodson)
Changed in cloud-init (Ubuntu Utopic):
milestone: utopic-updates → none
Changed in cloud-init (Ubuntu Precise):
assignee: Ben Howard (utlemming) → nobody
Changed in cloud-init (Ubuntu Trusty):
assignee: Ben Howard (utlemming) → nobody
Changed in cloud-init (Ubuntu Utopic):
assignee: Ben Howard (utlemming) → nobody
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in cloud-init (Ubuntu Precise):
status: Confirmed → Won't Fix
James Falcon (falcojr)
Changed in cloud-init (Ubuntu Trusty):
status: Confirmed → Won't Fix
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.