PXE:The smallest and size: -1 parameters are not taking effect

When I installed Ubuntu 20.04 or later versions using PXE for interactive installation, I encountered two issues. When there are multiple disks on the server, I couldn’t select the smallest disk for installation. After the installation was successful, I also couldn’t allocate all the disks. Here is my user-data.
#cloud-config
autoinstall:
version: 1
apt:
primary:
- arches: [default]
uri: http://mirrors.aliyun.com/ubuntu
user-data:
timezone: Asia/Shanghai
disable_root: false
chpasswd:
list: |
root: $6$UenIfx4J$d4aHniLxWK4QqGuUQbAHSeGkHG5Td4UnbW0dbryzq0uy/pLzCt5vXn0OmfZcPEP.UijM4jcvRmrVqgMXqxZQF1

drivers:
install: false
identity:
hostname: dbc
password: $6$TlJW3XncHw0.zPYj$TN9MvjTfcrpUnMtdk9GY.pMKsKzCTyVbJsyHCe.iLh0Lk.NBb4PqBPB/vJS7gZHD7jDvts2.zKpCMXoQSZOos.
realname: dbc
username: dbc
keyboard:
layout: us
toggle: null
variant: ‘’
locale: en_US.UTF-8

network:
ethernets: {}
version: 2

ssh:
install-server: true

storage:
config:

- ptable: gpt
  path: /dev/sda
  wipe: superblock-recursive
  preserve: false
  name: ''
  grub_device: true
  type: disk
  id: disk-sda

- device: disk-sda
  size: -1  # 使用剩余所有空间
  flag: ''
  number: 3
  preserve: false
  type: partition
  id: partition-2

- fstype: lvm_physical_volume
  volume: partition-2
  preserve: false
  type: format
  id: format-2

- name: vg0
  devices:
    - format-2
  type: lvm_volume_group
  id: vg-0

- name: lv-swap
  size: 4294967296  # 4GB Swap
  volume_group: vg-0
  type: lvm_logical_volume
  id: lv-swap
- fstype: swap
  volume: lv-swap
  preserve: false
  type: format
  id: format-swap

- name: lv-root
  size: -1  # 使用卷组的剩余空间
  volume_group: vg-0
  type: lvm_logical_volume
  id: lv-root
- fstype: ext4
  volume: lv-root
  preserve: false
  type: format
  id: format-root
- path: /
  device: format-root
  type: mount
  id: mount-root

Could you please tell me if there is any problem?