Transferring volumes
Volumes are specific to a project and can only be attached to one virtual machine at a time.
There are mechanisms to transfer volumes between projects as detailed in the following steps.
The steps need to be performed as follows
- The volume is detached from the VM in the source project and is available
- The administrator of the source project marks the volume as being ready for transfer. This process generates an authentication key.
- The authentication key has to be transmitted via a secure channel to the administrator of the destination project
- The administrator of the desstination project acccepts the transfer using the authentication key.
- The volume is attached to the VM in the destination project
Let's go !
Authenticating against the source project, create the transfer request
$ openstack volume transfer request create testvol
+------------+--------------------------------------+
| Field | Value |
+------------+--------------------------------------+
| auth_key | 55ada5284805dbca |
| created_at | 2021-02-26T13:45:08.498392 |
| id | 4157e983-a738-4ca8-8f7b-2542240c0681 |
| name | None |
| volume_id | 71bd47d8-b51e-4f12-9c51-0445fc36c9e4 |
+------------+--------------------------------------+
The volume can be checked as in the transfer status using openstack volume transfer request list
as follows and the volume is in status awaiting-transfer.
$ openstack volume transfer request list
+--------------------------------------+------+--------------------------------------+
| ID | Name | Volume |
+--------------------------------------+------+--------------------------------------+
| 4157e983-a738-4ca8-8f7b-2542240c0681 | None | 71bd47d8-b51e-4f12-9c51-0445fc36c9e4 |
+--------------------------------------+------+--------------------------------------+
$ openstack volume show my-volume
+--------------------------------+--------------------------------------------+
| Field | Value |
+--------------------------------+--------------------------------------------+
[...]
| status | awaiting-transfer |
[...]
+--------------------------------+--------------------------------------------+
The administrator of the destination project should authenticate and receive the authentication key reported above. The transfer can then be initiated.
$ openstack volume transfer request accept --auth-key 55ada5284805dbca 4157e983-a738-4ca8-8f7b-2542240c0681
+-----------+--------------------------------------+
| Field | Value |
+-----------+--------------------------------------+
| id | 4157e983-a738-4ca8-8f7b-2542240c0681 |
| name | None |
| volume_id | 71bd47d8-b51e-4f12-9c51-0445fc36c9e4 |
+-----------+--------------------------------------+
$ openstack volume list
+--------------------------------------+---------+-----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+---------+-----------+------+-------------+
| 71bd47d8-b51e-4f12-9c51-0445fc36c9e4 | testvol | available | 200 | |
+--------------------------------------+---------+-----------+------+-------------+