5.9.3. Configuring shared storage
If you are using shared storage, export the instance directory for the Compute service to the two nodes, and ensure that the nodes have access. The directory path is set in the state_path
and instances_path
parameters in your Compute environment file. This procedure uses the default value, which is /var/lib/nova/instances
. Only users with root access can set up shared storage. The Compute service user in the following procedure must be the same across Controller and Compute nodes.
Procedure
Perform the following steps on the Controller node:
Ensure that the
/var/lib/nova/instances
directory has read-write access by the Compute service user, as shown in the following example:drwxr-xr-x. 9 nova nova 4096 Nov 5 20:37 instances
Add the following lines to the
/etc/exports
file:/var/lib/nova/instances node1_IP(rw,sync,fsid=0,no_root_squash) /var/lib/nova/instances node2_IP(rw,sync,fsid=0,no_root_squash)
Replace
node1_IP
andnode2_IP
for the IP addresses of the two Compute nodes, for example:/var/lib/nova/instances 192.168.24.9(rw,sync,fsid=0,no_root_squash) /var/lib/nova/instances 192.168.24.21(rw,sync,fsid=0,no_root_squash)
Export the
/var/lib/nova/instances
directory to the Compute nodes:# exportfs -avr
Restart the NFS server:
# systemctl restart nfs-server
Perform the following steps on each Compute node:
-
Ensure that the
/var/lib/nova/instances
directory exists locally. Add the following line to the
/etc/fstab
file:NFS_SHARE_PATH:/var/lib/nova/instances /var/lib/nova/instances nfs4 defaults 0 0
Mount the controller’s instance directory to mount all the devices listed in
/etc/fstab
:# mount -a -v
Ensure that QEMU can access the directory’s images:
# ls -ld /var/lib/nova/instances drwxr-xr-x. 9 nova nova 4096 Nov 5 20:37 /var/lib/nova/instances
Ensure that the node can see the instances directory with:
drwxr-xr-x. 9 nova nova 4096 Nov 5 20:37 /var/lib/nova/instances
-
Ensure that the
You can also run the following to view all mounted devices:
# df -k