1. Error when creating a slice

Error when creating a slice

Home Forums FABRIC General Questions and Discussion Error when creating a slice

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8740
    Garegin Grigoryan
    Participant

      Hello,

      Before the updates to the testbed, this code worked:

      slice_name = 'test' # create slize
      slice = fablib.new_slice(name=slice_name)
      
      vm_names = ['p4switch', 'master']
      for vm_name in vm_names:
          node = slice.add_node(name=vm_name, site='RUTG', image='default_ubuntu_20')
          node.set_capacities(cores=2, ram=6, disk=10)
          node.add_component(model='NIC_Basic', name='if1')
      
      p4_node = slice.get_node('p4switch')
      for i in range(2, 13):
            p4_node.add_component(model='NIC_Basic', name=f'if{i}')
      
      bridges = {}
      bridges['ms'] = slice.add_l2network(name=br)
      bridges['ms'].add_interface(p4_node.get_interface('p4switch-if1-p1'))

      Now it fails with an error:

      Exception: Interface not found: p4switch-if1-p1
      

      The error is fixed by replacing variable p4_node with slice.get_node(‘p4switch’) at the last line (basically, re-fetching the node). Why would I get the error without this change? Thank you.

      #8745
      Komal Thareja
      Participant

        Hi Garegin,

        Thank you for sharing your observation. There was performance fix to improve how the interfaces are handled in the fablib. I suspect this may have introduced this issue. I will investigate this and post a fix once ready.

        For now, please use the workaround as you suggested. Apologies for the inconvenience.

        Thanks,

        Komal

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.