Managing the ephemeral storage
Depending on the instantiated flavor (m1.tiny
, …) a second disk is mounted to the VM under the peripheric /dev/vdb
.
You may use this space as a normal block device.
This space is limited to the VM lifetime and will therefore be destroyed with it.
Choose the amount of ephemeral space
% openstack flavor list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 10 | 20 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 10 | 40 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 10 | 80 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 10 | 160 | | 8 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
Verify the assigned size
From the VM:
(root) % fdisk -l /dev/vdb
Disk /dev/vdb: 21.5 GB, 21474836480 bytes
[...]
Storage usage
As a partition
% mkfs.xfs /dev/vdb
% mkdir /mnt/ephemeral
% mount /dev/vdb /mnt/ephemeral
With LVM
Create the LVM partition:
% pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created
% vgcreate ephemeral /dev/vdb
Volume group "ephemeral" successfully created
% lvcreate -L5G -n testpart ephemeral
Logical volume "testpart" created
Format and mount:
% mkfs.xfs /dev/rootvg/ephemeral
% mkdir /mnt/ephemeral
% mount /dev/rootvg/ephemeral /mnt/ephemeral