This is an automated email from the ASF dual-hosted git repository.

sureshanaparti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new f62b85dffee fix fsvm-init.yml to detect virtio-scsi in kvm (#11070)
f62b85dffee is described below

commit f62b85dffee488f267ac363a3eb47dc956b41401
Author: levindecaro <[email protected]>
AuthorDate: Thu Jul 31 18:36:54 2025 +0800

    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.
---
 .../sharedfs/storagevm/src/main/resources/conf/fsvm-init.yml  | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git 
a/plugins/storage/sharedfs/storagevm/src/main/resources/conf/fsvm-init.yml 
b/plugins/storage/sharedfs/storagevm/src/main/resources/conf/fsvm-init.yml
index 4d3572162c8..ceafa6c3cb1 100644
--- a/plugins/storage/sharedfs/storagevm/src/main/resources/conf/fsvm-init.yml
+++ b/plugins/storage/sharedfs/storagevm/src/main/resources/conf/fsvm-init.yml
@@ -30,14 +30,9 @@ write_files:
       }
 
       get_block_device() {
-        if [ "$HYPERVISOR" == "kvm" ]; then
-          BLOCK_DEVICE="vdb"
-        elif [ "$HYPERVISOR" == "xenserver" ]; then
-          BLOCK_DEVICE="xvdb"
-        elif [ "$HYPERVISOR" == "vmware" ]; then
-          BLOCK_DEVICE="sdb"
-        else
-          log "Unknown hypervisor"
+        BLOCK_DEVICE=$(lsblk -dn -o NAME,TYPE | awk '$2=="disk"{print $1}' | 
tail -n 1)
+        if [ -z "$BLOCK_DEVICE" ]; then
+          log "Unknown data disk"
           exit 1
         fi
         echo "$BLOCK_DEVICE"

Reply via email to