A volume is a detachable block storage device, similar to a USB hard drive. You can attach a volume to only one instance. To create and manage volumes, you use a combination of nova and cinder client commands.
As an administrator, you can migrate a volume with its data from one location to another in a manner that is transparent to users and workloads. You can migrate only detached volumes with no snapshots.
Possible use cases for data migration:
Bring down a physical storage device for maintenance without disrupting workloads.
Modify the properties of a volume.
Free up space in a thinly-provisioned back end.
Migrate a volume, as follows:
$ cinder migratevolumeID
destinationHost
--force-host-copy=True|False
Where --force-host-copy=True
forces
the generic host-based migration mechanism and bypasses
any driver optimizations.
Note | |
---|---|
If the volume is in use or has snapshots, the specified host destination cannot accept the volume. If the user is not an administrator, the migration fails. |
To give multiple users shared, secure access to the same data, you can set a volume to read-only access.
Run this command to set a volume to read-only access:
$ cinder readonly-mode-updateVOLUME
BOOLEAN
Where VOLUME
is the ID of the
target volume and BOOLEAN
is a flag
that enables read-only or read/write access to the
volume.
Valid values for BOOLEAN
are:
true
. Sets the read-only flag in the volume. When you attach the volume to an instance, the instance checks for this flag to determine whether to restrict volume access to read-only.false
. Sets the volume to read/write access.