File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
plugins/storage/sharedfs/storagevm/src/main/resources/conf Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -29,23 +29,9 @@ write_files:
2929 echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> $LOG_FILE
3030 }
3131 get_block_device() {
32- if [ "$HYPERVISOR" == "kvm" ]; then
33- BLOCK_DEVICE="sdb"
34- if [ -n "$(blkid /dev/$BLOCK_DEVICE)" -a -z "$(blkid -s TYPE /dev/$BLOCK_DEVICE)" ]; then
35- BLOCK_DEVICE="sda"
36- fi
37- elif [ "$HYPERVISOR" == "xenserver" ]; then
38- BLOCK_DEVICE="xvdb"
39- if [ -n "$(blkid /dev/$BLOCK_DEVICE)" -a -z "$(blkid -s TYPE /dev/$BLOCK_DEVICE)" ]; then
40- BLOCK_DEVICE="xvda"
41- fi
42- elif [ "$HYPERVISOR" == "vmware" ]; then
43- BLOCK_DEVICE="sdb"
44- if [ -n "$(blkid /dev/$BLOCK_DEVICE)" -a -z "$(blkid -s TYPE /dev/$BLOCK_DEVICE)" ]; then
45- BLOCK_DEVICE="sda"
46- fi
47- else
48- log "Unknown hypervisor"
32+ BLOCK_DEVICE=$(lsblk -dn -o NAME,TYPE | awk '$2=="disk"{print $1}' | tail -n 1)
33+ if [ -z "$BLOCK_DEVICE" ]; then
34+ log "Unknown data disk"
4935 exit 1
5036 fi
5137 echo "$BLOCK_DEVICE"
You can’t perform that action at this time.
0 commit comments