Testing fails for me on Xenial - here are my steps:
1) Create a VM in Azure (any size) 2) Update cloud-init to the latest in xenial-proposed 3) Capture VM image 4) Provision a new VM using the following cloud-config:
#cloud-config fs_setup: - special: cmd: mkfs -t %(filesystem)s -L %(label)s %(device)s filesystem: ext4 device: /dev/sdb1 label: repro
I see the following logs in cloud-init.log:
2017-06-22 17:18:49,995 - cc_disk_setup.py[DEBUG]: setting up filesystems: [{'cmd': 'mkfs -t %(filesystem)s -L %(label)s %(device)s', 'filesystem': 'ext4', 'special': None, 'device': '/dev/sdb1', 'label': 'repro'}] 2017-06-22 17:18:49,995 - cc_disk_setup.py[DEBUG]: Creating new filesystem. 2017-06-22 17:18:49,996 - util.py[DEBUG]: Running command ['udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True) 2017-06-22 17:18:50,279 - cc_disk_setup.py[DEBUG]: Checking /dev/sdb1 against default devices 2017-06-22 17:18:50,279 - cc_disk_setup.py[DEBUG]: Identifying device to create repro filesytem on 2017-06-22 17:18:50,280 - util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,FSTYPE,LABEL', '/dev/sdb1'] with allowed return codes [0] (shell=False, capture=True) 2017-06-22 17:18:50,299 - cc_disk_setup.py[WARNING]: Failed to find device during available device search. 2017-06-22 17:18:50,308 - cc_disk_setup.py[DEBUG]: Automatic device for /dev/sdb1 identified as None 2017-06-22 17:18:50,308 - cc_disk_setup.py[DEBUG]: No device aviable that matches request. Skipping fs creation for {'cmd': 'mkfs -t %(filesystem)s -L %(label)s %(device)s', 'filesystem': 'ext4', 'special': None, 'device': '/dev/sdb1', 'label': 'repro'} 2017-06-22 17:18:50,308 - util.py[DEBUG]: Creating fs for /dev/sdb1 took 0.313 seconds 2017-06-22 17:18:50,309 - handlers.py[DEBUG]: finish: init-network/config-disk_setup: SUCCESS: config-disk_setup ran successfully
Testing fails for me on Xenial - here are my steps:
1) Create a VM in Azure (any size)
2) Update cloud-init to the latest in xenial-proposed
3) Capture VM image
4) Provision a new VM using the following cloud-config:
#cloud-config
fs_setup:
- special:
cmd: mkfs -t %(filesystem)s -L %(label)s %(device)s
filesystem: ext4
device: /dev/sdb1
label: repro
I see the following logs in cloud-init.log:
2017-06-22 17:18:49,995 - cc_disk_ setup.py[ DEBUG]: setting up filesystems: [{'cmd': 'mkfs -t %(filesystem)s -L %(label)s %(device)s', 'filesystem': 'ext4', 'special': None, 'device': '/dev/sdb1', 'label': 'repro'}] setup.py[ DEBUG]: Creating new filesystem. setup.py[ DEBUG]: Checking /dev/sdb1 against default devices setup.py[ DEBUG]: Identifying device to create repro filesytem on FSTYPE, LABEL', '/dev/sdb1'] with allowed return codes [0] (shell=False, capture=True) setup.py[ WARNING] : Failed to find device during available device search. setup.py[ DEBUG]: Automatic device for /dev/sdb1 identified as None setup.py[ DEBUG]: No device aviable that matches request. Skipping fs creation for {'cmd': 'mkfs -t %(filesystem)s -L %(label)s %(device)s', 'filesystem': 'ext4', 'special': None, 'device': '/dev/sdb1', 'label': 'repro'} config- disk_setup: SUCCESS: config-disk_setup ran successfully
2017-06-22 17:18:49,995 - cc_disk_
2017-06-22 17:18:49,996 - util.py[DEBUG]: Running command ['udevadm', 'settle'] with allowed return codes [0] (shell=False, capture=True)
2017-06-22 17:18:50,279 - cc_disk_
2017-06-22 17:18:50,279 - cc_disk_
2017-06-22 17:18:50,280 - util.py[DEBUG]: Running command ['/bin/lsblk', '--pairs', '--output', 'NAME,TYPE,
2017-06-22 17:18:50,299 - cc_disk_
2017-06-22 17:18:50,308 - cc_disk_
2017-06-22 17:18:50,308 - cc_disk_
2017-06-22 17:18:50,308 - util.py[DEBUG]: Creating fs for /dev/sdb1 took 0.313 seconds
2017-06-22 17:18:50,309 - handlers.py[DEBUG]: finish: init-network/