21306943 IP address prefix length is not being set in the network/install service profile s11-update
authorGirish Moodalbail <Girish.Moodalbail@oracle.COM>
Thu, 25 Jun 2015 13:27:37 -0700
branchs11-update
changeset 4569 e6bd6f2f307f
parent 4568 104acafa885a
child 4570 60ae9e6df0ca
21306943 IP address prefix length is not being set in the network/install service profile 21309060 Zone is not configured with IPv6 default address for DHCP disabled subnets
components/openstack/nova/files/solariszones/driver.py
components/openstack/nova/files/solariszones/sysconfig.py
--- a/components/openstack/nova/files/solariszones/driver.py	Tue Jun 09 22:31:26 2015 -0700
+++ b/components/openstack/nova/files/solariszones/driver.py	Thu Jun 25 13:27:37 2015 -0700
@@ -1032,6 +1032,8 @@
             evs_uuid = port['network_id']
             vport_uuid = port['id']
             ip = network['network']['subnets'][0]['ips'][0]['address']
+            ip_plen = network['network']['subnets'][0]['cidr'].split('/')[1]
+            ip = '/'.join([ip, ip_plen])
             ip_version = network['network']['subnets'][0]['version']
             route = network['network']['subnets'][0]['gateway']['address']
             dns_list = network['network']['subnets'][0]['dns']
--- a/components/openstack/nova/files/solariszones/sysconfig.py	Tue Jun 09 22:31:26 2015 -0700
+++ b/components/openstack/nova/files/solariszones/sysconfig.py	Thu Jun 25 13:27:37 2015 -0700
@@ -1,6 +1,6 @@
 # vim: tabstop=4 shiftwidth=4 softtabstop=4
 
-# Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
 #    not use this file except in compliance with the License. You may obtain
@@ -49,6 +49,11 @@
     instance = etree.SubElement(install, "instance", enabled="true",
                                 name="default")
 
+    if not route:
+        # network/install SMF method script checks for ::0 for IPv6
+        # for no-gateway case
+        route = '0.0.0.0' if ip_version == 4 else '::0'
+
     if ip_version == 4:
         pg4 = etree.SubElement(instance, "property_group",
                                type="ipv4_interface",
@@ -89,6 +94,8 @@
                              name="static_address", value=ip)
             etree.SubElement(pg6, "propval", type="astring", name="name",
                              value="%s/v6" % linkname)
+            etree.SubElement(pg6, "propval", type="net_address_v6",
+                             name="default_route", value=route)
         else:
             pg6 = etree.SubElement(instance, "property_group",
                                    type="ipv6_interface",