senlin nova vnic-type support

Bug #1906453 reported by Satish Patel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
senlin
New
Undecided
Unassigned

Bug Description

Folk,

Not sure how to deal with this issue here or it's going to be feature request. In my cloud we have SR-IOV compute pool which required --binding:vnic-type direct (Default is normal for linux-bridge/OVS).

Related that i talked to Duc here: http://eavesdrop.openstack.org/irclogs/%23senlin/%23senlin.2020-11-30.log.html

As per our conversation i made following code change to my local repo to test out but look like i am missing something (I am not very expert in python so trying to understand what else need to change in code)

https://github.com/openstack/senlin/blob/master/senlin/profiles/os/nova/server.py#L751

I made following changes in code to test this feature in lab.

port_attrs = {
                'id': port.id,
                'network_id': port.network_id,
                'security_group_ids': port.security_group_ids,
                'fixed_ips': port.fixed_ips,
                'binding_vnic_type': port.binding_vnic_type
            }

...
...
NETWORK_KEYS = (
        PORT, BINDING_VNIC_TYPE, FIXED_IP, NETWORK, PORT_SECURITY_GROUPS,
        FLOATING_NETWORK, FLOATING_IP,
    ) = (
        'port', 'binding_vnic_type', 'fixed_ip', 'network', 'security_groups',
        'floating_network', 'floating_ip',
    )

...
...
NETWORKS: schema.List(
            _('List of networks for the server.'),
            schema=schema.Map(
                _('A map specifying the properties of a network for uses.'),
                schema={
                    NETWORK: schema.String(
                        _('Name or ID of network to create a port on.'),
                    ),
                    BINDING_VNIC_TYPE: schema.String(
                        _('VNIC type of port.'),
                    ),
                    PORT: schema.String(
                        _('Port ID to be used by the network.'),
                    ),

I have created profile with following options (binding_vnic_type: direct)

type: os.nova.server
version: 1.0
properties:
  name: senlin-sriov-vm
  flavor: m1.small
  image: "cirros"
  networks:
    - network: vlan66
      binding_vnic_type: direct
  metadata:
    test_key: test_value
  user_data: |
    #!/bin/sh
    echo 'hello, world' > /tmp/test_file

And i have created cluster but look like its still creating port with binding_vnic_type: normal. (Trying to understand how does this attributes get pass to nova)

It seems we need to made more change in code to pass correct value to nova.

Revision history for this message
Satish Patel (satish-txt) wrote :

After working with Duc on IRC made some progress. After adding following snippet i am able to spun up sriov instances.

if fixed_ip:
            port_attr['fixed_ips'] = [fixed_ip]
        security_groups = net_spec.get(self.PORT_SECURITY_GROUPS, [])
        if security_groups:
            port_attr['security_groups'] = security_groups
        #vnic_type = net.get(self.VNIC_TYPE, None) <---------------- Doesn't work (trying to find why my input to profile not getting pass here)
        vnic_type = 'direct' <---------------- It works,
        if vnic_type:
            port_attr['binding_vnic_type'] = vnic_type
        try:
            port = self.network(obj).port_create(**port_attr)
            return port, None
        except exc.InternalError as ex:
            return None, ex

Revision history for this message
Satish Patel (satish-txt) wrote :

In my last comment following was typo, this one is correct

vnic_type = net_spec.get(self.VNIC_TYPE, None)

Revision history for this message
Satish Patel (satish-txt) wrote :

Figured out my issue, submitting patch for vnic_type support.

Revision history for this message
Satish Patel (satish-txt) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.