8.6. Attaching a Volume
This procedure details the steps involved in attaching a Block Storage volume to an existing Compute instance using the
cinder and nova command line interfaces.
Procedure 8.4. Attaching a Volume using the Command Line Interface
- Use the
keystonerc_adminfile to authenticate with the Identity service.$source ~/keystonerc_admin - Use the
cinderlist command to find available volumes.$+---------------------------+---------+------------+----+-----------+ | ID | Status |Display Name|Size|Volume Type| +---------------------------+---------+------------+----+-----------+ |15a9f901-ba9d-45e1-8622-...|available| NAME | 1 | | +---------------------------+---------+------------+----+-----------+cinderlistTake note of the ID of the volume you wish to use. You will need it when attaching the volume to an instance.Note
TheAttached tocolumn has been intentionally omitted from this example output. - Use the
novalist command to find running instances.$+-----------------------------+------+--------+----------------------+ | ID | Name | Status | Networks | +-----------------------------+------+--------+----------------------+ | 6842461c-973d-f91b-170a-... | NAME | ACTIVE | private=192.0.43.10 | +-----------------------------+------+--------+----------------------+novalistTake note of the ID of the instance you wish to use. You will need it when attaching the volume. - Use the
nova volume-attachcommand to attach the volume to the instance. Replace INSTANCE_ID with the identifier of the instance and replace VOLUME_ID with the identifier of the volume.$nova volume-attach INSTANCE_ID VOLUME_ID autoTheautoparameter indicates that Compute must attempt to automatically assign a device identifier to the volume within the guest. Manual allocation of specific device identifiers within the guest is not supported on KVM hypervisors at this time.
You have successfully attached a Block Storage volume to an instance using the command line interface. The volume will appear as a physical hard disk drive to the guest operating system.