components/openstack/nova/files/solariszones/driver.py
changeset 4671 d08190e626f1
parent 4669 342ab6111bb5
child 4692 c1143cad49f2
equal deleted inserted replaced
4670:5d025a8c4800 4671:d08190e626f1
  1834         suri = self._suri_from_volume_info(connection_info)
  1834         suri = self._suri_from_volume_info(connection_info)
  1835 
  1835 
  1836         with ZoneConfig(zone) as zc:
  1836         with ZoneConfig(zone) as zc:
  1837             zc.addresource("device", [zonemgr.Property("storage", suri)])
  1837             zc.addresource("device", [zonemgr.Property("storage", suri)])
  1838 
  1838 
       
  1839         # apply the configuration to the running zone
       
  1840         zone.apply()
       
  1841 
  1839     def detach_volume(self, connection_info, instance, mountpoint,
  1842     def detach_volume(self, connection_info, instance, mountpoint,
  1840                       encryption=None):
  1843                       encryption=None):
  1841         """Detach the disk attached to the instance."""
  1844         """Detach the disk attached to the instance."""
  1842         name = instance['name']
  1845         name = instance['name']
  1843         zone = self._get_zone_by_name(name)
  1846         zone = self._get_zone_by_name(name)
  1859                         "'%s'") % (suri, name))
  1862                         "'%s'") % (suri, name))
  1860             return
  1863             return
  1861 
  1864 
  1862         with ZoneConfig(zone) as zc:
  1865         with ZoneConfig(zone) as zc:
  1863             zc.removeresources("device", [zonemgr.Property("storage", suri)])
  1866             zc.removeresources("device", [zonemgr.Property("storage", suri)])
       
  1867 
       
  1868         # apply the configuration to the running zone
       
  1869         zone.apply()
  1864 
  1870 
  1865     def swap_volume(self, old_connection_info, new_connection_info,
  1871     def swap_volume(self, old_connection_info, new_connection_info,
  1866                     instance, mountpoint, resize_to):
  1872                     instance, mountpoint, resize_to):
  1867         """Replace the disk attached to the instance.
  1873         """Replace the disk attached to the instance.
  1868 
  1874