-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dlpar_vscsi: get device node for lscfg #2762
dlpar_vscsi: get device node for lscfg #2762
Conversation
lscfg -vl do not support device id input, so get the node name for given device id to fix device not found error Signed-off-by: Abdul Haleem <[email protected]>
Before fix
After fix
|
@@ -34,7 +35,8 @@ def setUp(self): | |||
Gather necessary test inputs. | |||
''' | |||
device = self.params.get('disk', default=None) | |||
self.disk = disk.get_absolute_disk_path(device) | |||
dev_path = disk.get_absolute_disk_path(device) | |||
self.disk = os.path.basename(os.path.realpath(dev_path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abdhaleegit what are we trying to achieve here,
>>> disk.get_absolute_disk_path('/dev/sda')
'/dev/sda'
>>>
>>> disk.get_absolute_disk_path('sda')
'/dev/sda'
>>>
>>> os.path.basename(os.path.realpath('/dev/sda'))
'sda'
>>>
# lsscsi
[0:0:1:0] disk AIX VDASD 0001 /dev/sda
[2:0:1:0] disk AIX VDASD 0001 /dev/sdb
====>>> above two disks are vscsi disks
[root@sys avocado-fvt-wrapper]# lsblk -l sda
lsblk: sda: not a block device
[root@sys avocado-fvt-wrapper]#
[root@sys avocado-fvt-wrapper]# lsblk -l /dev/sda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 70G 0 disk
sda1 8:1 0 4M 0 part
sda2 8:2 0 1G 0 part /boot
sda3 8:3 0 69G 0 part
rhel_sys-root 253:0 0 41.7G 0 lvm /
rhel_sys-swap 253:1 0 7G 0 lvm [SWAP]
rhel_sys-home 253:2 0 20.3G 0 lvm /home
[root@sys avocado-fvt-wrapper]#
I feel the older way itself working fine.
can you please re-check on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Naresh-ibm my input here is /dev/disk/by-id/scsi-SAIX_VDASD_00fbecf500004b0000000185a73de2a2.2 so the test were failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all our input to test are device by id for persistent device name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lscfg -vl do not support device id input, so
get the node name for given device id to fix
device not found error