openmainframeproject / feilong

Feilong is a open source z/VM cloud connector project under the Open Mainframe Project umbrella that will accelerate the z/VM adoption, extending its ecosystem and its user experience. It provides a set of APIs to operate z/VM including guest, image, network, volume etc.
https://www.openmainframeproject.org/projects/feilong
Apache License 2.0
35 stars 70 forks source link

unpackdiskimage reporting incorrect disk size #781

Closed rsoaresbsb closed 8 months ago

rsoaresbsb commented 8 months ago

Hi team,

To increase the space used for specific mount points on linux, we generated a new gold image, but when we try create a new guest basead on the new image, unpackdiskimage report incorrectly the size volume. In this case bellow, both z/vm guests and image generated has 50000 cylinders, 20032 is the size for old image. I can't find where he is getting this info to adjust.. any help?

[2023-12-06 14:22:20] [DEBUG] Get msg to handle: {u'rs': 3, u'overallRC': 300, u'modID': 10, u'rc': 300, u'output': u'', u'errmsg': u"Failed to deploy image to userid: 'RFSD1010', unpackdiskimage failed with rc: 3, error: \nERROR: Target disk is too small for specified image, required:20032 cylinders, given:50000 cylinders"}

[2023-12-06 14:22:20] [INFO] The msg <{u'rs': 3, u'overallRC': 300, u'modID': 10, u'rc': 300, u'output': u'', u'errmsg': u"Failed to deploy image to userid: 'RFSD1010', unpackdiskimage failed with rc: 3, error: \nERROR: Target disk is too small for specified image, required:20032 cylinders, given:50000 cylinders"}> lead to return internal error

[2023-12-06 14:22:20] [INFO] 172.20.32.204 "POST /guests/rfsd1010/action" status: 500 length: 270 headers: [('Content-Length', '270'), ('Content-Type', 'application/json; charset=UTF-8'), ('cache-control', 'no-cache')] exc_info: None [2023-12-06 14:22:20] [DEBUG] [Thread-152] No more item in request queue, worker will exit now.

jichenjc commented 8 months ago

https://github.com/openmainframeproject/feilong/blob/master/zthin-parts/zthin/bin/unpackdiskimage#L604

this is the line and we fixed by following PR (to make it clear as original log is confusing) https://github.com/openmainframeproject/feilong/commit/cddc4f27763374518a3fefe3a86b95b497b95568

disk size (the 50000) which stored in old image header, so the deploy need bigger than this https://github.com/openmainframeproject/feilong/commit/cddc4f27763374518a3fefe3a86b95b497b95568#diff-b5cdc7b1e8bb044e9e22e6ab0cc0b8e86a82f64068668eba7a132c49f86f60b8R554

the deploy target (20032) in the DISK size (which is your disk to do deployment) https://github.com/openmainframeproject/feilong/commit/cddc4f27763374518a3fefe3a86b95b497b95568#diff-b5cdc7b1e8bb044e9e22e6ab0cc0b8e86a82f64068668eba7a132c49f86f60b8R556

since 20032 < 50000, the deploy failed

rsoaresbsb commented 8 months ago

it's the opposite, my dear, the new disk has 50000 cyls, the old gold image, has 20032 cyls.

just to be clear, the new gold image and the new guest , has both 50000 cyls..

jichenjc commented 8 months ago

@bjhuangr do you know any hard limit to 20032? I don't remember it's a max value

@rsoaresbsb from the log I think the target (the disk you created locally is 20032) and image is 50000

Target disk is too small for specified image, required:20032 cylinders, given:50000 cylinders"}

to verify, maybe you can give disk size = 0 during deployment , so it will use exactly same cylinders stored in the image file the other way is https://github.com/openmainframeproject/feilong/pull/647#issuecomment-1861624137, try to print the CYL stored in the image header and see what's there to verify

rsoaresbsb commented 8 months ago

@jichenjc you're absolulity right .. the disk 100 from guest rfsd1010 was really 20032 cyls.. I don't know when confusion begins but, very very sorry. My fault here. Thank you for your always quick response.

jichenjc commented 8 months ago

ok, no problem , let us know any further question