Closed hossnys closed 5 years ago
Verified on branch development note : you need to create you 3bot with months value greater than 1 month as the duration for any next reservations is 1 month which is calculated after 3bot creation and if you create 3bot with one month and tried to reserve you will get this error :
JSX> result = ww.capacity.reserve_zos_vm(email='hossnys@codescalers.com', threebot_id='ops-2', location='cairo_office', size=1, duration=1 )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainCapacity.py", line 206, in reserve_zos_vm
return self._process_reservation(reservation, threebot_id, source=source, refund=refund)
File "/sandbox/lib/jumpscale/Jumpscale/clients/blockchain/tfchain/TFChainCapacity.py", line 301, in _process_reservation
raise ValueError("Capacity expiration time exceeds threebot's expiration")
ValueError: Capacity expiration time exceeds threebot's expiration
@hossnys if you create them both on the same day it shouldn't be a problem, the check disregards hours and minutes.
I just created both 3bot and reserve vm in the same hour and i got the error of Capacity expiration time exceeds threebot's expiration !!
This shouldnt be the case :/ I already tested this scenario before. Let me test it again.
JSX> w.threebot.record_new(months=1, names=["bigggbot.hopefully"],addresses=["bigggbot.org"], key_index=2)
TransactionSendResult(transaction=transaction v144 41ddc7c09a8fb14de8d2c84d8892f497f81ecb75ee1b4d6ad22a3a484f876282, submitted=True)
JSX> w.capacity.reserve_zos_vm(email="boctor.sarah@gmail.com", threebot_id="bigggbot.hopefully", location="green edge cloud.austria.vienna 1", size=1, duration=1, organization="sarah")
TransactionSendResult(transaction=transaction v1 6834cb8aeb84430ecdc2a1b0e69ebb53afb535d46e8f54308d15f8d6de817c57, submitted=True)
verified :
JSX> result = ww.threebot.record_new(months=1, names=["devtest2"], adcresses=["example.org"], key_index=0)
JSX> result = ww.capacity.reserve_zos_vm(email='hossnys@codescalers.com', threebot_id='devtest2', location='freefarm', size=1, duration=1 )
Thu 11 10:27:22 BCDBMeta.py - 166 - bcdbmeta:bcdbmeta : schema set in BCDB:system meta:jumpscale.gedis.client (md5:'4c47b74e2101b80082d468c0ce37b507')
Thu 11 10:27:22 BCDBMeta.py - 175 - bcdbmeta:bcdbmeta : new schema in meta:
system: jumpscale.gedis.client:4c47b74e2101b80082d468c0ce37b507
Thu 11 10:27:22 BCDBMeta.py - 133 - bcdbmeta:bcdbmeta : save meta:system
Thu 11 10:27:22 BCDB.py - 409 - bcdb:bcdb : load model:jumpscale.gedis.client
Thu 11 10:27:22 BCDBMeta.py - 163 - bcdbmeta:bcdbmeta : schema set in BCDB:system meta:jumpscale.gedis.client (EXISTING)
Thu 11 10:27:22 GedisClient.py - 138 - j.clients.gedis:gedisclient : redisclient: notary.grid.tf:5000
Thu 11 10:27:36 GedisClient.py - 102 - j.clients.gedis:gedisclient : cmds for actor:notary_actor
JSX> result = ww.capacity.reserve_zos_vm(email='hossnys@codescalers.com', threebot_id='devtest2', location='freefarm', size=1, duration=1 )
JSX> result.transaction
transaction v1 e93731b8e5ed0eb18d9ec020011bfb1558a07240eb906f3637ac80996292abf0
JSX> result.submitted
True
it's appear that i wasn't on the latest update of JsX
JSX Branch development
Following documentation https://github.com/threefoldfoundation/info_grid/tree/development/docs/capacity_reservation
Error when reserving a zos vm: