Beispiel #1
0
    def get_config_vrouter(self, instance, vif, image_meta, inst_type,
                           virt_type):
        conf = self.get_base_config(instance, vif, image_meta, inst_type,
                                    virt_type)
        dev = self.get_vif_devname(vif)
        designer.set_vif_host_backend_ethernet_config(conf, dev)

        designer.set_vif_bandwidth_config(conf, inst_type)
        return conf
Beispiel #2
0
    def get_config_vrouter(self, instance, vif, image_meta,
                           inst_type, virt_type):
        conf = self.get_base_config(instance, vif, image_meta,
                                    inst_type, virt_type)
        dev = self.get_vif_devname(vif)
        designer.set_vif_host_backend_ethernet_config(conf, dev)

        designer.set_vif_bandwidth_config(conf, inst_type)
        return conf
Beispiel #3
0
    def get_config_mlnx_direct(self, instance, vif, image_meta,
                               inst_type, virt_type):
        conf = self.get_base_config(instance, vif, image_meta,
                                    inst_type, virt_type)

        devname = self.get_vif_devname_with_prefix(vif, DEV_PREFIX_ETH)
        designer.set_vif_host_backend_direct_config(conf, devname)

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #4
0
    def test_set_vif_bandwidth_config_no_extra_specs(self):
        # Test whether test_set_vif_bandwidth_config_no_extra_specs fails when
        # its second parameter has no 'extra_specs' field.

        try:
            # The conf will never be user be used, so we can use 'None'.
            # An empty dictionary is fine: all that matters it that there is no
            # 'extra_specs' field.
            designer.set_vif_bandwidth_config(None, {})
        except KeyError as e:
            self.fail('KeyError: %s' % e)
Beispiel #5
0
    def get_config_mlnx_direct(self, instance, vif, image_meta, inst_type,
                               virt_type):
        conf = self.get_base_config(instance, vif, image_meta, inst_type,
                                    virt_type)

        devname = self.get_vif_devname_with_prefix(vif, DEV_PREFIX_ETH)
        designer.set_vif_host_backend_direct_config(conf, devname)

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #6
0
    def get_config_ovs_bridge(self, instance, vif, image_meta,
                              inst_type, virt_type):
        conf = self.get_base_config(instance, vif, image_meta,
                                    inst_type, virt_type)

        designer.set_vif_host_backend_ovs_config(
            conf, self.get_bridge_name(vif),
            self.get_ovs_interfaceid(vif),
            self.get_vif_devname(vif))

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #7
0
    def get_config_802qbg(self, instance, vif, image_meta, inst_type,
                          virt_type):
        conf = self.get_base_config(instance, vif, image_meta, inst_type,
                                    virt_type)

        params = vif["qbg_params"]
        designer.set_vif_host_backend_802qbg_config(
            conf, vif['network'].get_meta('interface'), params['managerid'],
            params['typeid'], params['typeidversion'], params['instanceid'])

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #8
0
    def get_config_ovs_bridge(self, instance, vif, image_meta, inst_type,
                              virt_type):
        conf = self.get_base_config(instance, vif, image_meta, inst_type,
                                    virt_type)

        designer.set_vif_host_backend_ovs_config(conf,
                                                 self.get_bridge_name(vif),
                                                 self.get_ovs_interfaceid(vif),
                                                 self.get_vif_devname(vif))

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #9
0
    def get_config_802qbg(self, instance, vif, image_meta,
                          inst_type, virt_type):
        conf = self.get_base_config(instance, vif, image_meta,
                                    inst_type, virt_type)

        params = vif["qbg_params"]
        designer.set_vif_host_backend_802qbg_config(
            conf, vif['network'].get_meta('interface'),
            params['managerid'],
            params['typeid'],
            params['typeidversion'],
            params['instanceid'])

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #10
0
    def get_config_bridge(self, instance, vif, image_meta,
                          inst_type, virt_type):
        """Get VIF configurations for bridge type."""
        conf = self.get_base_config(instance, vif, image_meta,
                                    inst_type, virt_type)

        designer.set_vif_host_backend_bridge_config(
            conf, self.get_bridge_name(vif),
            self.get_vif_devname(vif))

        mac_id = vif['address'].replace(':', '')
        name = "patron-instance-" + instance.name + "-" + mac_id
        if self.get_firewall_required(vif):
            conf.filtername = name
        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #11
0
    def get_config_bridge(self, instance, vif, image_meta, inst_type,
                          virt_type):
        """Get VIF configurations for bridge type."""
        conf = self.get_base_config(instance, vif, image_meta, inst_type,
                                    virt_type)

        designer.set_vif_host_backend_bridge_config(conf,
                                                    self.get_bridge_name(vif),
                                                    self.get_vif_devname(vif))

        mac_id = vif['address'].replace(':', '')
        name = "patron-instance-" + instance.name + "-" + mac_id
        if self.get_firewall_required(vif):
            conf.filtername = name
        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #12
0
    def get_config_hw_veb(self, instance, vif, image_meta,
                            inst_type, virt_type):
        conf = self.get_base_config(instance, vif, image_meta,
                                    inst_type, virt_type)

        profile = vif["profile"]
        vif_details = vif["details"]
        net_type = 'direct'
        if vif['vnic_type'] == network_model.VNIC_TYPE_DIRECT:
            net_type = 'hostdev'

        designer.set_vif_host_backend_hw_veb(
            conf, net_type, profile['pci_slot'],
            vif_details[network_model.VIF_DETAILS_VLAN])

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf
Beispiel #13
0
    def get_config_hw_veb(self, instance, vif, image_meta, inst_type,
                          virt_type):
        conf = self.get_base_config(instance, vif, image_meta, inst_type,
                                    virt_type)

        profile = vif["profile"]
        vif_details = vif["details"]
        net_type = 'direct'
        if vif['vnic_type'] == network_model.VNIC_TYPE_DIRECT:
            net_type = 'hostdev'

        designer.set_vif_host_backend_hw_veb(
            conf, net_type, profile['pci_slot'],
            vif_details[network_model.VIF_DETAILS_VLAN])

        designer.set_vif_bandwidth_config(conf, inst_type)

        return conf