fs_setup fails when specifying partition
Bug #1709513 reported by
Dan Leehr
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
When specifying the device and partition number in fs_setup according to sample documentation, cloud-init fails to successfully partition the device. If I use
- {device: /dev/vdb1, filesystem: ext3}
instead, the partitioning succeeds.
1. Cloud Provider: Openstack
2. 0.7.8-49-
3. Cloud init config
#cloud-config
disk_setup:
/dev/vdb: {layout: true, table_type: gpt}
fs_setup:
- {device: /dev/vdb, filesystem: ext3, partition: 1}
mounts:
- [/dev/vdb1, /work]
To post a comment you must log in.
Hi Dan,
Thanks for taking the time to file a bug along with the cloud-config and logs!
I tried to reproduce using cloud-init version 0.7.9-153- g16a7302f- 0ubuntu1~ 16.04.2 from the daily Ubuntu Xenial cloud image and found it partitioned as expected. I used the following cloud-config, which looks identical to yours except I am partitioning /dev/vdc:
#cloud-config
password: password
chpasswd: { expire: False }
disk_setup:
/dev/vdc:
layout: true
table_type: gpt
fs_setup:
- device: /dev/vdc
filesystem: ext3
partition: 1
mounts:
- [/dev/vdc1, /work]
Generated a local data source and created an extra disk: img,if= virtio" -drive "file=seed. img,if= virtio, format= raw" -drive "file=disk. img,if= virtio" -device virtio- net-pci, netdev= net00 -netdev type=user, id=net00, hostfwd= tcp::2222- :22
$ cloud-localds seed.img userdata.yaml
$ qemu-img create -f qcow2 disk.img 1G
$ qemu-system-x86_64 -enable-kvm -m 512 -nographic -drive "file=xenial.
After logging in I found lsblk showed the new device:
vdc 253:32 0 1G 0 disk
└─vdc1 253:33 0 1023M 0 part /work
I think the best solution for you is to upgrade your version of cloud-init.