Mount Cinder Volumes to Instances by UUID

Problem

When attaching multiple Cinder Volumes to an instance, it is possible that the mount points will be jumbled on reboot. Mounting the volumes by UUID ensures the proper volumes are reattached to the correct mount points in the event the instance requires a power cycle.

Environment

  • Platform9 Managed OpenStack - All Versions

Procedure

1. Once you have mounted the volume(s) to the instance in the UI per the instruction provided in the article, Cinder Block Storage Integration in Platform9, SSH to the instance and verify the disk has been attached properly.

Copy

Notice disk /dev/vdb does not yet have any partitions configured.

2. Start thefdisk utility to format and partition the new disk.

Copy

3. Make the following selections at the "Command (m for help):" prompt:

  • n - to create a new partition
  • p - to make the new partition a primary partition
  • 1 - to make this the first partition
Copy

To use the default first and last sectors of the disk, simply press "Enter" with no value entered.

4. Proceed with the following selections:

  • t - to change the partition type
  • 83 - to change the partition type to 'Linux'
Copy

5. Complete partitioning with these selections:

  • p - to print the partition table
  • w - to write the table to disk and exit the utility
Copy

6. You will now see your new ( /dev/vdb1) partition in the fdisk -loutput.

Copy

7. Create a filesystem on the new partition.

Copy

8. Collect the UUID of the new volume.

Copy

9. Determine what directory you will mount your volume and create it if necessary.

Copy

10. Mount the volume.

Copy

11. Edit the /etc/fstab file with your preferred text editor to add the mount point to persist after a reboot.

Copy

12. Verify the volume was mounted properly.

Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard