components/openstack/nova/patches/06-Solaris-dev-name.patch
changeset 6854 52081f923019
parent 5405 66fd59fecd68
equal deleted inserted replaced
6853:cf1567491b1b 6854:52081f923019
     1 The patch is to fix the issue of linuxy devices names on Solaris
     1 The patch is to fix the issue of linuxy devices names on Solaris
     2 instance recorded in the bugs (19987962 and 19277019).
     2 instance recorded in the bugs (19987962 and 19277019).
     3 
     3 
     4 --- nova-2015.1.0/nova/compute/utils.py.~1~     2015-05-05 10:50:25.237281011 -0600
     4 --- nova-13.0.0.0rc2/nova/compute/utils.py.~6~	2016-03-31 01:46:45.489880535 -0800
     5 +++ nova-2015.1.0/nova/compute/utils.py 2015-05-05 11:02:47.913482292 -0600
     5 +++ nova-13.0.0.0rc2/nova/compute/utils.py	2016-03-31 02:19:05.040013477 -0800
     6 @@ -133,6 +133,23 @@ def get_next_device_name(instance, devic
     6 @@ -137,6 +137,24 @@ def get_next_device_name(instance, devic
     7      /dev/vdc is specified but the backend uses /dev/xvdc), the device
       
     8      name will be converted to the appropriate format.
     7      name will be converted to the appropriate format.
     9      """
     8      """
    10 +    if driver.compute_driver_matches('solariszones.SolarisZonesDriver'):
     9  
       
    10 +    if (CONF.compute_driver and
       
    11 +            CONF.compute_driver.endswith('solariszones.SolarisZonesDriver')):
    11 +        prefix = 'c1d'
    12 +        prefix = 'c1d'
    12 +        if device_name_list == []:
    13 +        if device_name_list == []:
    13 +            # Return the root device (c1d0)
    14 +            # Return the root device (c1d0)
    14 +            return 'c1d0'
    15 +            return 'c1d0'
    15 +
    16 +
    22 +        # find the least unused number from '0' (root device)
    23 +        # find the least unused number from '0' (root device)
    23 +        used_nums = [int(dev.rsplit('d')[-1]) for dev in device_name_list]
    24 +        used_nums = [int(dev.rsplit('d')[-1]) for dev in device_name_list]
    24 +        diff = [i for i in range(len(used_nums) + 1) if i not in used_nums]
    25 +        diff = [i for i in range(len(used_nums) + 1) if i not in used_nums]
    25 +        return prefix + str(min(diff))
    26 +        return prefix + str(min(diff))
    26 +
    27 +
    27      is_xen = driver.compute_driver_matches('xenapi.XenAPIDriver')
       
    28 
       
    29      req_prefix = None
    28      req_prefix = None
       
    29      req_letter = None
       
    30