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
logical pool now can list many kinds of partitions #276
Comments
Ennh, it is dangerous to export the disk already used by the system to Kimchi user. Kimchi user can use that disk to create storage pool and cause data corruption. Too bad. |
I agree to remove this patch out for safety. |
About mounted disks/partitions: we should not expose them to user to create a logical pool All the unmounted disks/partitions should be exposed but we should add a confirmation window to the user. Also lvm partitions should not be displayed as they are already part of a volume group |
I will work on backend fixes. @zhoumeina could you add the confirmation window to logical pool? |
@alinefm In reality, it is pretty for a user to know if the disk is in used or not by listing the disks/partitions only. We should add hints to user as possible as we can. Like, "it is a disk with NTFS file system" and so on. |
@alinefm So should the unmounted disks/partitions with fs be exposed? @wudx05 and @edwardbadboy some suggestions? to @alinefm, @edwardbadboy is good at storage management. . I think it is easy for him to work on backend fixes. You can let him do it. |
@shaohef @sming56 so let's expose only raw disk/partitions - unmounted and without fs. @shaohef I am OK to let @edwardbadboy work on this but it must be ready to be merged by 1.1 release (this Wed) |
For disk, on my RHEL 6.5, kimchi partitions API do no list disks. Not sure a disk without partitions should be exposed. $ sudo lsblk -Pbo TYPE,FSTYPE,SIZE,MOUNTPOINT /dev/vdb $curl -H 'Content-type: application/json' -H 'Accept: application/json' -X GET localhost:8000/host/partitions/vdb on my host, I can list two disks vda and vdb. For vda disk, I think it is OK that we do not list it. $lsblk |
On 12/16/2013 10:09 PM, alinefm wrote:
|
on my RHEL 6.5 /dev/vda2 is a pv, should not display. $ curl -H 'Content-type: application/json' -H 'Accept: application/json' -X GET localhost:8000/host/partitions |
for mpath device, there's some wrong with lsblk |
As a summary I'd propose the following solution. List all unused partitions and disks, which means we ignore LVM (PV and LV ), mounted partitions and partitions with filesystem. Special Case 1: "blkid -o device" does not list raw disks. Special Case 2: "lsblk -Pbo TYPE,FSTYPE,SIZE,MOUNTPOINT /dev/xxx" fails on multipath devices. Thanks Sheldon for testing the special cases. |
I'd submit a quick fix according to the above comment. In long term we should re-design this feature. A better solution is to list all devices regardless in use or not, and have the front end provide a check box "filter in use devices". Let the user decide if he wants to re-use a device or use a free device. |
@edwardbadboy I have commented some issue above I have encountered. |
@edwardbadboy, I agree your suggestion. we need a quick fix first. |
for logical pool: now the kimchi code always build the VG |
I think detecting existing VG deserves another patch. |
…ack-end The current logical pool implementation has some problems. It lists ext4 patitions but in fact partitions with FS should not be listed, because a dual boot system setup can make use of those unmounted partitions. It also fails to run lsblk for some devices. According to the discussion on github issue page[1]. We decide to list only unused partitions and disks, which means, PV and LV will not be listed, mounted partitions and partition with FS will not be listed. When lsblk fails to run on a purticular device, it swallows the error and return an empty dict. Some kinds of free block device still can not be listed by the current quick fix, for this is only a *quick* fix. The following cases are not covered, they should be improved in future patches. 1. PV that doesn't belong to any VG. blkid and lsblk do not provide enough information to detect if a PV belongs to an VG. To get the device path, it uses sysfs uevent file to get the device name and then assume the device path is /dev/<devname> This patch also drops the defensive coding style of the current implementation. Defensive coding is not Pythonic. It makes the code harder to debug, delay the discovery of code error and makes the main logic unclear. This patch also extract a function to run and parse lsblk to avoid repeating similar code. For a long term solution, backend should just list all block devices, along with information describing if they are in use. The front end provides a checkbox "filter in use devices" and let users decide what they want. [1] #276 Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com> Signed-off-by: Aline Manera <alinefm@br.ibm.com>
…ront-end The current front-end implementation filter out disks from the free block device listings. This is not needed after the previous back-end pat correctly listing free disks. Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
@edwardbadboy: you see lsblk can list the tree of disk. so I think it is better to find the relationship of the disk and its partitions. $ curl -u : -H 'Content-type: application/json' -H 'Accept: application/json' -X ET localhost:8000/host/partitions $ sudo lsblk |
Now it can list partitions that are mount on host and has file system on it.
Even user is the owner of the host, he may not know well the some purpose of partitions.
This is not so safe for user.
At least it should not expose the partitions has already mounted on host, and it should not expose the partitions has file system on it.
Even this, some partitions(no mount and no file system) can also be already used for some special purpose.
Or should we disable this feature in UI for 1.1 release?
The text was updated successfully, but these errors were encountered: