Skip to content

lib/host: disk_is_available function only validates mounted disks and not others #276

@rushikeshjadhav

Description

@rushikeshjadhav

In following case, disk_is_available('sdb') returns True which should not be the case.

def disk_is_available(self, disk):

[18:26 xcp-ng-xs1 ~]# lsblk 
NAME                                                                                     MAJ:MIN  RM   SIZE RO TYPE MOUNTPOINT
sdb                                                                                        8:16    0   500G  0 disk 
├─linstor_group-thin_device_tmeta                                                        253:1     0   128M  0 lvm  
│ └─linstor_group-thin_device-tpool                                                      253:3     0 499.8G  0 lvm  
│   ├─linstor_group-thin_device                                                          253:4     0 499.8G  0 lvm  
│   └─linstor_group-xcp--persistent--database_00000                                      253:5     0     1G  0 lvm  
│     └─drbd1000                                                                         147:1000  0     1G  0 disk 
└─linstor_group-thin_device_tdata                                                        253:2     0 499.8G  0 lvm  
  └─linstor_group-thin_device-tpool                                                      253:3     0 499.8G  0 lvm  
    ├─linstor_group-thin_device                                                          253:4     0 499.8G  0 lvm  
    └─linstor_group-xcp--persistent--database_00000                                      253:5     0     1G  0 lvm  
      └─drbd1000                                                                         147:1000  0     1G  0 disk 
sr0                                                                                       11:0     1  1024M  0 rom  
sdc                                                                                        8:32    0   500G  0 disk 
sda                                                                                        8:0     0    50G  0 disk 
├─sda4                                                                                     8:4     0   512M  0 part 
├─sda2                                                                                     8:2     0    18G  0 part 
├─sda5                                                                                     8:5     0     4G  0 part /var/log
├─sda3                                                                                     8:3     0   8.5G  0 part 
│ └─XSLocalEXT--8900cca8--706a--d7f2--447b--bff4129333a3-8900cca8--706a--d7f2--447b--bff4129333a3
                                                                                         253:0     0   8.5G  0 lvm  /run/sr-mount/8900cca8-706a-d7f2-447b-bff4129333a3
├─sda1                                                                                     8:1     0    18G  0 part /
└─sda6                                                                                     8:6     0     1G  0 part [SWAP]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions