[virtual] Setup nfs for nova instances 33/41833/1
authorMichael Polenchuk <mpolenchuk@mirantis.com>
Wed, 13 Sep 2017 08:18:19 +0000 (12:18 +0400)
committerMichael Polenchuk <mpolenchuk@mirantis.com>
Wed, 13 Sep 2017 08:18:19 +0000 (12:18 +0400)
Configure nfs shared storage for nova instances
to support live migration feature.

Change-Id: I777d5725e45d03325507d3ecc8dd59a28cbc188f
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
mcp/config/states/openstack
mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml
mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_control.yml
mcp/scripts/salt.sh

index eaab135..beb6abb 100755 (executable)
@@ -1,6 +1,10 @@
 #!/bin/bash
 set -x
 
+salt -I 'nfs:server' file.mkdir /srv/nova/instances
+salt -I 'nfs:server' state.sls nfs
+salt -I 'nfs:client' state.sls nfs
+
 salt -I 'rabbitmq:server' state.sls rabbitmq
 salt -I 'rabbitmq:server' cmd.run "rabbitmqctl status"
 
index 2485d1f..978f468 100644 (file)
@@ -3,6 +3,7 @@ classes:
 - system.linux.system.repo.mcp.extra
 - system.linux.system.repo.saltstack.xenial
 - system.linux.storage.loopback
+- service.nfs.client
 - system.nova.compute.single
 - service.neutron.compute.single
 - service.cinder.volume.single
@@ -44,6 +45,13 @@ parameters:
         host: ${_param:cluster_local_address}
       message_queue:
         host: ${_param:cluster_local_address}
+  nfs:
+    client:
+      mount:
+        nfs:
+          path: /var/lib/nova/instances
+          fstype: nfs
+          device: ${_param:openstack_control_address}:/srv/nova/instances
   linux:
     network:
       bridge: openvswitch
index 5b68b7b..64e6f4d 100644 (file)
@@ -3,6 +3,7 @@ classes:
 - system.linux.system.repo.mcp.openstack
 - system.linux.system.repo.mcp.extra
 - system.linux.system.repo.saltstack.xenial
+- service.nfs.server
 - system.mongodb.server.single
 - system.mongodb.server.database.ceilometer
 - system.ceilometer.client
@@ -112,3 +113,15 @@ parameters:
         address: ${_param:cluster_local_address},127.0.0.1
       logging:
         verbose: v
+  nfs:
+    server:
+      share:
+        nova_instances:
+          path: /srv/nova/instances
+          host:
+            nova:
+              host: ${_param:single_address}/24
+              params:
+              - rw
+              - no_root_squash
+              - async
index 7f2c3ca..c6d8e73 100755 (executable)
@@ -47,7 +47,8 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s << SALT_INSTALL_END
   cd /srv/salt/scripts
   BOOTSTRAP_SALTSTACK_OPTS=" -r -dX stable 2016.11 " \
     MASTER_HOSTNAME=cfg01.${CLUSTER_DOMAIN} DISTRIB_REVISION=nightly \
-      ./salt-master-init.sh
+      EXTRA_FORMULAS="nfs" \
+        ./salt-master-init.sh
   salt-key -Ay
 
   cp -r ${OPNFV_FUEL_DIR}/mcp/salt-formulas/* /usr/share/salt-formulas/env