LINBIT / linstor-server

High Performance Software-Defined Block Storage for container, cloud and virtualisation. Fully integrated with Docker, Kubernetes, Openstack, Proxmox etc.
https://docs.linbit.com/docs/linstor-guide/
GNU General Public License v3.0
984 stars 76 forks source link

Getting zfs exception when resizing due to incompatible size to to volblocksize #401

Open dniasoff opened 7 months ago

dniasoff commented 7 months ago

Hi,

Using Linbit Server 1.27.0 on Ubuntu 22.04 with OpenZFS 2.2.2.

I have it integrated with OpenStack Cinder.

When creating a volume from an image with volume image cache enabled - part of the workflow creates a small volume and resizing it.

However, I am getting the following error inside Linbit.

Reported error:
===============

Category:                           LinStorException
Class name:                         StorageException
Class canonical name:               com.linbit.linstor.storage.StorageException
Generated at:                       Method 'checkExitCode', Source file 'ExtCmdUtils.java', Line #69

Error message:                      Failed to resize zfs volume

Error context:
        An error occurred while processing resource 'Node: 'node01.cloud5.cloudportal.app', Rsc: 'volume-251a8beb-d1e1-4200-9ebe-1a86c8089817''
ErrorContext:
  Details:     Command 'zfs set volsize=5244040KB pool1/volume-251a8beb-d1e1-4200-9ebe-1a86c8089817_00000' returned with exitcode 255.

Standard out:

Error message:
cannot set property for 'pool1/volume-251a8beb-d1e1-4200-9ebe-1a86c8089817_00000': 'volsize' must be a multiple of volume block size (16K)

Call backtrace:

    Method                                   Native Class:Line number
    checkExitCode                            N      com.linbit.extproc.ExtCmdUtils:69
    genericExecutor                          N      com.linbit.linstor.storage.utils.Commands:103
    genericExecutor                          N      com.linbit.linstor.storage.utils.Commands:63
    genericExecutor                          N      com.linbit.linstor.storage.utils.Commands:51
    resize                                   N      com.linbit.linstor.layer.storage.zfs.utils.ZfsCommands:121
    resizeLvImpl                             N      com.linbit.linstor.layer.storage.zfs.ZfsProvider:317
    resizeLvImpl                             N      com.linbit.linstor.layer.storage.zfs.ZfsProvider:67
    resizeVolumes                            N      com.linbit.linstor.layer.storage.AbsStorageProvider:717
    processVolumes                           N      com.linbit.linstor.layer.storage.AbsStorageProvider:361
    processResource                          N      com.linbit.linstor.layer.storage.StorageLayer:282
    lambda$processResource$4                 N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:908
    processGeneric                           N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:949
    processResource                          N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:904
    processChild                             N      com.linbit.linstor.layer.drbd.DrbdLayer:323
    adjustDrbd                               N      com.linbit.linstor.layer.drbd.DrbdLayer:447
    processResource                          N      com.linbit.linstor.layer.drbd.DrbdLayer:250
    lambda$processResource$4                 N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:908
    processGeneric                           N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:949
    processResource                          N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:904
    processResources                         N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:370
    dispatchResources                        N      com.linbit.linstor.core.devmgr.DeviceHandlerImpl:217
    dispatchResources                        N      com.linbit.linstor.core.devmgr.DeviceManagerImpl:331
    phaseDispatchDeviceHandlers              N      com.linbit.linstor.core.devmgr.DeviceManagerImpl:1204
    devMgrLoop                               N      com.linbit.linstor.core.devmgr.DeviceManagerImpl:778
    run                                      N      com.linbit.linstor.core.devmgr.DeviceManagerImpl:672
    run                                      N      java.lang.Thread:829

END OF ERROR REPORT.

The volblocksize is a default setting on my system - I haven't changed it anywhere.

Can I suggest the neatest approach would be for Linstor to check the volblocksize and then roundup the requested size.

Thanks

Daniel

ghernadi commented 7 months ago

Thanks for the report, we are aware of this issue with newer ZFS versions and are already working on a fix for this issue.

In order to get LINSTOR out of the resizing state, I'd suggest the following steps:

dniasoff commented 7 months ago

Thanks for a detailed and helpful response.

For now I have configured the storage pool to use a volblocksize of 4k which seems to solve the problem. I am guessing this might have an impact on disk usage/performance so look forward to the fix. This means any volumes already created before the fix will be stuck with a 4k volblocksize.

image