Symptoms:
Say you are attempting to move a Volume from one VHI cluster to another new VHI
And you want the transferred volume to display under "disks" in the UI of the new cluster.
Resolution:
As a prerequisite please make sure Volume is not in use and also note this method will not transfer any snapshots that are attached to the volume.
1. let us use this example volume below as the Source:
[root@fra3-vhc-prd1-03 ~]# openstack volume show a6b536ea-008a-4ba2-8d87-f83424e054c1
+--------------------------------+---------------------------------------------------+
| Field | Value |
+--------------------------------+---------------------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2022-07-03T07:29:16.714262 |
| description | None |
| encrypted | False |
| group_id | None |
| id | a6b536ea-008a-4ba2-8d87-f83424e054c1 |
| migration_status | None |
| multiattach | False |
| name | transfer-to-ams |
| os-vol-host-attr:host | fra3-vhc-prd1-02.vstoragedomain@vstorage#vstorage |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | eb41ec5c52b64427b123ae51016a48d6 |
| properties | |
| provider_id | None |
| replication_status | None |
| size | 1400 |
| snapshot_id | 8bb87bfe-741f-4da9-919b-28f99f935cbe |
| source_volid | None |
| status | creating |
| type | lowlatency3k |
| updated_at | 2022-07-03T07:29:16.947940 |
| user_id | ab9b005d7366431f899f77118a882f7d |
+--------------------------------+---------------------------------------------------+
Keep a record of its size and storage policy in this case lowlatency3k
2. Locate the volume in /mnt/vstorage
Source
[root@fra3-vhc-prd1-03 ~]# ll /mnt/vstorage/vols/datastores/cinder/volume-a6b536ea-008a-4ba2-8d87-f83424e054c1/volume-a6b536ea-008a-4ba2-8d87-f83424e054c1
-rwxrwx--- 1 root vstorage-users 1135467298816 Jul 3 09:29 /mnt/vstorage/vols/datastores/cinder/volume-a6b536ea-008a-4ba2-8d87-f83424e054c1/volume-a6b536ea-008a-4ba2-8d87-f83424e054c1
3. Rsync the volume data to a local/destination/local-file temporarily
[root@fra3-vhc-prd1-03 ~]# rsync -av --progress --inplace --append /mnt/vstorage/vols/datastores/cinder/volume-a6b536ea-008a-4ba2-8d87-f83424e054c1/volume-a6b536ea-008a-4ba2-8d87-f83424e054c1 /some/local/destination/local-file
Rsync steps to transfer a volume:
4. To transfer the volume. Create the Destination volume with the same size and policy as the Source volume. In the example below the new volume is in a new cluster and project called for example chainstack/prod-chainstack-ams as an example:
[root@vhc-ams-man01 ~]# openstack volume show dec4c0c4-0c47-4d06-bbba-5bfe32393ccd
+--------------------------------+------------------------------------------------+
| Field | Value |
+--------------------------------+------------------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2022-07-03T07:50:02.339483 |
| description | None |
| encrypted | False |
| group_id | None |
| id | dec4c0c4-0c47-4d06-bbba-5bfe32393ccd |
| migration_status | None |
| multiattach | False |
| name | transferring-do-not-touch |
| os-vol-host-attr:host | vhc-ams-man04.vstoragedomain@vstorage#vstorage |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | a2298131cf1c4ae19d267ea731a459b7 |
| properties | |
| provider_id | None |
| replication_status | None |
| size | 1400 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| type | lowlatency3k |
| updated_at | 2022-07-03T07:50:04.839628 |
| user_id | 50172c6e76894c4aba87f54b25ba50f9 |
+--------------------------------+------------------------------------------------+
5. Locate the Destination volume path
Destination
[root@vhc-ams-man01 ~]# ll /mnt/vstorage/vols/datastores/cinder/volume-dec4c0c4-0c47-4d06-bbba-5bfe32393ccd/volume-dec4c0c4-0c47-4d06-bbba-5bfe32393ccd
-rwxrwx--- 1 root vstorage-users 3145816 Jul 3 07:50 /mnt/vstorage/vols/datastores/cinder/volume-dec4c0c4-0c47-4d06-bbba-5bfe32393ccd/volume-dec4c0c4-0c47-4d06-bbba-5bfe32393ccd
6. Do rsync to transfer data from the local file containing the volume data into the Destination volume
[root@fra3-vhc-prd1-03 ~]# rsync -av --progress --inplace --append /some/local/destination/local-file root@172.255.106.204:/mnt/vstorage/vols/datastores/cinder/volume-dec4c0c4-0c47-4d06-bbba-5bfe32393ccd/volume-dec4c0c4-0c47-4d06-bbba-5bfe32393ccd
sending incremental file list
volume-a6b536ea-008a-4ba2-8d87-f83424e054c1
291012696 0% 91.56MB/s 4:26:52
1501575512064 100% 102.69MB/s 3:52:24 (xfer#1, to-check=0/1)
sent 1501755663783 bytes received 31 bytes 107687473.65 bytes/sec
total size is 1501575512064 speedup is 1.00
[root@fra3-vhc-prd1-03 ~]#
7. Wait till complete now it is done.
Related Ticket(s):
#416256