openvcloud / 0-templates

Apache License 2.0
1 stars 5 forks source link

Create a vdc throws an error while the vdc has been deployed in the env #59

Closed 0xIslamTaha closed 6 years ago

0xIslamTaha commented 6 years ago

Description Create a vdc throws an error while the vdc has been deployed in the env

Blueprint

services:
    - github.com/openvcloud/0-templates/openvcloud/0.0.1__myovc:
        location: be-g8-3
        address: 'be-g8-3.demo.greenitglobe.com'
        token: '*************************************************'
    - github.com/openvcloud/0-templates/account/0.0.1__adminDatas:
    - github.com/openvcloud/0-templates/vdc/0.0.1__myspace:
        openvcloud: myovc
        account: adminDatas
actions:
    - actions: ['install']

0-robot Logs

* Get OpenvCloud client on URL: be-g8-3.demo.greenitglobe.com
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
[Fri16 17:44] - base.py           :195 :service-936b7a19-2d22-47d3-b16d-7b96d05dcfc6 - ERROR    - error executing action install:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/zerorobot/task/task.py", line 79, in execute
    self._result = self.func()
  File "/opt/code/github/openvcloud/0-templates/templates/vdc/vdc.py", line 111, in install
    externalnetworkId=externalnetworkId
  File "/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Account.py", line 90, in space_get
    return self.space_get(name, location, False)
  File "/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Account.py", line 74, in space_get
    if space.model['name'] == name and space.model['location'] == location:
  File "/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Space.py", line 72, in model
    raise RuntimeError("timeout on getting space info from %s" % self)
RuntimeError: timeout on getting space info from space: myspace (1131)

The Env status image

katia-e commented 6 years ago

I have the same issue when calling account.space_get directly from js9 and using the parameters as in template. More detailed stack trace:

In [15]: space = acc.space_get(
    ...:              name='katiadevDeleteMe1',
    ...:              create=True,
    ...:              maxMemoryCapacity=-1,
    ...:              maxVDiskCapacity=-1,
    ...:              maxCPUCapacity=-1,
    ...:              maxNumPublicIP=-1,
    ...:              maxNetworkPeerTransfer=-1,
    ...:              externalnetworkId=None
    ...:     )
    ...:     
    ...: 
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
* Cloudspace is still deploying, checking again in 2 second
RuntimeError                              Traceback (most recent call last)
/usr/local/bin/js9 in <module>()
      7              maxNumPublicIP=-1,
      8              maxNetworkPeerTransfer=-1,
----> 9              externalnetworkId=None
     10     )
     11 

/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Account.py in space_get(self, name, location, create, maxMemoryCapacity, maxVDiskCapacity, maxCPUCapacity, maxNASCapacity, maxNetworkOptTransfer, maxNetworkPeerTransfer, maxNumPublicIP, externalnetworkId)
     88                                                             maxNumPublicIP=maxNumPublicIP,
     89                                                             externalnetworkId=externalnetworkId)
---> 90                 return self.space_get(name, location, False)
     91             else:
     92                 raise j.exceptions.RuntimeError(

/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Account.py in space_get(self, name, location, create, maxMemoryCapacity, maxVDiskCapacity, maxCPUCapacity, maxNASCapacity, maxNetworkOptTransfer, maxNetworkPeerTransfer, maxNumPublicIP, externalnetworkId)
     72             location = self.client.config.data["location"]
     73         for space in self.spaces:
---> 74             if space.model['name'] == name and space.model['location'] == location:
     75                 return space
     76         else:

/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Space.py in model(self)
     70 
     71         if j.data.time.epoch > timeout:
---> 72             raise RuntimeError("timeout on getting space info from %s" % self)
     73 
     74         return self._model

/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Space.py in __repr__(self)
    360 
    361     def __repr__(self):
--> 362         return "space: %s (%s)" % (self.model["name"], self.id)
    363 
    364     __str__ = __repr__

/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/openvcloud/Space.py in model(self)
     70 
     71         if j.data.time.epoch > timeout:
---> 72             raise RuntimeError("timeout on getting space info from %s" % self)
     73 
     74         return self._model

RuntimeError: timeout on getting space info from space: katiadevDeleteMe1 (315)
chrisvdg commented 6 years ago

If it's just because the timeout is too short, the timeout set here should be increased: https://github.com/Jumpscale/lib9/blob/e3bcaa96c3f177cca5db5a9dd83fc2299cfc62a2/JumpScale9Lib/clients/openvcloud/Space.py#L55

0xIslamTaha commented 6 years ago

@rkhamis is that possible to confirm this issue is related to js9?

rkhamis commented 6 years ago

timeout is currently at 20 seconds. Do you guys feel you need it to be longer?

0xIslamTaha commented 6 years ago

for me, creating a cs in slow env like be-g8-3 is taking more than 20 sec for sure.

rkhamis commented 6 years ago

alright. here you go https://github.com/Jumpscale/lib9/commit/6ddb02518dfebfe8b953b7ca2f335d47ec803ada

chrisvdg commented 6 years ago

@rkhamis still got it after some testing. Created 5 cloudspaces on be-g8-3 and they took from 47-66 to deploy successfully and had one timeout after 68 seconds (python timing doesn't seem very accurate?)

rkhamis commented 6 years ago

@chrisvdg not accurate at all from the looks of it... will put it on the TODO... would you prefer a longer timeout anyway?

chrisvdg commented 6 years ago

@rkhamis , I'd guess 100 would be fine, it's a timeout so I think it can be quite long

chrisvdg commented 6 years ago

@rkhamis, increased it myself, haven't had a timeout testing this with a successful deployment https://github.com/Jumpscale/lib9/commit/671c02f46826aaa48885583b930f1961dc7a7e85

@islamTaha12 can this be closed?