hyperhq/hyperd

feature request: configurable disk space

Opened this issue · 9 comments

Hi,

Currently, under resources, we can only configure vcpu and memory. I found that by default the disk space allocated is 10G. Do your team have any plan to make disk space also configurable?

Is it setting here? https://github.com/hyperhq/hyperd/blob/master/storage/defaults.go#L5

https://docs.hypercontainer.io/reference/podfile.html

@gnawux Hi, can you help with the issue or point me to someone who knows about it? Thanks!

@minz1027 the DEFAULT_DM_VOL_SIZE is the default value in case:

  • devicemapper is chosen as the storage driver
  • need create a volume by the daemon

And in most cases, the volumes are created by an external dedicated volume management system, and passed to the daemon. This is why it is not an configurable item now.

However, it is welcome to submit a PR for adding an size field for the pod spec.

@gnawux Hi Xu, thanks for your reply! I have some questions about this,

  • Does it mean the configurable vol size thing will only work for devicemapper?
  • Do you want me to just add a size field to the pod spec or pass it all the way to construct a dm?

@minz1027 currently, only the block devices support a "size" property. Once you have a size field, you may apply it to all storage drivers. For block devices, such as devicemapper and rawblock, they may create a volume with specified size. And for directories, the might be implemented based on quota, which depends on the feature of the underlying filesystem.

@gnawux Hi Xu, I have the code to pass size through cmd line and pod spec. But the thing is I found that the size property or storage for the daemon is set when creating a new daemon.

daemon.Storage.Init()

By the time we tried to create a pod, the daemon should be already created and running. How can we override the storage property in that case?

I think you may change the interface of create volume,

err = dm.CreateVolume(dms.VolPoolName, deviceName, dev_id_str, storage.DEFAULT_VOL_MKFS, storage.DEFAULT_DM_VOL_SIZE, restore)

here we create the volume with default size, and you may change it to employ the size specified in pod spec.

@gnawux Hmm.. I am not sure if that will solve my problem. My problem is when I try to hyperctl run with a very large image(~10G), I will get no space left on the disk error when pulling the image.

It doesn't seem to be related to the volume.

What I want is more like setting the dm.basesize in docker daemon.
https://docs.docker.com/engine/reference/commandline/dockerd/

@gnawux Hi Xu, my PR got merge yay! I wonder when would you guys do release with that change? Thanks!

@minz1027 thank you, and it would be released in this week when #664 get merged