sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
201 stars 727 forks source link

start-vms keeps failing with "The conditional check 'topo == \"cable-test\"' failed. #4502

Open aurghob opened 3 years ago

aurghob commented 3 years ago

start-vms keeps failing with "The conditional check 'topo == \"cable-test\"' failed.

On trying run "./testbed-cli.sh -m veos_vtb -n 4 -k vsonic start-vms server_1 password.txt", after pulling in the latest changes, I keep coming across the error:

TASK [vm_set : VMs not needed for cable test] *******************************************************************************************************************************************
Friday 15 October 2021  23:17:37 +0000 (0:00:00.058)       0:00:36.440 ********
fatal: [STR-ACS-VSERV-01]: FAILED! => {"msg": "The conditional check 'topo == \"cable-test\"' failed. The error was: error while evaluating conditional (topo == \"cable-test\"): 'topo' is undefined\n\nThe error appears to be in '/data/sonic-mgmt/ansible/roles/vm_set/tasks/main.yml': line 209, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: VMs not needed for cable test\n  ^ here\n"}

Steps to reproduce the issue:

  1. Get latest code as of 10/15/2021 from github for sonic-mgmt
  2. Download sonic for neighbors, follow setup for latest sonic vm and setup docker
  3. try running start-vms

Describe the results you received: I keep receiving the above error. I tried hard resetting before the "cable-test" repo from a few days ago but that gives me a different error of device not linked during add-topo.

Describe the results you expected: Expected to run successfully. I keep running into the cable test error. However, Expectation is that I can move ahead to the add-topo step.

