-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Line 3280 in 1ead6c1
| if (defaultMaxAccountSecondaryStorageInGB != Resource.RESOURCE_UNLIMITED && (accountDirSizeInGB + contentLengthInGB) > defaultMaxAccountSecondaryStorageInGB) { |
This shoule consider if Account Secondary Storage limits is Resource.RESOURCE_UNLIMITED or greater than defaultMaxAccountSecondaryStorageInGB.
And if upload to project shoule use defaultMaxProjectSecondaryStorageInGB or Project Secondary Storage limits.
ISSUE TYPE
- Bug Report
COMPONENT NAME
secondary-storage
CLOUDSTACK VERSION
4.16.0.0
CONFIGURATION
Global Settings:
max.account.secondary.storage = 10
max.project.secondary.storage = 400
SUMMARY
Configure account Secondary Storage limits to -1 or 150 GB.
Upload Template to user or project always fail when image size is larger than Global Settings max.account.secondary.storage.
STEPS TO REPRODUCE
Upload Template
EXPECTED RESULTS
Upload successful
ACTUAL RESULTS
Template b6e6df36-c7f4-4c24-868d-4d846469cae3 failed to upload. Error details: Maximum number of resources of type secondary_storage for account has exceeded
2022-05-25 02:15:29,162 ERROR [storage.resource.NfsSecondaryStorageResource] (nioEventLoopGroup-3-2:null) accountDirSizeInGb: 0 defaultMaxAccountSecondaryStor
ageInGB: 10 contentLengthInGB:24
2022-05-25 02:15:29,163 ERROR [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-2:null) post request validation failed
com.cloud.exception.InvalidParameterValueException: Maximum number of resources of type secondary_storage for account has exceeded
at org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.checkSecondaryStorageResourceLimit(NfsSecondaryStorageResource.java:3286)
at org.apache.cloudstack.storage.resource.NfsSecondaryStorageResource.createUploadEntity(NfsSecondaryStorageResource.java:3224)
at org.apache.cloudstack.storage.resource.HttpUploadServerHandler.channelRead0(HttpUploadServerHandler.java:162)
at org.apache.cloudstack.storage.resource.HttpUploadServerHandler.channelRead0(HttpUploadServerHandler.java:65)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:312)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:299)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:415)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1304)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:921)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:135)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:546)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:500)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)