Bug 881023

Summary: storage: cannot create partitions outside transaction
Product: [Fedora] Fedora Reporter: Jan Safranek <jsafrane>
Component: python-blivetAssignee: David Lehman <dlehman>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: anaconda-maint-list, bcl, dlehman, g.kaviyarasu, jonathan, sbueno, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-12 11:35:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
dlehman's patch none

Description Jan Safranek 2012-11-28 12:57:42 UTC
Created attachment 653486 [details]
dlehman's patch

Sometime ago I discussed with David Lehman how to create several partitions without transaction management in Anaconda.

I want is this to work:

def createPartition(storage):
    part1 = storage.newPartition(disks=[disk], size=100, grow=False)
    action1 = pyanaconda.storage.deviceaction.ActionCreateDevice(part1)
    storage.devicetree.registerAction(action1)
    pyanaconda.storage.partitioning.doPartitioning(storage=storage)
    disk.format.resetPartedDisk()
    action1.execute()

If I run this function once, it works as expected and creates one partition. If I run it twice, the second call raises:

  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/deviceaction.py", line 241, in execute
    self.device.create()
  File "/usr/lib64/python2.7/site-packages/pyanaconda/storage/devices.py", line 787, in create
    raise DeviceCreateError(str(e), self.name)
DeviceCreateError: ("Can't have overlapping partitions.", 'sdc3')

We agreed with David on some preliminary patch(attached), which solves the issue with disk.format.resetPartedDisk(). But the patch did not went to Anaconda upstream.


Version-Release number of selected component (if applicable):
anaconda-18.28-1.fc18.x86_64

Comment 1 David Lehman 2013-02-05 23:18:02 UTC
This should be fixed by commit bd40ab4eec434a.

Comment 2 Jan Safranek 2013-04-12 11:35:32 UTC
I haven't tested it, I use transactions now.