Comment 0 for bug 1523921

Revision history for this message
Graham Leggett (minfrin-y) wrote :

When cloud-init is used to partition a disk provided by AWS on Ubuntu v14.04, this fails.

Cloud-init is configured like this:

disk_setup:
  /dev/xvdh:
    layout: true
    overwrite: false
    table_type: 'mbr'

This causes cloud-init to fail as follows:

Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Partitioning disks: {'/dev/xvdh': {'table_type': 'mbr', 'layout': True, 'overwrite': F
alse}}
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Creating new partition table/disk
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking values for /dev/xvdh definition
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking against default devices
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device /dev/xvdh is a valid device
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/xvdh', '-
-nodeps'] with allowed return codes [0] (shell=False, capture=True)
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device layout matches
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True)
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/blockdev', '--rereadpt', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True)
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/sfdisk', '-l', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] cc_disk_setup.py[DEBUG]: Checking if device is safe to partition
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True)
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Creating partition on /dev/xvdh took 0.214 seconds
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[WARNING]: Failed partitioning operation#012'list' object has no attribute 'splitlines'
Dec 8 13:23:33 zonza-hogarth-ci-black-sql01 [CLOUDINIT] util.py[DEBUG]: Failed partitioning operation#012'list' object has no attribute 'splitlines'#012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 57, in handle#012 func=mkpart, args=(disk, definition))#012 File "/usr/lib/python2.7/dist-packages/cloudinit/util.py", line 1875, in log_time#012 ret = func(*args, **kwargs)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 684, in mkpart#012 if not overwrite and (is_disk_used(device) or is_filesystem(device)):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py", line 308, in is_disk_used#012 if len(use_count.splitlines()) > 1:#012AttributeError: 'list' object has no attribute 'splitlines'

With partitioning having failed, the disk formatting that follows fails due to the partition not existing.