mayadata-io / oep-e2e-konvoy

OEP KONVOY

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in Cluster Cleanup Stage

shiveshabhishek opened this issue · comments

Error in Cluster Cleanup Stage in the task for getting the VM id, Snapshot id and Reverting to Snapshot (related with permission):

TASK [Getting the VM id] *******************************************************
changed: [localhost] => (item=$master_name) => {"changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "delta": "0:00:06.575179", "end": "2020-03-17 05:41:16.853448", "item": "$master_name", "rc": 0, "start": "2020-03-17 05:41:10.278269", "stderr": "Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", "stderr_lines": ["Usage: grep [OPTION]... PATTERN [FILE]...", "Try 'grep --help' for more information.", "Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", "Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}
c

changed: [localhost] => (item={'_ansible_parsed': True, 'stderr_lines': [u'Usage: grep [OPTION]... PATTERN [FILE]...', u"Try 'grep --help' for more information.", u"Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", u'Permission denied (publickey,keyboard-interactive).'], '_ansible_item_result': True, u'end': u'2020-03-17 05:41:16.853448', '_ansible_no_log': False, u'stdout': u'', u'cmd': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'rc': 0, 'item': u'$master_name', u'delta': u'0:00:06.575179', '_ansible_item_label': u'$master_name', u'stderr': u"Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", u'changed': True, u'invocation': {u'module_args': {u'warn': True, u'executable': None, u'_uses_shell': True, u'_raw_params': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'removes': None, u'argv': None, u'creates': None, u'chdir': None, u'stdin': None}}, 'stdout_lines': [], u'start': u'2020-03-17 05:41:10.278269', '_ansible_ignore_errors': None, 'failed': False}) => {"changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/snapshot.get  | grep -A2 initial-setup | grep \"Snapshot Id\" | awk '{print $4}'", "delta": "0:00:06.692819", "end": "2020-03-17 05:41:58.593205", "item": {"changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "delta": "0:00:06.575179", "end": "2020-03-17 05:41:16.853448", "failed": false, "invocation": {"module_args": {"_raw_params": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "warn": true}}, "item": "$master_name", "rc": 0, "start": "2020-03-17 05:41:10.278269", "stderr": "Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", "stderr_lines": ["Usage: grep [OPTION]... PATTERN [FILE]...", "Try 'grep --help' for more information.", "Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", "Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}, "rc": 0, "start": "2020-03-17 05:41:51.900386", "stderr": "Permission denied (publickey,keyboard-interactive).", "stderr_lines": ["Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}

failed: [localhost] (item=[{'_ansible_parsed': True, 'stderr_lines': [u'Usage: grep [OPTION]... PATTERN [FILE]...', u"Try 'grep --help' for more information.", u"Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", u'Permission denied (publickey,keyboard-interactive).'], u'cmd': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'end': u'2020-03-17 05:41:16.853448', '_ansible_no_log': False, u'stdout': u'', 'failed': False, '_ansible_item_result': True, u'changed': True, 'item': u'$master_name', u'delta': u'0:00:06.575179', u'stderr': u"Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", u'rc': 0, u'invocation': {u'module_args': {u'creates': None, u'executable': None, u'_uses_shell': True, u'_raw_params': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'removes': None, u'argv': None, u'warn': True, u'chdir': None, u'stdin': None}}, 'stdout_lines': [], u'start': u'2020-03-17 05:41:10.278269', '_ansible_ignore_errors': None, '_ansible_item_label': u'$master_name'}, {'_ansible_parsed': True, 'stderr_lines': [u'Permission denied (publickey,keyboard-interactive).'], u'cmd': u'ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/snapshot.get  | grep -A2 initial-setup | grep "Snapshot Id" | awk \'{print $4}\'', u'end': u'2020-03-17 05:41:58.593205', '_ansible_no_log': False, u'stdout': u'', 'failed': False, '_ansible_item_result': True, u'changed': True, 'item': {'_ansible_parsed': True, 'stderr_lines': [u'Usage: grep [OPTION]... PATTERN [FILE]...', u"Try 'grep --help' for more information.", u"Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", u'Permission denied (publickey,keyboard-interactive).'], '_ansible_item_result': True, u'end': u'2020-03-17 05:41:16.853448', '_ansible_no_log': False, u'stdout': u'', 'failed': False, u'cmd': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'rc': 0, u'start': u'2020-03-17 05:41:10.278269', u'delta': u'0:00:06.575179', 'item': u'$master_name', u'changed': True, u'invocation': {u'module_args': {u'creates': None, u'executable': None, u'_uses_shell': True, u'_raw_params': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'removes': None, u'argv': None, u'warn': True, u'chdir': None, u'stdin': None}}, 'stdout_lines': [], u'stderr': u"Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", '_ansible_ignore_errors': None, '_ansible_item_label': u'$master_name'}, u'delta': u'0:00:06.692819', u'stderr': u'Permission denied (publickey,keyboard-interactive).', u'rc': 0, u'invocation': {u'module_args': {u'creates': None, u'executable': None, u'_uses_shell': True, u'_raw_params': u'ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/snapshot.get  | grep -A2 initial-setup | grep "Snapshot Id" | awk \'{print $4}\'', u'removes': None, u'argv': None, u'warn': True, u'chdir': None, u'stdin': None}}, 'stdout_lines': [], u'start': u'2020-03-17 05:41:51.900386', '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, 'stderr_lines': [u'Usage: grep [OPTION]... PATTERN [FILE]...', u"Try 'grep --help' for more information.", u"Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", u'Permission denied (publickey,keyboard-interactive).'], '_ansible_item_result': True, u'end': u'2020-03-17 05:41:16.853448', '_ansible_no_log': False, u'stdout': u'', 'item': u'$master_name', u'cmd': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'rc': 0, 'failed': False, u'delta': u'0:00:06.575179', u'stderr': u"Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", u'changed': True, u'invocation': {u'module_args': {u'warn': True, u'executable': None, u'_uses_shell': True, u'_raw_params': u"ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", u'removes': None, u'argv': None, u'creates': None, u'chdir': None, u'stdin': None}}, 'stdout_lines': [], u'start': u'2020-03-17 05:41:10.278269', '_ansible_ignore_errors': None, '_ansible_item_label': u'$master_name'}}]) => {"changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/snapshot.revert   supressPowerOff\n ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/power.on ", "delta": "0:00:12.289149", "end": "2020-03-17 05:42:44.460544", "item": [{"_ansible_ignore_errors": null, "_ansible_item_label": "$master_name", "_ansible_item_result": true, "_ansible_no_log": false, "_ansible_parsed": true, "changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "delta": "0:00:06.575179", "end": "2020-03-17 05:41:16.853448", "failed": false, "invocation": {"module_args": {"_raw_params": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "warn": true}}, "item": "$master_name", "rc": 0, "start": "2020-03-17 05:41:10.278269", "stderr": "Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", "stderr_lines": ["Usage: grep [OPTION]... PATTERN [FILE]...", "Try 'grep --help' for more information.", "Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", "Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}, {"_ansible_ignore_errors": null, "_ansible_item_label": {"_ansible_ignore_errors": null, "_ansible_item_label": "$master_name", "_ansible_item_result": true, "_ansible_no_log": false, "_ansible_parsed": true, "changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "delta": "0:00:06.575179", "end": "2020-03-17 05:41:16.853448", "failed": false, "invocation": {"module_args": {"_raw_params": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "warn": true}}, "item": "$master_name", "rc": 0, "start": "2020-03-17 05:41:10.278269", "stderr": "Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", "stderr_lines": ["Usage: grep [OPTION]... PATTERN [FILE]...", "Try 'grep --help' for more information.", "Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", "Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}, "_ansible_item_result": true, "_ansible_no_log": false, "_ansible_parsed": true, "changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/snapshot.get  | grep -A2 initial-setup | grep \"Snapshot Id\" | awk '{print $4}'", "delta": "0:00:06.692819", "end": "2020-03-17 05:41:58.593205", "failed": false, "invocation": {"module_args": {"_raw_params": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/snapshot.get  | grep -A2 initial-setup | grep \"Snapshot Id\" | awk '{print $4}'", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "warn": true}}, "item": {"_ansible_ignore_errors": null, "_ansible_item_label": "$master_name", "_ansible_item_result": true, "_ansible_no_log": false, "_ansible_parsed": true, "changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "delta": "0:00:06.575179", "end": "2020-03-17 05:41:16.853448", "failed": false, "invocation": {"module_args": {"_raw_params": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "_uses_shell": true, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "warn": true}}, "item": "$master_name", "rc": 0, "start": "2020-03-17 05:41:10.278269", "stderr": "Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.\nWarning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.\r\nPermission denied (publickey,keyboard-interactive).", "stderr_lines": ["Usage: grep [OPTION]... PATTERN [FILE]...", "Try 'grep --help' for more information.", "Warning: Permanently added '10.43.1.1' (RSA) to the list of known hosts.", "Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}, "rc": 0, "start": "2020-03-17 05:41:51.900386", "stderr": "Permission denied (publickey,keyboard-interactive).", "stderr_lines": ["Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}], "msg": "non-zero return code", "rc": 255, "start": "2020-03-17 05:42:32.171395", "stderr": "Permission denied (publickey,keyboard-interactive).\r\nPermission denied (publickey,keyboard-interactive).", "stderr_lines": ["Permission denied (publickey,keyboard-interactive).", "Permission denied (publickey,keyboard-interactive)."], "stdout": "", "stdout_lines": []}

Got the issue fixed. The path to authorized_keys file is defined in the file: /etc/ssh/sshd_config . This was different in the ESX machine from the default path(~/.ssh/authorized_keys).

New issue with variable or grep:

TASK [Getting the VM id] *******************************************************
changed: [localhost] => (item=$master_name) => {"changed": true, "cmd": "ssh -o StrictHostKeyChecking=no root@10.43.1.1 vim-cmd vmsvc/getallvms | grep $master_name | awk '{print $1}'", "delta": "0:00:00.856102", "end": "2020-03-20 01:56:54.920061", "item": "$master_name", "rc": 0, "start": "2020-03-20 01:56:54.063959", "stderr": "Usage: grep [OPTION]... PATTERN [FILE]...\nTry 'grep --help' for more information.", "stderr_lines": ["Usage: grep [OPTION]... PATTERN [FILE]...", "Try 'grep --help' for more information."], "stdout": "", "stdout_lines": []}

New issue with variable or grep:

Fixed.
This issue was because of the quotes in sed replace due to which replacement wasn't taking the variable value(10.43.x.x). Instead it was directly taking its name($master_name) while trying to grep.

Correct : sed -i -e "s/auto1/$master_name/g" \
Wrong: sed -i -e 's/auto1/$master_name/g' \