Uploaded image for project: 'XenServer Org'
  1. XenServer Org
  2. XSO-843

Auto-generate MAC address in VIF create produces stacktrace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: 7.3
    • Fix Version/s: None
    • Component/s: API
    • Labels:
      None
    • Environment:

      Python 2.7

      Mac OSX CLI

      Xen-API

      Description

      When Attempting to create a VIF object in Python, MAC address is a required field but the consensus is that leaving the parameter as empty "" should auto-generate a MAC address for the VIF object. Instead:

      Connection Successful!
      ('Choosing PIF with device: ', 'OpaqueRef:b15bf53d-44d6-9e45-2cc6-29741bf70211')
      Chosen PIF is connected to network: Bond 0+2
      Traceback (most recent call last):
      File "/usr/local/bin/bsdxenvmbuilder", line 9, in <module>
      load_entry_point('bsdxenvmbuilder==0.1', 'console_scripts', 'bsdxenvmbuilder')()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point
      return ep.load()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load
      return self.resolve()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve
      module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/Users/ryankahil/Xen-Builder/bsdxenbuilder.py", line 305, in <module>
      cli()
      File "/Library/Python/2.7/site-packages/click/core.py", line 722, in __call__
      return self.main(*args, **kwargs)
      File "/Library/Python/2.7/site-packages/click/core.py", line 697, in main
      rv = self.invoke(ctx)
      File "/Library/Python/2.7/site-packages/click/core.py", line 1066, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/Library/Python/2.7/site-packages/click/core.py", line 895, in invoke
      return ctx.invoke(self.callback, **ctx.params)
      File "/Library/Python/2.7/site-packages/click/core.py", line 535, in invoke
      return callback(*args, **kwargs)
      File "/Library/Python/2.7/site-packages/click/decorators.py", line 27, in new_func
      return f(get_current_context().obj, *args, **kwargs)
      File "/Users/ryankahil/Xen-Builder/bsdxenbuilder.py", line 302, in create_network
      vif_object = session.xenapi.VIF.create(vif)
      File "/Library/Python/2.7/site-packages/XenAPI.py", line 229, in __call__
      return self.__send(self.__name, args)
      File "/Library/Python/2.7/site-packages/XenAPI.py", line 133, in xenapi_request
      result = _parse_result(getattr(self, methodname)(*full_params))
      File "/Library/Python/2.7/site-packages/XenAPI.py", line 203, in _parse_result
      raise Failure(result['ErrorDescription'])
      XenAPI.Failure: ['MAC_INVALID', '']

      Here is a snippet of the code I am using to create the VIF object:

          vif = { 'device': str(deviceno),
              'network': network,
              'VM': vm,
              'MAC': "",
              'MTU': "1500",
              "qos_algorithm_type": "",
              "qos_algorithm_params": {},
               "other_config": {} }
      
          vif_object = session.xenapi.VIF.create(vif)
      

        Attachments

          Activity

            People

            Assignee:
            kc284 Konstantina Chremmou
            Reporter:
            rkahil Ryan Kahil
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: