openvcloud / 0-templates

Apache License 2.0
1 stars 5 forks source link

Same account can't be created again on openvcloud. #44

Closed john-kheir closed 6 years ago

john-kheir commented 6 years ago

Scenario

1- Run a blueprint to create account and cloud space. 2- Delete the account from the environment manually 3- Run the same blueprint again

Actual Result

* Cloudspace still in deployment, will retry to create portforwarding in 2 second
^[[A^[[A^[[A^[[A^[[A^[[A* Get OpenvCloud client on URL: be-g8-3.demo.greenitglobe.com
* Get OpenvCloud client on URL: be-g8-3.demo.greenitglobe.com
[Sun11 09:20] - base.py           :210 :service-6d29bbf7-59eb-4c4e-a8c3-49cbc68a2287 - ERROR    - error executing action install:
Traceback (most recent call last):
  File "/root/0-robot/zerorobot/task/task.py", line 74, 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 89, in space_get
    externalnetworkId=externalnetworkId)
  File "/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/portal/PortalClient.py", line 56, in __call__
    raise ApiError(response)
JumpScale9Lib.clients.portal.PortalClient.ApiError: 404 Not Found
Account does not exist
chrisvdg commented 6 years ago

Can't reproduce this @john-kheir . Can you test again with up to date code?

john-kheir commented 6 years ago

@chrisvdg Now I don't have this error .. but still the account can't be created again after rerunning the blueprint and that's my main concern here in this ticket.

chrisvdg commented 6 years ago

@john-kheir, s far as I'm aware deleting an account should not be done outside of 0-robot as that would complicate and add a lot of checks to the templates. 0-robot should manage everything of the resources it creates, assigned to manage,...

katia-e commented 6 years ago

@john-kheir , 0-templates don't update changes on service data done to account bypassing zrobot. We assume account and other ovc objects are managed by a single zrobot only. If the contrary happens, the templates are used wrong.

john-kheir commented 6 years ago

According to @zaibon and @grimpy the current implementation is okay .. But that's assuming zero human interaction .