← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1370767] [NEW] Update driver metadata definitions to Juno

 

Public bug reported:

vmware and libvirt support different hw_vif_model settings.  This patch
updates them so that each namespace can specify the models they support.

vmware api is updated with the vmware_disktype


See below for references to source code.

vmware:

hw_vif_model:
From: https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vm_util.py

ALL_SUPPORTED_NETWORK_DEVICES = ['VirtualE1000', 'VirtualE1000e',
                                 'VirtualPCNet32', 'VirtualSriovEthernetCard',
                                 'VirtualVmxnet']

And:

def convert_vif_model(name):
    """Converts standard VIF_MODEL types to the internal VMware ones."""
    if name == network_model.VIF_MODEL_E1000:
        return 'VirtualE1000'
    if name == network_model.VIF_MODEL_E1000E:
        return 'VirtualE1000e'
    if name not in ALL_SUPPORTED_NETWORK_DEVICES:
        msg = _('%s is not supported.') % name
        raise exception.Invalid(msg)
    return name

vmware disktype:

https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/constants.py

DISK_TYPE_SPARSE = 'sparse'
SUPPORTED_FLAT_VARIANTS = ["thin", "preallocated", "thick", "eagerZeroedThick"]


libvirt:
From:  https://github.com/openstack/nova/blob/master/nova/virt/libvirt/vif.py

def is_vif_model_valid_for_virt(virt_type, vif_model):
    valid_models = {
        'qemu': [network_model.VIF_MODEL_VIRTIO,
                 network_model.VIF_MODEL_NE2K_PCI,
                 network_model.VIF_MODEL_PCNET,
                 network_model.VIF_MODEL_RTL8139,
                 network_model.VIF_MODEL_E1000,
                 network_model.VIF_MODEL_SPAPR_VLAN],
        'kvm': [network_model.VIF_MODEL_VIRTIO,
                network_model.VIF_MODEL_NE2K_PCI,
                network_model.VIF_MODEL_PCNET,
                network_model.VIF_MODEL_RTL8139,
                network_model.VIF_MODEL_E1000,
                network_model.VIF_MODEL_SPAPR_VLAN],
        'xen': [network_model.VIF_MODEL_NETFRONT,
                network_model.VIF_MODEL_NE2K_PCI,
                network_model.VIF_MODEL_PCNET,
                network_model.VIF_MODEL_RTL8139,
                network_model.VIF_MODEL_E1000],
        'lxc': [],
        'uml': [],
        }


From:  https://github.com/openstack/nova/blob/master/nova/network/model.py

VIF_MODEL_VIRTIO = 'virtio'
VIF_MODEL_NE2K_PCI = 'ne2k_pci'
VIF_MODEL_PCNET = 'pcnet'
VIF_MODEL_RTL8139 = 'rtl8139'
VIF_MODEL_E1000 = 'e1000'
VIF_MODEL_E1000E = 'e1000e'
VIF_MODEL_NETFRONT = 'netfront'
VIF_MODEL_SPAPR_VLAN = 'spapr-vlan'

** Affects: glance
     Importance: Undecided
     Assignee: Travis Tripp (travis-tripp)
         Status: In Progress

** Changed in: glance
     Assignee: (unassigned) => Travis Tripp (travis-tripp)

** Changed in: glance
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1370767

Title:
  Update driver metadata definitions to Juno

Status in OpenStack Image Registry and Delivery Service (Glance):
  In Progress

Bug description:
  vmware and libvirt support different hw_vif_model settings.  This
  patch updates them so that each namespace can specify the models they
  support.

  vmware api is updated with the vmware_disktype

  
  See below for references to source code.

  vmware:

  hw_vif_model:
  From: https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vm_util.py

  ALL_SUPPORTED_NETWORK_DEVICES = ['VirtualE1000', 'VirtualE1000e',
                                   'VirtualPCNet32', 'VirtualSriovEthernetCard',
                                   'VirtualVmxnet']

  And:

  def convert_vif_model(name):
      """Converts standard VIF_MODEL types to the internal VMware ones."""
      if name == network_model.VIF_MODEL_E1000:
          return 'VirtualE1000'
      if name == network_model.VIF_MODEL_E1000E:
          return 'VirtualE1000e'
      if name not in ALL_SUPPORTED_NETWORK_DEVICES:
          msg = _('%s is not supported.') % name
          raise exception.Invalid(msg)
      return name

  vmware disktype:

  https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/constants.py

  DISK_TYPE_SPARSE = 'sparse'
  SUPPORTED_FLAT_VARIANTS = ["thin", "preallocated", "thick", "eagerZeroedThick"]

  
  libvirt:
  From:  https://github.com/openstack/nova/blob/master/nova/virt/libvirt/vif.py

  def is_vif_model_valid_for_virt(virt_type, vif_model):
      valid_models = {
          'qemu': [network_model.VIF_MODEL_VIRTIO,
                   network_model.VIF_MODEL_NE2K_PCI,
                   network_model.VIF_MODEL_PCNET,
                   network_model.VIF_MODEL_RTL8139,
                   network_model.VIF_MODEL_E1000,
                   network_model.VIF_MODEL_SPAPR_VLAN],
          'kvm': [network_model.VIF_MODEL_VIRTIO,
                  network_model.VIF_MODEL_NE2K_PCI,
                  network_model.VIF_MODEL_PCNET,
                  network_model.VIF_MODEL_RTL8139,
                  network_model.VIF_MODEL_E1000,
                  network_model.VIF_MODEL_SPAPR_VLAN],
          'xen': [network_model.VIF_MODEL_NETFRONT,
                  network_model.VIF_MODEL_NE2K_PCI,
                  network_model.VIF_MODEL_PCNET,
                  network_model.VIF_MODEL_RTL8139,
                  network_model.VIF_MODEL_E1000],
          'lxc': [],
          'uml': [],
          }

  
  From:  https://github.com/openstack/nova/blob/master/nova/network/model.py

  VIF_MODEL_VIRTIO = 'virtio'
  VIF_MODEL_NE2K_PCI = 'ne2k_pci'
  VIF_MODEL_PCNET = 'pcnet'
  VIF_MODEL_RTL8139 = 'rtl8139'
  VIF_MODEL_E1000 = 'e1000'
  VIF_MODEL_E1000E = 'e1000e'
  VIF_MODEL_NETFRONT = 'netfront'
  VIF_MODEL_SPAPR_VLAN = 'spapr-vlan'

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1370767/+subscriptions


Follow ups

References