Browse code

Set cinder's my_ip based on SERVICE_IP_VERSION value

Devstack's lib/cinder set the my_ip on cinder side but it
hard-code it with HOST_IP[1]. It is no issue for IPv4 env
but when you build or run the IPv6 job then this ip is left
to set with IPv6. my_ip should be set to HOST_IP or HOST_IPV6
based on SERVICE_IP_VERSION value.

As part of Train community goal 'Support IPv6-Only Deployments',
we will expand the 'devstack-tempest-ipv6' job to do IPv6-only
deployments verification so we need fix the the my_ip setting.

Closes-Bug: #1838250

Depends-On: https://review.opendev.org/#/c/677524/

[1]https://github.com/openstack/devstack/blob/6aeaceb0c4ef078d028fb6605cac2a37444097d8/lib/cinder#L231

Change-Id: I71c74e46467a5d3c1bf9c7d683f364cba7cf9d80

Ghanshyam Mann authored on 2019/07/29 19:42:24
Showing 1 changed files
... ...
@@ -228,8 +228,11 @@ function configure_cinder {
228 228
     iniset $CINDER_CONF DEFAULT osapi_volume_listen $CINDER_SERVICE_LISTEN_ADDRESS
229 229
     iniset $CINDER_CONF DEFAULT state_path $CINDER_STATE_PATH
230 230
     iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH
231
-    iniset $CINDER_CONF DEFAULT my_ip "$HOST_IP"
232
-
231
+    if [[ $SERVICE_IP_VERSION == 6 ]]; then
232
+        iniset $CINDER_CONF DEFAULT my_ip "$HOST_IPV6"
233
+    else
234
+        iniset $CINDER_CONF DEFAULT my_ip "$HOST_IP"
235
+    fi
233 236
     iniset $CINDER_CONF key_manager backend cinder.keymgr.conf_key_mgr.ConfKeyManager
234 237
     iniset $CINDER_CONF key_manager fixed_key $(openssl rand -hex 16)
235 238