openvcloud / 0-templates

Apache License 2.0
1 stars 5 forks source link

portforward_creation action for cloudspace doesn't work #80

Closed Dinaamagdy closed 6 years ago

Dinaamagdy commented 6 years ago

Steps

Blueprint

services:
  - github.com/openvcloud/0-templates/sshkey/0.0.1__5e0ce2bc:
       dir: '/root/.ssh/'
       passphrase: 'f7c0e848'
  - github.com/openvcloud/0-templates/openvcloud/0.0.1__650cee7e:
      address: 'be-g8-3.demo.greenitglobe.com'
      login: 'gig_qa_1@itsyouonline'
      token: 'eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJhenAiOiJ1Z3ZoYnI4dENtVUFrMHZLTC1KNTNOZnVLdERwIiwiZXhwIjoxNTIyMTYwNDc5LCJpc3MiOiJpdHN5b3VvbmxpbmUiLCJzY29wZSI6WyJ1c2VyOmFkbWluIl0sInVzZXJuYW1lIjoiZ2lnX3FhXzEifQ.tBDBYaEudsbcJCorJkfgHcTXhXLtsEkba2KbSo-J_Mo09bPyO81HrxFI9QltAwaW_fyMgCDz-k5Xn8WZbdpNq0O8nysY-RK_7jBhvp1wKMpR8yil9UtUW4rPKVUBPttV'
      location: 'be-g8-3'
  - github.com/openvcloud/0-templates/vdcuser/0.0.1__gig_qa_1:
      email: dina.magdy.mohammed+123@gmail.com
      provider: itsyouonline
      openvcloud: 650cee7e

  - github.com/openvcloud/0-templates/account/0.0.1__9b6a31d4:
      openvcloud: ec609c4c

  - github.com/openvcloud/0-templates/vdc/0.0.1__c8803faf:
      account: 9b6a31d4
      maxDiskCapacity: 557
      maxMemoryCapacity: 658
      maxCPUCapacity: 96
      users:
        - name: 21ffd7a1
          accesstype: CXDRAU
      maxNumPublicIP: 1000
      maxNetworkPeerTransfer: 881

actions:
  - template: github.com/openvcloud/0-templates/vdc/0.0.1
    actions: ['portforward_create']
    service: c8803faf
    args:
      port_forwards:
        - destination: 24788
          source: 22

Error

[Mon26 14:19] - pywsgi.py         :1146:j.zerorobot          - INFO     - ::ffff:127.0.0.1 - - [2018-03-26 14:19:51] "GET /servi
ces/31f76f88-41fa-478f-a717-7cd17fca56b9/task_list/bfc0315a-7b0b-44d9-b55a-c7c95d0c5a63 HTTP/1.1" 200 392 0.000759
[Mon26 14:19] - base.py           :195 :service-31f76f88-41fa-478f-a717-7cd17fca56b9 - ERROR    - error executing action portfor
ward_create:
Traceback (most recent call last):
  File "/root/0-robot/zerorobot/task/task.py", line 77, in execute
    self._result = self.func(**self._args)
  File "/opt/code/github/openvcloud/0-templates/templates/vdc/vdc.py", line 220, in portforward_create
    machineId=machineId,
  File "/opt/code/github/jumpscale/lib9/JumpScale9Lib/clients/portal/PortalClient.py", line 57, in __call__
    raise ApiError(response)
JumpScale9Lib.clients.portal.PortalClient.ApiError: 400 Bad Request
Param with name:machineId is missing.
katia-e commented 6 years ago

@Dinaamagdy , as I understand it, we create port forwards for existing VMs, so yes, machineID should be given. There was a mistake in the examples in the doc (machineId is missing in args), I'll fix it. Since typically you don't know machineID, it is better to create port forwards with actions on node template level https://github.com/openvcloud/0-templates/tree/master/templates/node.