threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

Calculate the vm's rootfs size while validating the requested resources aginst the node #2881

Closed AhmedHanafy725 closed 2 months ago

AhmedHanafy725 commented 3 months ago

Which package/s are you suggesting this feature for?

grid_client

Is your feature request related to a problem? Please describe

in case the user leaves the rootfs size of a VM 0, the client keeps it without changes while validating the requested resources and that may lead to deployment failure if the node doesn't have the requested storage + the rootfs size (which will be calculated later by zos based on the CPU and memory).

Describe the solution you'd like

I recommend calculating at the beginning of this method and setting it on the machine object instead of 0

https://github.com/threefoldtech/tfgrid-sdk-ts/blob/77cc3bbab0e4dc36162ed69842c0fd66954b8d74/packages/grid_client/src/high_level/machine.ts#L26

Mahmoud-Emad commented 2 months ago

Issue update

Work done

Calculate the root file system when creating the deployment machine

Changes