On Wed, 2024-08-21 at 11:39 +0000, meteccinar@gmail.com wrote:
Hi everyone, we make cloud region for our company. Using Openstack with Ceph (as Block Storage). We configured backup driver field as BackupDriverCeph in the cinder.conf file. Also created volume and backups pools in Ceph Rados. We have a few problems/questions.
We have developed an API that regularly backs up VMs (instances) that work with volumes. The process works as follows:
First, we use the create_server_image() method from the OpenStack API to create an image of the instance. This results in an image of the instance being automatically created in OpenStack with a Snapshot type (including metadata such as direct_url, stores, schema, etc.). Simultaneously, a snapshot is also automatically created using with the create_server() command. We then take backups of all volumes attached to the instance.
In our restore API, we use the image created from the instance backup mentioned above. We change block_device_mapping field and add the IDs of the volume backups to the block_device_mapping field of the image and use the create_server(image_name, volume_from_backed_volume) method in the OpenStack API to create a new instance. Then new volumes are created from volume backups and attach new volumes in new restored instance.
the normal way to restore a snapshot of an instance is to use the rebuild api why are you creating a new server in your restore flow?
The problem we're encountering is that when using the create_server command, the image created from the instance backup is tied to the direct_url, which points to the RBD URL of the snapshot. As a result, the instance does not running with new volume.
Note: If we create a new VM with new volume from volume backup in Horizon. Instance running successfully.
What steps should we take to resolve this?
Is there a flaw in our approach when designing the API?
What is the best practice we should follow when creating an API for backup and restore (especially for instances that boot from volumes)?
so nova and cidner already provide apis for this via the server create iamge api and rebuild api on the nova side and cidner alos has backup adn restore apis for creating volume snapshots and restoring them so im not sure why you need to build a new one instead of using the ones that already exist and are integrated into horizon already.
Is there a configuration we need to adjust in Ceph?
We would appreciate your advice on the best practices for backup and restore, particularly for instances that boot from volumes.
Kind regards,