My wish is to restore the instance's data back to the data of any created snapshot and keep the IP assigned to that instance.
I have tried a few ideas with no success:
- From the snapshot create a new volume then assign that volume to the instance. Then detach the root volume of the instance then attach the new volume to the instance but not always get the error "Can't detach root device".
- From the snapshot I create the volume then create a new instance complete with the same flavor + image configuration as the instance I want to restore. Then it will separate the IP in the original instance to assign it to the new instance. This option is possible, but the probability of losing the ip is yes because when separating the ip from the original instance, that IP will be public and can be assigned to another instance when initializing at the same time (the system automatically gets the public ips). to assign to the instance) or the process of assigning that ip to the instance of the snapshot is delayed, error. So following this option is very risky not to do. Help me with ideas for optimal development. I work through the openstack API using endpoints.