[ipv4_sriov] Support for IPv4 with SRIOV
Enables support for IPv4 with SRIOV on RHEL guest images Change-Id: I9b1ec46cc25d81e64c329903956a3794337652da
This commit is contained in:
parent
e4eb2ebb56
commit
50c49495d8
@ -435,7 +435,7 @@ class Compute(object):
|
|||||||
if self.config.ipv6_mode:
|
if self.config.ipv6_mode:
|
||||||
self.neutron.create_security_group_rule(
|
self.neutron.create_security_group_rule(
|
||||||
self.generate_security_group_rule_dict(group_id=group["id"],
|
self.generate_security_group_rule_dict(group_id=group["id"],
|
||||||
protocol="icmp",
|
protocol="icmpv6",
|
||||||
ethertype="IPv6"))
|
ethertype="IPv6"))
|
||||||
|
|
||||||
# Allow SSH traffic
|
# Allow SSH traffic
|
||||||
|
@ -89,7 +89,7 @@ class Instance(object):
|
|||||||
dns_servers = ','.join(subnet_info['dns_nameservers'])
|
dns_servers = ','.join(subnet_info['dns_nameservers'])
|
||||||
network_dict['dns'] = 'dns-nameservers %s\n' % dns_servers
|
network_dict['dns'] = 'dns-nameservers %s\n' % dns_servers
|
||||||
|
|
||||||
retStr = (
|
interface_snippet = (
|
||||||
'# The loopback network interface\n'
|
'# The loopback network interface\n'
|
||||||
'auto lo\n'
|
'auto lo\n'
|
||||||
'iface lo inet loopback\n'
|
'iface lo inet loopback\n'
|
||||||
@ -104,6 +104,37 @@ class Instance(object):
|
|||||||
' gateway %(gateway)s\n'
|
' gateway %(gateway)s\n'
|
||||||
' %(dns)s'
|
' %(dns)s'
|
||||||
) % network_dict
|
) % network_dict
|
||||||
|
files = {'/etc/network/interfaces': interface_snippet}
|
||||||
|
|
||||||
|
if self.config.vm_image_url:
|
||||||
|
pattern = re.search(r'rhel', self.config.vm_image_url, re.I)
|
||||||
|
if pattern:
|
||||||
|
interface_snippet = \
|
||||||
|
self.generate_rhel_interface(network_dict)
|
||||||
|
files = {
|
||||||
|
'/etc/sysconfig/network-scripts/ifcfg-eth0':
|
||||||
|
interface_snippet
|
||||||
|
}
|
||||||
|
|
||||||
|
return files
|
||||||
|
|
||||||
|
def generate_rhel_interface(self, network_dict):
|
||||||
|
retStr = None
|
||||||
|
# Note: For v6, no network custimizaton is needed. If the
|
||||||
|
# upstream router sends the correct RA in response to the RS
|
||||||
|
# then the interface should get auto-calculated and the default
|
||||||
|
# route should automatically be injected
|
||||||
|
if not self.config.ipv6_mode:
|
||||||
|
retStr = (
|
||||||
|
'DEVICE=eth0\n'
|
||||||
|
'BOOTPROTO=static\n'
|
||||||
|
'ONBOOT=no\n'
|
||||||
|
'DEFROUTE=yes\n'
|
||||||
|
'NM_CONTROLLED=no\n'
|
||||||
|
'IPADDR=%(ip_address)s\n'
|
||||||
|
'NETMASK=%(netmask)s\n'
|
||||||
|
'GATEWAY=%(gateway)s'
|
||||||
|
) % network_dict
|
||||||
|
|
||||||
return retStr
|
return retStr
|
||||||
|
|
||||||
@ -142,8 +173,7 @@ class Instance(object):
|
|||||||
|
|
||||||
files = None
|
files = None
|
||||||
if self.config.no_dhcp:
|
if self.config.no_dhcp:
|
||||||
network_interface = self.get_network_interface(self.port)
|
files = self.get_network_interface(self.port)
|
||||||
files = {'/etc/network/interfaces': network_interface}
|
|
||||||
|
|
||||||
self.instance = self.comp.create_server(self.name,
|
self.instance = self.comp.create_server(self.name,
|
||||||
image,
|
image,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user