v2t:STEP #4 -Translate imported configuration - "failed Config translation failed [Reason: PortMirroringProfile failed with 'argument of type 'NoneType' is not iterable']" error
search cancel

v2t:STEP #4 -Translate imported configuration - "failed Config translation failed [Reason: PortMirroringProfile failed with 'argument of type 'NoneType' is not iterable']" error

book

Article ID: 316665

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • On Phase 1 STEP #4 --Translate imported configuration, an error prompts : 

Config translation failed [Reason: PortMirroringProfile failed with 'argument of type 'NoneType' is not iterable']




  • In the var/log/migration-coordinator/migration-coordinator.log , below entries can be seen:

    2021-04-06T20:50:58.945Z INFO task-executor-0-workitem-PRECHECK-ConfigTranslator UpgradeServiceImpl 15343 SYSTEM [nsx@6876 comp="nsx-manager" level="INFO" subcomp="upgrade-coordinator"] Component type = PRECHECK , Upgrade Status = FAILED, Progress Percentage = 75 , Progress Message = Config collection initiated...
    Collecting VC config
    Config collection initiated...
    Collecting config
    Config translation initiated...
    Translating config
    Config translation failed [Reason: PortMirroringProfile failed with 'argument of type 'NoneType' is not iterable']


  • In the /var/log/migration-coordinator/v2t/translation.log 

    {'category': 'Unexpected error', 'error': "PortMirroringProfile failed with 'argument of type 'NoneType' is not iterable'"}
    Traceback (most recent call last):
     File "main.py", line 158, in <module>
      main(sys.argv)
     File "main.py", line 127, in main
      xlate_engine.xlate()
     File "/opt/vmware/migration-coordinator-tomcat/bin/v2t/config-migrator/engine/xlate_engine.py", line 29, in wrapper
      return function(*args, **kwargs)
     File "/opt/vmware/migration-coordinator-tomcat/bin/v2t/config-migrator/engine/xlate_engine.py", line 539, in xlate
      feedback_requests_count=feedback_requests_count)
     File "/opt/vmware/migration-coordinator-tomcat/bin/v2t/config-migrator/engine/xlate_engine.py", line 268, in _finalize_stage
      raise exception
     File "/opt/vmware/migration-coordinator-tomcat/bin/v2t/config-migrator/engine/xlate_engine.py", line 490, in xlate
      apis = plugin.xlate()
     File "/opt/vmware/migration-coordinator-tomcat/bin/v2t/config-migrator/plugins/port_mirror_plugin.py", line 246, in xlate
      port_mirroring_apis = self.generate_port_mirroring_apis(dvs_list)
     File "/opt/vmware/migration-coordinator-tomcat/bin/v2t/config-migrator/plugins/port_mirror_plugin.py", line 188, in generate_port_mirroring_apis
      if "erspan2" in config['encapType']:
    TypeError: argument of type 'NoneType' is not iterable


    Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.

Environment

VMware NSX-T Data Center
VMware NSX-T Data Center 3.x

Cause

Encapsulated remote Mirroring Source (L3) is supported as per : Detailed Feature Support for Migration Coordinator


PortMirroring may be  configured on the DVS: 

Example



DVS PortMirroring  session  get's imported  to NSX-T but  it did with  encapType":null

You may check  /var/log/migration-coordinator/v2t/nsxv-config/dvses.json

   
 "vspanSession":[
                    {
                        "description":null,
                        "destinationPort":{
                            "dynamicProperty":[],
                            "dynamicType":null,
                            "ipAddress":[
                                "#.#.#.#",
                                "#.#.#.#"
                            ],
                            "portKey":[],
                            "uplinkPortName":[],
                            "vlans":[],
                            "wildcardPortConnecteeType":[]
                        },
                        "enabled":true,
                        "encapType":null,  <------------------------Causes exception


Resolution


Workaround:
Update Line 187 from [port_mirror_plugin.py]python script:

Location 
/opt/vmware/migration-coordinator-tomcat/bin/v2t/config-migrator/plugins/port_mirror_plugin.py

From :
 if 'encapType' in config:
To:
 if 'encapType' in config and config['encapType']:

NOTE : Make sure the indentation before the "if" is preserved, and is using spaces rather than tab.


Once done ; ROLLBACK and retry the  v2T: Phase 1 --Import Configuration