PSARC/2016/242 Nova boot volume placement
authorNiall Power <niall.power@oracle.com>
Tue, 17 May 2016 14:49:51 -0700
changeset 6014 83c60536394d
parent 6013 1458d0cd0532
child 6017 beff85b67068
PSARC/2016/242 Nova boot volume placement 21678974 cinder volume for rpool should be possible to be placed on desired storage
components/openstack/nova/files/nova.conf
components/openstack/nova/files/solariszones/driver.py
--- a/components/openstack/nova/files/nova.conf	Mon May 16 17:19:50 2016 -0700
+++ b/components/openstack/nova/files/nova.conf	Tue May 17 14:49:51 2016 -0700
@@ -1828,6 +1828,14 @@
 # Options defined in nova.virt.solariszones.driver
 #
 
+# Cinder volume type solariszones driver will use for creation
+# of instance boot volumes
+#boot_volume_type=<None>
+
+# Cinder availability zone solariszones driver will use for
+# creation of instance boot volumes
+#boot_volume_az=<None>
+
 # Default path to Glance cache for Solaris Zones. (string
 # value)
 #glancecache_dirname=/var/share/nova/images
--- a/components/openstack/nova/files/solariszones/driver.py	Mon May 16 17:19:50 2016 -0700
+++ b/components/openstack/nova/files/solariszones/driver.py	Tue May 17 14:49:51 2016 -0700
@@ -75,6 +75,12 @@
 from nova.volume.cinder import _untranslate_volume_summary_view
 
 solariszones_opts = [
+    cfg.StrOpt('boot_volume_type',
+               default=None,
+               help='Cinder volume type to use for boot volumes'),
+    cfg.StrOpt('boot_volume_az',
+               default=None,
+               help='Cinder availability zone to use for boot volumes'),
     cfg.StrOpt('glancecache_dirname',
                default='/var/share/nova/images',
                help='Default path to Glance cache for Solaris Zones.'),
@@ -1189,13 +1195,17 @@
 
     def _create_boot_volume(self, context, instance):
         """Create a (Cinder) volume service backed boot volume"""
+        boot_vol_az = CONF.boot_volume_az
+        boot_vol_type = CONF.boot_volume_type
         try:
             vol = self._volume_api.create(
                 context,
                 instance['root_gb'],
                 instance['hostname'] + "-" + self._rootzpool_suffix,
                 "Boot volume for instance '%s' (%s)"
-                % (instance['name'], instance['uuid']))
+                % (instance['name'], instance['uuid']),
+                volume_type=boot_vol_type,
+                availability_zone=boot_vol_az)
             # TODO(npower): Polling is what nova/compute/manager also does when
             # creating a new volume, so we do likewise here.
             while True: