Skip to content

Commit 68e6c0e

Browse files
brtkwrtobias-urdin
authored andcommitted
[fix] Detect virtio-scsi volumes correctly
When the Cinder volume is presented as a virtio-scsi volume, the device_name detection fails. This change allows the device name to be retrieved correctly for both virtio-pci and virtio-scsi cases. Story: 2008618 Task: 41808 Change-Id: Ia6a848eae11bc38ff71ef4575247010a8ffaa47b
1 parent 12766ea commit 68e6c0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

magnum/drivers/common/templates/fragments/configure-docker-storage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then
1313
else
1414
attempts=60
1515
while [ ${attempts} -gt 0 ]; do
16-
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${DOCKER_VOLUME:0:20}$)
16+
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${DOCKER_VOLUME:0:20} | head -n1)
1717
if [ -n "${device_name}" ]; then
1818
break
1919
fi

magnum/drivers/common/templates/kubernetes/fragments/configure-etcd.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ -n "$ETCD_VOLUME_SIZE" ] && [ "$ETCD_VOLUME_SIZE" -gt 0 ]; then
2020

2121
attempts=60
2222
while [ ${attempts} -gt 0 ]; do
23-
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${ETCD_VOLUME:0:20}$)
23+
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${ETCD_VOLUME:0:20} | head -n1)
2424
if [ -n "${device_name}" ]; then
2525
break
2626
fi

0 commit comments

Comments
 (0)