Closed nilo85 closed 5 months ago
NVME devices in Linux are not the only storage devices that have this differing form of naming for partitions, other examples would be SD cards (i.e. /dev/mmcblk0p1), partitioned loop devices (i.e. /dev/loop0p1) and I think software RAID devices (i.e. /dev/md0p1).
@nilo85 thanks for filing this issue! It looks like cloud-init needs to update this code to support various different disk types.
@nilo85 hey it looks like the config you shared can't invoke the codepath that caused the issue. Can you please provide the full config? I'm guessing that you tried to share just the relevant part and didn't realize that the error came from the fs format failure path.
@nilo85 hey it looks like the config you shared can't invoke the codepath that caused the issue. Can you please provide the full config? I'm guessing that you tried to share just the relevant part and didn't realize that the error came from the fs format failure path.
confirmed: https://github.com/canonical/cloud-init/pull/5263#issuecomment-2110815684
This was my config, then I later removed the alias to "ssd" to remove alias being the issue
device_aliases:
ssd: /dev/nvme0n1
disk_setup:
ssd:
table_type: gpt
layout: [[5, 82], [95, 83]]
fs_setup:
- label: swap
device: ssd.1
filesystem: swap
- label: data
device: ssd.2
filesystem: ext4
Pretty sure it is disk setup based on this line in the stacktrace?
File "/usr/lib/python3/dist-packages/cloudinit/config/cc_disk_setup.py", line 157, in handle
util.log_time(
I tried modifying the python code and added debug output etc but quickly realised why I dont code in python (couldnt make sens of it) ;)
But it seems those enumerate methods are shared cross fs and disk setup
I can try to give it a new try the next days to see if I can get better understanding exactly where we are in the flow.
EDIT: you are probably right, it did create the partition table for me etc, but not any filesystems, so maybe I was just assuming it was disk_setup that was the issue due to the filename.
I thought it was some disk verification step after creating layout that failed
Bug report
When trying to partition a nvme ssd, it seems the cloud init assumes bad name convention for partitions. It outputs
Where the real name convention is /dev/nvme0n1p1
Steps to reproduce the problem
Environment details
cloud-init logs