SynologyOpenSource / synology-csi

Apache License 2.0
527 stars 114 forks source link

return extra lun info and allow create with direct_io_pattern #48

Open pfrybar opened 1 year ago

pfrybar commented 1 year ago

Great project! I've started to use the dsm/webapi module for a project of my own - a CLI for Synology iSCSI storage which you can see here.

Two features I would love to have for my CLI are:

  1. Returning the DevAttribs along with the LUN info. My CLI allows creating a LUN with extra features like space reclamation and FUA/Sync cache. These are dev attributes which are already supported in the LunCreateSpec. However I can't display whether an existing LUN has these enabled or not since the dev attributes are not returned by the get/list methods.
  2. Specify the I/O Policy during LUN creation. In the DSM webapp, you can see this option when editing a LUN, as shown in the first image below. I've tested it and this parameter can be passed along during LUN creation as well. By default, a LUN is created with a policy of 0 which maps to Buffered I/O. You can see this in the DSM SYNO.Core.ISCSI.LUN API response from the second image below. A value of 3 maps to the Direct I/O option.

This small PR adds both these features.

Screenshot 2023-04-12 at 11 17 41 Screenshot 2023-04-12 at 11 24 11
gjrtimmer commented 9 months ago

@chihyuwu Could you please look at this, I hope it will gets merged soon. @pfrybar Could you rebase, so the repository maintainer can merge it, I hope it will get merged soon.