MAAS 2.9
Created a custom image of ESXi (but I believe it is applicable to any custom image), uploaded to MAAS.
The machine contains 2 devices and I'm willing to use "sdb" as the datastore/root/everything.
Curtin doesn't respect "custom" config of the storage and follows "simple" flow and deploys the OS on "sda", more precisely to the first block device in the array (see last two lines of the log below)
(I'm emulating this in VMs hence vda and vdb are in the logs, however the same behavious happens on the physical machines).
I'm setting up via the UI, setting up boot drive to be "sdb" and select "create custom layout" to be VMFS6.
Once the deployment is started I check the get-curtin-config and it looks right.
However, the curtin log shows the following:
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: get_blockdev_sector_size: info:
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: {
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "vdb": {
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "ALIGNMENT": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "DISC-ALN": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "DISC-GRAN": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "DISC-MAX": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "DISC-ZERO": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "FSTYPE": "",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "GROUP": "disk",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "KNAME": "vdb",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "LABEL": "",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "LOG-SEC": "512",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "MAJ:MIN": "252:16",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "MIN-IO": "512",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "MODE": "brw-rw----",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "MODEL": "",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "MOUNTPOINT": "",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "NAME": "vdb",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "OPT-IO": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "OWNER": "root",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "PHY-SEC": "512",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "RM": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "RO": "0",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "ROTA": "1",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "RQ-SIZE": "128",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "SIZE": "21474836480",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "STATE": "",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "TYPE": "disk",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "UUID": "",
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: "device_path": "/dev/vdb"
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: }
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: }
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: get_blockdev_sector_size: (log=512, phys=512)
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: Running command ['lsblk', '--noheadings', '--bytes', '--pairs', '--output=ALIGNMENT,DISC-ALN,DISC-GRAN,DISC-MAX,DISC-ZERO,FSTYPE,GROUP,KNAME,LABEL,LOG-SEC,MAJ:MIN,
MIN-IO,MODE,MODEL,MOUNTPOINT,NAME,OPT-IO,OWNER,PHY-SEC,RM,RO,ROTA,RQ-SIZE,SIZE,STATE,TYPE,UUID'] with allowed return codes [0] (capture=True)
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: Checking if /dev/vdb is a swap device
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: Found swap magic: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: wiping superblock on /dev/vdb
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: wiping /dev/vdb attempt 1/4
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: wiping 1M on /dev/vdb at offsets [0, -1048576]
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: successfully wiped device /dev/vdb on attempt 1/4
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: Running command ['udevadm', 'info', '--query=property', '/dev/vdb'] with allowed return codes [0] (capture=True)
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: devname '/sys/class/block/vda' had holders: []
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: devname '/sys/class/block/vdb' had holders: []
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: finish: cmd-install/stage-partitioning/builtin/cmd-block-meta/clear-holders: SUCCESS: removing previous storage devices
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: blockmeta: detected dd-images, using mode=simple
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: 'custom' mode but multiple devices given. using first found
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: mode is 'custom'. multiple devices given. using '/dev/vda' (first available)
2021-04-23T03:50:51-05:00 kw2 cloud-init[1260]: installing in 'custom' mode to 'vda'
This comes from the curtin code here
https://github.com/canonical/curtin/blob/d49d35bc6643b063f085d870ea94a53677ae141c/curtin/commands/block_meta.py#L104
The code finds a dd image and gets into the "meta_simple" method instead of "meta_custom" one, which leads to have an OS installed to the first device in the list always.
added messages file captured during the VM deployment.