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.
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 ci-black- sql01 [CLOUDINIT] cc_disk_ setup.py[ DEBUG]: Creating new partition table/disk ci-black- sql01 [CLOUDINIT] cc_disk_ setup.py[ DEBUG]: Checking values for /dev/xvdh definition ci-black- sql01 [CLOUDINIT] cc_disk_ setup.py[ DEBUG]: Checking against default devices ci-black- sql01 [CLOUDINIT] cc_disk_ setup.py[ DEBUG]: Checking if device /dev/xvdh is a valid device ci-black- sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE, FSTYPE, LABEL', '/dev/xvdh', '- ci-black- sql01 [CLOUDINIT] cc_disk_ setup.py[ DEBUG]: Checking if device layout matches ci-black- sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True) ci-black- sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/blockdev', '--rereadpt', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True) ci-black- sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True) ci-black- sql01 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/sfdisk', '-l', '/dev/xvdh'] with allowed return codes [0] (shell=False, capture=True) ci-black- sql01 [CLOUDINIT] cc_disk_ setup.py[ DEBUG]: Checking if device is safe to partition 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) ci-black- sql01 [CLOUDINIT] util.py[DEBUG]: Creating partition on /dev/xvdh took 0.214 seconds ci-black- sql01 [CLOUDINIT] util.py[WARNING]: Failed partitioning operation#012'list' object has no attribute 'splitlines' 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.splitline s()) > 1:#012Attribute Error: 'list' object has no attribute 'splitlines'
alse}}
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
-nodeps'] with allowed return codes [0] (shell=False, capture=True)
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
Dec 8 13:23:33 zonza-hogarth-
With partitioning having failed, the disk formatting that follows fails due to the partition not existing.