openvcloud / 0-templates

Apache License 2.0
1 stars 5 forks source link

The call for Schedule action "Get info" for a vm doesn't come back #125

Closed john-kheir closed 6 years ago

john-kheir commented 6 years ago

Scenario

1- Create account, vdc and node using dsl

from zerorobot.dsl import ZeroRobotAPI
api = ZeroRobotAPI.ZeroRobotAPI()
robot = api.robots['main']

# create services
ovc = robot.services.create(
    template_uid="github.com/openvcloud/0-templates/openvcloud/0.0.1",
    service_name="ovc_service",
    data={'name': 'ovc_instance',
          'location':'be-gen-demo', 
          'address': 'ovc.demo.greenitglobe.com',
          'token': '<iyo jwt token>'}
)
ovc.schedule_action('install')

account = robot.services.create(
    template_uid="github.com/openvcloud/0-templates/account/0.0.1",
    service_name="account-service",
    data={'name': 'account_name',
          'openvcloud':'ovc_service'}
)
account.schedule_action('install')

vdc = robot.services.create(
    template_uid="github.com/openvcloud/0-templates/vdc/0.0.1",
    service_name="vdc-service",
    data={'name': 'vdc_name' ,
          'account':'account-service'}
)
vdc.schedule_action('install')

sshkey = robot.services.create(
    template_uid="github.com/openvcloud/0-templates/sshkey/0.0.1",
    service_name="key-service",
    data={'name': 'id_rsa', 
          'dir':'/root/.ssh/', 
          'passphrase': 'testpassphrase'}
)
sshkey.schedule_action('install')

node = robot.services.create(template_uid="github.com/openvcloud/0-templates/node/0.0.1",
    service_name="mynode",
    data={'name': 'vm_name',
          'sshKey': 'key-service',
          'vdc':'vdc-service'}
)
node.schedule_action('install')

2- Try to make a call for scheduling an action "get _info"

node_info = node.schedule_action('get_info').wait(die=True).result

Actual result

This call won't come back (not even a timeout) although the vm has been created on the environment

Zrobot version

version: development branch commit 60a521780fd832299fef57d5fae403818d2c6447

katia-e commented 6 years ago

@john-kheir , example code is misleading here, so if you used underscore in the name of vm, the install actions might have failed and kept retrying, so the next action in the task list (get_info in this case) couldn't be executed, so wait action would hang.

However, since you mentioned that the VM was successfully created, I assume you dind't use underscores. For this scenarios I can't reproduce the error. I'm using the same example on code and I have node created and I can get_info with no problem.

If scenario reproduces, more exact log of cmd's would be helpful, as well as robot log.

john-kheir commented 6 years ago

Here is the server logs

Test case to reproduce such an error

https://github.com/openvcloud/0-templates/blob/master/tests/integration_tests/testsuite/ovc_tests/a_basic/vms_tests.py#L136

katia-e commented 6 years ago

@john-kheir , This looks like a bug in js9 that was there around yesterday. Please check that js9 is updated today.

john-kheir commented 6 years ago
katia-e commented 6 years ago

@john-kheir , please add node.state value

john-kheir commented 6 years ago
john-kheir commented 6 years ago

This ticket was related to a network problem. nothing wrong in the code