<div dir="ltr"><div dir="ltr">Hi Tony,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 24, 2022 at 9:43 AM Tony Liu <<a href="mailto:tonyliu0592@hotmail.com">tonyliu0592@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Here is what I do.<br>
* Create a volume.<br>
* Create a backup of this volume.<br>
* Delete the volume.<br>
* Restore the volume from backup.<br>
<br></blockquote><div><br></div><div>There are different ways to do the following operations, 1) from cinderclient, 2) from openstackclient, 3) hitting the API manually or with a script etc so it's always good to be explicit about how the steps were done i.e. mentioning the way used to perform the above operations.</div><div>Also it's helpful to provide the OpenStack release you're using as different releases have different behavior. I will use OpenStack Zed (master) as reference for below observations.</div><div>Lastly providing the volume and backup backend is also useful information (however not very relevant in this case).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The restored volume has different UUID, but the same name.<br></blockquote><div><br></div><div>AFAICS, if you're using cinderclient or hitting API directly, there's a "name" parameter[1][2] you can provide that will be used as the name of the restored volume.</div><div>If you don't provide the name parameter, it will create the volume with the following name "<span style="background-color:rgb(255,251,221);color:rgb(204,122,0);font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Twemoji Mozilla";font-size:12px;white-space:pre-wrap">restore_backup_<backup-id>"[3].</span></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I don't see volume name is stored in backup metadata.<br></blockquote><div><br></div><div>It's not taken from backup metadata.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
How does Cinder know the volume name when restore it from backup,<br>
given the volume is already deleted?<br>
<br>
<br>
Thanks!<br>
Tony<br>
<br>
<br></blockquote><div><br></div><div>[1] <a href="https://opendev.org/openstack/python-cinderclient/src/branch/master/cinderclient/v3/shell.py#L227-L232">https://opendev.org/openstack/python-cinderclient/src/branch/master/cinderclient/v3/shell.py#L227-L232</a></div><div>[2] <a href="https://opendev.org/openstack/cinder/src/branch/master/cinder/api/contrib/backups.py#L214">https://opendev.org/openstack/cinder/src/branch/master/cinder/api/contrib/backups.py#L214</a></div><div>[3] <a href="https://opendev.org/openstack/cinder/src/branch/master/cinder/backup/api.py#L384-L386">https://opendev.org/openstack/cinder/src/branch/master/cinder/backup/api.py#L384-L386</a></div><div><br></div><div>Thanks and Regards</div><div>Rajat Dhasmana</div></div></div>