I had one disk attached to an instance & i had taken snapshot of it. Now, after few days - the disk went bad and i want to restore the disk. What i have implemented is :
- Store metadata of snapshot, when taken
- When restore request comes, i create new disk from snapshot
- detach original disk (say attached inside host as /dev/sdz )
- attach Newly created disk to the same instance
With this way, the user will get the view that the disk has been restored using the snapshot he had taken.
Now, the problem i'm seeing with this approach is : as the original disk was attached as /dev/sdz, after detach & attach of NEW disk, the new disk should be seen as /dev/sdz ONLY, Otherwise the application or upper-layers may break.
So, is there any provision that google-cloud APIs provide to handle this ?
PLEASE NOTE: I'm using google-api-python-client library & code is in Python.