Additional information you deem important: Failing at start-vms so can't run show version. Perhaps I'm doing something wrong?

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```
Pterosaur commented 3 years ago

I tried the latest sonic-mgmt repo with veos neighbor and still got the same error. I looks like a common issue caused by cable-test. @vdahiya12 Could you help to check it? My command is : ./testbed-cli.sh -m veos_vtb -n 4 -k veos start-vms server_1 password.txt

DhabeRushabh commented 3 years ago

I'm facing the Similar issue, Please help if you have solved this issue

when I execute command (i.e. while trying to start the VMs): _./testbed-cli.sh -m veos_vtb -n 4 start-vms server1 password.txt

Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -m veos_vtb -n 4 start-vms server_1 password.txt
Starting VMs on server 'server_1'
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [vm_set : Set the default variable package_installation] ************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.118)       0:00:00.118 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution] ************************************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.045)       0:00:00.163 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution version] ****************************************************************************************
Tuesday 26 October 2021  07:36:18 +0000 (0:00:00.920)       0:00:01.083 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host kernel version] **********************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.374)       0:00:01.458 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : Check if kernel upgrade needed] ***************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.380)       0:00:01.839 *******
skipping: [STR-ACS-VSERV-01]

.
.
.
.
.

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.023)       0:00:20.162 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.026)       0:00:20.189 *******
fatal: [STR-ACS-VSERV-01]: FAILED! => {"msg": "The conditional check 'topo == \"cable-test\"' failed. The error was: error while evaluating conditional (topo == \"cable-test\"): 'topo' is undefined\n\nThe error appears to be in '/data/sonic-mgmt/ansible/roles/vm_set/tasks/main.yml': line 209, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: VMs not needed for cable test\n  ^ here\n"}

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
.
.
.
.
vm_set : Set the default variable package_installation  ------- 0.05s
----------------------------------------------------------------------------------------------------------------------------------------

whereas when I execute (i.e. while trying to Deploy T0 topology): _./testbed-cli.sh -t vtestbed.csv -m veosvtb add-topo vms-kvm-t0 password.txt

Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -t vtestbed.csv -m veos_vtb add-topo vms-kvm-t0 password.txt
Deploying topology for testbed 'vms-kvm-t0'
reading
Found testbed vms-kvm-t0
[vlab-01] vlab-01
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [Check for a single host] *******************************************************************************************************
Tuesday 26 October 2021  07:26:53 +0000 (0:00:00.137)       0:00:00.137 *******
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ play_hosts|length
}} != 1

.
.
.
.
.
.
.
TASK [vm_set : veos or SONiC VMs not needed when setting up Kubernetes master] *******************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.031)       0:00:22.179 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight API Server] ************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.034)       0:00:22.214 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.040)       0:00:22.255 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.042)       0:00:22.298 *******
skipping: [STR-ACS-VSERV-01]

**TASK [vm_set : Retrieve a list of the defined VMs] ***********************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.033)       0:00:22.332 *******
**fatal: [STR-ACS-VSERV-01]: FAILED! => {"changed": false, "msg": "The `libvirt` module is not importable. Check the requirements."}****

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
vm_set : Install python packages ---------------------------------------------------------------------------------------------- 2.28s
vm_set : Add docker official GPG key ------------------------------------------------------------------------------------------ 1.82s
vm_set : remove old python packages ------------------------------------------------------------------------------------------- 1.67s
vm_set : Install necessary packages ------------------------------------------------------------------------------------------- 1.65s
vm_set : Set sysctl bridge parameters for testbed ----------------------------------------------------------------------------- 1.23s
vm_set : apt ------------------------------------------------------------------------------------------------------------------ 1.17s
vm_set : get host distribution ------------------------------------------------------------------------------------------------ 0.92s
vm_set : Add docker repository for 18.04 -------------------------------------------------------------------------------------- 0.82s
vm_set : Ensure rushabh 
in docker,sudo group --------------------------------------------------------------------------------- 0.71s
vm_set : getent --------------------------------------------------------------------------------------------------------------- 0.64s
vm_set : Check docker repository ---------------------------------------------------------------------------------------------- 0.63s
vm_set : Install br_netfilter kernel module ----------------------------------------------------------------------------------- 0.54s
vm_set : Set sysctl RCVBUF default parameter for testbed ---------------------------------------------------------------------- 0.40s
vm_set : Set sysctl RCVBUF max parameter for testbed -------------------------------------------------------------------------- 0.39s
vm_set : get host kernel version ---------------------------------------------------------------------------------------------- 0.38s
vm_set : get host distribution version ---------------------------------------------------------------------------------------- 0.37s
vm_set : include_tasks -------------------------------------------------------------------------------------------------------- 0.06s
vm_set : Upgrade kernel package ----------------------------------------------------------------------------------------------- 0.05s
vm_set : Set the default variable package_installation ------------------------------------------------------------------------ 0.05s
Pterosaur commented 3 years ago

I'm facing the Similar issue, Please help if you have solved this issue

when I execute command (i.e. while trying to start the VMs): _./testbed-cli.sh -m veos_vtb -n 4 start-vms server1 password.txt

Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -m veos_vtb -n 4 start-vms server_1 password.txt
Starting VMs on server 'server_1'
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [vm_set : Set the default variable package_installation] ************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.118)       0:00:00.118 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution] ************************************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.045)       0:00:00.163 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution version] ****************************************************************************************
Tuesday 26 October 2021  07:36:18 +0000 (0:00:00.920)       0:00:01.083 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host kernel version] **********************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.374)       0:00:01.458 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : Check if kernel upgrade needed] ***************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.380)       0:00:01.839 *******
skipping: [STR-ACS-VSERV-01]

.
.
.
.
.

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.023)       0:00:20.162 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.026)       0:00:20.189 *******
fatal: [STR-ACS-VSERV-01]: FAILED! => {"msg": "The conditional check 'topo == \"cable-test\"' failed. The error was: error while evaluating conditional (topo == \"cable-test\"): 'topo' is undefined\n\nThe error appears to be in '/data/sonic-mgmt/ansible/roles/vm_set/tasks/main.yml': line 209, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: VMs not needed for cable test\n  ^ here\n"}

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
.
.
.
.
vm_set : Set the default variable package_installation  ------- 0.05s
----------------------------------------------------------------------------------------------------------------------------------------

whereas when I execute (i.e. while trying to Deploy T0 topology): _./testbed-cli.sh -t vtestbed.csv -m veosvtb add-topo vms-kvm-t0 password.txt

Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -t vtestbed.csv -m veos_vtb add-topo vms-kvm-t0 password.txt
Deploying topology for testbed 'vms-kvm-t0'
reading
Found testbed vms-kvm-t0
[vlab-01] vlab-01
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [Check for a single host] *******************************************************************************************************
Tuesday 26 October 2021  07:26:53 +0000 (0:00:00.137)       0:00:00.137 *******
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ play_hosts|length
}} != 1

.
.
.
.
.
.
.
TASK [vm_set : veos or SONiC VMs not needed when setting up Kubernetes master] *******************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.031)       0:00:22.179 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight API Server] ************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.034)       0:00:22.214 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.040)       0:00:22.255 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.042)       0:00:22.298 *******
skipping: [STR-ACS-VSERV-01]

**TASK [vm_set : Retrieve a list of the defined VMs] ***********************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.033)       0:00:22.332 *******
**fatal: [STR-ACS-VSERV-01]: FAILED! => {"changed": false, "msg": "The `libvirt` module is not importable. Check the requirements."}****

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
vm_set : Install python packages ---------------------------------------------------------------------------------------------- 2.28s
vm_set : Add docker official GPG key ------------------------------------------------------------------------------------------ 1.82s
vm_set : remove old python packages ------------------------------------------------------------------------------------------- 1.67s
vm_set : Install necessary packages ------------------------------------------------------------------------------------------- 1.65s
vm_set : Set sysctl bridge parameters for testbed ----------------------------------------------------------------------------- 1.23s
vm_set : apt ------------------------------------------------------------------------------------------------------------------ 1.17s
vm_set : get host distribution ------------------------------------------------------------------------------------------------ 0.92s
vm_set : Add docker repository for 18.04 -------------------------------------------------------------------------------------- 0.82s
vm_set : Ensure rushabh 
in docker,sudo group --------------------------------------------------------------------------------- 0.71s
vm_set : getent --------------------------------------------------------------------------------------------------------------- 0.64s
vm_set : Check docker repository ---------------------------------------------------------------------------------------------- 0.63s
vm_set : Install br_netfilter kernel module ----------------------------------------------------------------------------------- 0.54s
vm_set : Set sysctl RCVBUF default parameter for testbed ---------------------------------------------------------------------- 0.40s
vm_set : Set sysctl RCVBUF max parameter for testbed -------------------------------------------------------------------------- 0.39s
vm_set : get host kernel version ---------------------------------------------------------------------------------------------- 0.38s
vm_set : get host distribution version ---------------------------------------------------------------------------------------- 0.37s
vm_set : include_tasks -------------------------------------------------------------------------------------------------------- 0.06s
vm_set : Upgrade kernel package ----------------------------------------------------------------------------------------------- 0.05s
vm_set : Set the default variable package_installation ------------------------------------------------------------------------ 0.05s

To the first error, I have a shortcut fix by delete following lines: https://github.com/Azure/sonic-mgmt/blob/001c934747e12b101d1021c507c90f6d8cc85bb5/ansible/roles/vm_set/tasks/main.yml#L209-L214

To the second one, I didn't get it in my environment. Please check your libivrt is sound.

DhabeRushabh commented 3 years ago

Hi, @Pterosaur Thank you for the reply, the first issue got resolved using the shortcut :)

AspenBen commented 2 years ago

I'm facing the Similar issue, Please help if you have solved this issue

when I execute command (i.e. while trying to start the VMs): _./testbed-cli.sh -m veos_vtb -n 4 start-vms server1 password.txt

Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -m veos_vtb -n 4 start-vms server_1 password.txt
Starting VMs on server 'server_1'
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [vm_set : Set the default variable package_installation] ************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.118)       0:00:00.118 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution] ************************************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.045)       0:00:00.163 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution version] ****************************************************************************************
Tuesday 26 October 2021  07:36:18 +0000 (0:00:00.920)       0:00:01.083 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host kernel version] **********************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.374)       0:00:01.458 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : Check if kernel upgrade needed] ***************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.380)       0:00:01.839 *******
skipping: [STR-ACS-VSERV-01]

.
.
.
.
.

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.023)       0:00:20.162 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.026)       0:00:20.189 *******
fatal: [STR-ACS-VSERV-01]: FAILED! => {"msg": "The conditional check 'topo == \"cable-test\"' failed. The error was: error while evaluating conditional (topo == \"cable-test\"): 'topo' is undefined\n\nThe error appears to be in '/data/sonic-mgmt/ansible/roles/vm_set/tasks/main.yml': line 209, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: VMs not needed for cable test\n  ^ here\n"}

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
.
.
.
.
vm_set : Set the default variable package_installation  ------- 0.05s
----------------------------------------------------------------------------------------------------------------------------------------

whereas when I execute (i.e. while trying to Deploy T0 topology): _./testbed-cli.sh -t vtestbed.csv -m veosvtb add-topo vms-kvm-t0 password.txt

Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -t vtestbed.csv -m veos_vtb add-topo vms-kvm-t0 password.txt
Deploying topology for testbed 'vms-kvm-t0'
reading
Found testbed vms-kvm-t0
[vlab-01] vlab-01
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [Check for a single host] *******************************************************************************************************
Tuesday 26 October 2021  07:26:53 +0000 (0:00:00.137)       0:00:00.137 *******
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ play_hosts|length
}} != 1

.
.
.
.
.
.
.
TASK [vm_set : veos or SONiC VMs not needed when setting up Kubernetes master] *******************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.031)       0:00:22.179 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight API Server] ************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.034)       0:00:22.214 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.040)       0:00:22.255 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.042)       0:00:22.298 *******
skipping: [STR-ACS-VSERV-01]

**TASK [vm_set : Retrieve a list of the defined VMs] ***********************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.033)       0:00:22.332 *******
**fatal: [STR-ACS-VSERV-01]: FAILED! => {"changed": false, "msg": "The `libvirt` module is not importable. Check the requirements."}****

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
vm_set : Install python packages ---------------------------------------------------------------------------------------------- 2.28s
vm_set : Add docker official GPG key ------------------------------------------------------------------------------------------ 1.82s
vm_set : remove old python packages ------------------------------------------------------------------------------------------- 1.67s
vm_set : Install necessary packages ------------------------------------------------------------------------------------------- 1.65s
vm_set : Set sysctl bridge parameters for testbed ----------------------------------------------------------------------------- 1.23s
vm_set : apt ------------------------------------------------------------------------------------------------------------------ 1.17s
vm_set : get host distribution ------------------------------------------------------------------------------------------------ 0.92s
vm_set : Add docker repository for 18.04 -------------------------------------------------------------------------------------- 0.82s
vm_set : Ensure rushabh 
in docker,sudo group --------------------------------------------------------------------------------- 0.71s
vm_set : getent --------------------------------------------------------------------------------------------------------------- 0.64s
vm_set : Check docker repository ---------------------------------------------------------------------------------------------- 0.63s
vm_set : Install br_netfilter kernel module ----------------------------------------------------------------------------------- 0.54s
vm_set : Set sysctl RCVBUF default parameter for testbed ---------------------------------------------------------------------- 0.40s
vm_set : Set sysctl RCVBUF max parameter for testbed -------------------------------------------------------------------------- 0.39s
vm_set : get host kernel version ---------------------------------------------------------------------------------------------- 0.38s
vm_set : get host distribution version ---------------------------------------------------------------------------------------- 0.37s
vm_set : include_tasks -------------------------------------------------------------------------------------------------------- 0.06s
vm_set : Upgrade kernel package ----------------------------------------------------------------------------------------------- 0.05s
vm_set : Set the default variable package_installation ------------------------------------------------------------------------ 0.05s

I also occur the error which is same with ur second problem ('libvirt module is not importable'), did u fix it? Look for ur reply!

And I think it maybe relate to python version, it looks like 'libvirt' is only supported by python3, my python version is python2 now. So, can u tell me what's ur python version, and is python2 suitable for testbed now? Look for ur reply!!!

AspenBen commented 2 years ago

I'm facing the Similar issue, Please help if you have solved this issue when I execute command (i.e. while trying to start the VMs): _./testbed-cli.sh -m veos_vtb -n 4 start-vms server1 password.txt Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -m veos_vtb -n 4 start-vms server_1 password.txt
Starting VMs on server 'server_1'
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [vm_set : Set the default variable package_installation] ************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.118)       0:00:00.118 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution] ************************************************************************************************
Tuesday 26 October 2021  07:36:17 +0000 (0:00:00.045)       0:00:00.163 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host distribution version] ****************************************************************************************
Tuesday 26 October 2021  07:36:18 +0000 (0:00:00.920)       0:00:01.083 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : get host kernel version] **********************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.374)       0:00:01.458 *******
ok: [STR-ACS-VSERV-01]

TASK [vm_set : Check if kernel upgrade needed] ***************************************************************************************
Tuesday 26 October 2021  07:36:19 +0000 (0:00:00.380)       0:00:01.839 *******
skipping: [STR-ACS-VSERV-01]

.
.
.
.
.

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.023)       0:00:20.162 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.026)       0:00:20.189 *******
fatal: [STR-ACS-VSERV-01]: FAILED! => {"msg": "The conditional check 'topo == \"cable-test\"' failed. The error was: error while evaluating conditional (topo == \"cable-test\"): 'topo' is undefined\n\nThe error appears to be in '/data/sonic-mgmt/ansible/roles/vm_set/tasks/main.yml': line 209, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: VMs not needed for cable test\n  ^ here\n"}

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
.
.
.
.
vm_set : Set the default variable package_installation  ------- 0.05s
----------------------------------------------------------------------------------------------------------------------------------------

whereas when I execute (i.e. while trying to Deploy T0 topology): _./testbed-cli.sh -t vtestbed.csv -m veosvtb add-topo vms-kvm-t0 password.txt Error:

rushabh@af15c09bedc0:/data/sonic-mgmt/ansible$ ./testbed-cli.sh -t vtestbed.csv -m veos_vtb add-topo vms-kvm-t0 password.txt
Deploying topology for testbed 'vms-kvm-t0'
reading
Found testbed vms-kvm-t0
[vlab-01] vlab-01
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature

PLAY [servers:&vm_host] **************************************************************************************************************

TASK [Check for a single host] *******************************************************************************************************
Tuesday 26 October 2021  07:26:53 +0000 (0:00:00.137)       0:00:00.137 *******
[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ play_hosts|length
}} != 1

.
.
.
.
.
.
.
TASK [vm_set : veos or SONiC VMs not needed when setting up Kubernetes master] *******************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.031)       0:00:22.179 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight API Server] ************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.034)       0:00:22.214 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed in case of Keysight IxANVL] ****************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.040)       0:00:22.255 *******
skipping: [STR-ACS-VSERV-01]

TASK [vm_set : VMs not needed for cable test] ****************************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.042)       0:00:22.298 *******
skipping: [STR-ACS-VSERV-01]

**TASK [vm_set : Retrieve a list of the defined VMs] ***********************************************************************************
Tuesday 26 October 2021  07:27:15 +0000 (0:00:00.033)       0:00:22.332 *******
**fatal: [STR-ACS-VSERV-01]: FAILED! => {"changed": false, "msg": "The `libvirt` module is not importable. Check the requirements."}****

PLAY RECAP ***************************************************************************************************************************
STR-ACS-VSERV-01           : ok=25   changed=1    unreachable=0    failed=1    skipped=16   rescued=0    ignored=0

Tuesday 26 October 2021  07:36:37 +0000 (0:00:00.021)       0:00:20.210 *******
===============================================================================
vm_set : Install docker-ce ---------------------------------------------------------------------------------------------------- 3.56s
vm_set : Install python packages ---------------------------------------------------------------------------------------------- 2.28s
vm_set : Add docker official GPG key ------------------------------------------------------------------------------------------ 1.82s
vm_set : remove old python packages ------------------------------------------------------------------------------------------- 1.67s
vm_set : Install necessary packages ------------------------------------------------------------------------------------------- 1.65s
vm_set : Set sysctl bridge parameters for testbed ----------------------------------------------------------------------------- 1.23s
vm_set : apt ------------------------------------------------------------------------------------------------------------------ 1.17s
vm_set : get host distribution ------------------------------------------------------------------------------------------------ 0.92s
vm_set : Add docker repository for 18.04 -------------------------------------------------------------------------------------- 0.82s
vm_set : Ensure rushabh 
in docker,sudo group --------------------------------------------------------------------------------- 0.71s
vm_set : getent --------------------------------------------------------------------------------------------------------------- 0.64s
vm_set : Check docker repository ---------------------------------------------------------------------------------------------- 0.63s
vm_set : Install br_netfilter kernel module ----------------------------------------------------------------------------------- 0.54s
vm_set : Set sysctl RCVBUF default parameter for testbed ---------------------------------------------------------------------- 0.40s
vm_set : Set sysctl RCVBUF max parameter for testbed -------------------------------------------------------------------------- 0.39s
vm_set : get host kernel version ---------------------------------------------------------------------------------------------- 0.38s
vm_set : get host distribution version ---------------------------------------------------------------------------------------- 0.37s
vm_set : include_tasks -------------------------------------------------------------------------------------------------------- 0.06s
vm_set : Upgrade kernel package ----------------------------------------------------------------------------------------------- 0.05s
vm_set : Set the default variable package_installation ------------------------------------------------------------------------ 0.05s

I also occur the error which is same with ur second problem ('libvirt module is not importable'), did u fix it? Look for ur reply!

And I think it maybe relate to python version, it looks like 'libvirt' is only supported by python3, my python version is python2 now. So, can u tell me what's ur python version, and is python2 suitable for testbed now? Look for ur reply!!!

I find more info about the error, it occurs when execute 'virt' in playbook. And 'virt' module require "python >= 2.6" & "libvirt-python", the both have been already satisfied! So I have no idea why it happened. image image

AspenBen commented 2 years ago

I resolved the problem today, maybe it can provide some reference for u.

My testbed used python2 when execute 'start-vms', I find it call 'libvirt' module package from testbed server rather than 'sonic-mgmt docker' inside. So I install the 'libvirt' in my testbed server by 'apt-get install python-libvirt'. I didn't use 'pip2 install' because 'libvirt' only is supported by pip3.

And please make sure the postion of package is '/usr/lib/python2.7/dist-packages/' in server.