Hi Gorka,
Thankyou so much for the insight !
This would really solve my problem.
I will try this out and get back to you shortly.
Thanks and Regards,
Harsh Ailani
From:
Gorka Eguileor <geguileo@redhat.com>
Date: Tuesday, 24 September 2024 at 5:26 PM
To: Harsh Ailani <harsh.ailani@ibm.com>
Cc: openstack-discuss@lists.openstack.org <openstack-discuss@lists.openstack.org>
Subject: [EXTERNAL] Re: OpenStack Cinder - Volume-ID in cinder DB
On 19/09, Harsh Ailani wrote:
> Hello contributors,
>
> I am working on clone operation for a volumegroup and in that the volume ID auto-generated by OpenStack is not the one with which the clone volumes are being created on my IBM storage backend. This is as per design that IBM Storage backend will take the source-volume
ID in the source-volumegroup and add a suffix to it while cloning.
>
> Now since there is a mismatch in the IDs between cinder and storage backend, because of which I am unable to perform any volume operations on this cloned volume. So, I was wondering if I can change the volume ID in cinder DB?
>
> I know that it’s a unique key and there is a limit of 36 characters for this field in cinder DB, but since I cannot change the volume in storage backend, I wanted to check if there is a way I can alter the volume ID in cinder DB?
>
>
> Kindly share your thoughts/suggestions on this matter.
>
> Thanks and Regards,
> Harsh Ailani
>
Hi,
Having different references in Cinder and in the storage array is
supported by Cinder and its drivers.
Cinder drivers can store a driver specific ID in the `provider_id` field
of the volume [1], which is considerably larger (255 chars).
Your driver just needs to return the values of the `provider_id` in a
dictionary of the `create_volume`, `create_cloned_volume`, and other
similar methods that create or move volumes.
You can find some examples in other existing cinder drivers that also
use this field, such as Pure, SolidFire, PowerFlex, Unity, SC,
PowerStore, etc.
Cheers,
Gorka.
[1]: https://github.com/openstack/cinder/blob/a14312cc34e49d9623846548719ec5472463b1f7/cinder/db/sqlalchemy/models.py#L372