fix fsvm-init.yml to detect virtio-scsi in kvm (#11070)

* fix fsvm-init.yml to detect virtio-scsi in kvm

* Update fsvm-init.yml to handle universal block device case.
This commit is contained in:
levindecaro 2025-07-31 18:36:54 +08:00 committed by GitHub
parent a87c5c2b3a
commit f62b85dffe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,14 +30,9 @@ write_files:
} }
get_block_device() { get_block_device() {
if [ "$HYPERVISOR" == "kvm" ]; then BLOCK_DEVICE=$(lsblk -dn -o NAME,TYPE | awk '$2=="disk"{print $1}' | tail -n 1)
BLOCK_DEVICE="vdb" if [ -z "$BLOCK_DEVICE" ]; then
elif [ "$HYPERVISOR" == "xenserver" ]; then log "Unknown data disk"
BLOCK_DEVICE="xvdb"
elif [ "$HYPERVISOR" == "vmware" ]; then
BLOCK_DEVICE="sdb"
else
log "Unknown hypervisor"
exit 1 exit 1
fi fi
echo "$BLOCK_DEVICE" echo "$BLOCK_DEVICE"