Hi I have the following script
This does the following:
The problem is that it seems a bit random if the data disk is mounted under
Bash:
qm create "$VMID" --name "debian-docker" --memory 10240 --sockets 1 --core 4 --net0 virtio="46:4A:5E:3C:8A:55",bridge=vmbr0 --description "Debian bullseye cloud image" --agent enabled=1
qm set "$VMID" --ide2 "$STORAGE:cloudinit"
qm set "$VMID" --serial0 socket --vga serial0
qm importdisk "$VMID" "/tmp/$IMAGE" "$STORAGE"
qm set "$VMID" --scsihw virtio-scsi-pci --scsi0 "$STORAGE:vm-$VMID-disk-0,backup=0"
# Move cloud init file to snipet folder
qm set "$VMID" --cicustom "user=snippets:snippets/$VMID-$SNIPPETNAME"
qm set "$VMID" --boot c --bootdisk scsi0
qm set "$VMID" --scsi1 "$STORAGE:128"
qm start "$VMID"
- creates a new VM
- adds a debian no cloud as boot disk
- sets vga via serial
- adds cloud init
- adds a secondary data disk
YAML:
disk_setup:
/dev/sda:
table_type: 'gpt'
layout:
- 95
- 5
fs_setup:
- label: persistent_app
filesystem: 'ext4'
device: /dev/sda1
partition: 'auto'
- label: persistent_user
filesystem: 'ext4'
device: /dev/sda2
partition: 'auto'
The problem is that it seems a bit random if the data disk is mounted under
/dev/sda
or /dev/sdb
is there some way to force them to always be in the same order?