1

Sorry my for my bad English!

  • I want to separate the volume from the server.
  • My server currently only has 1 volume, and it is the original volume.
  • I have read the documentation of OpenStack api Block Storage API V3 (CURRENT).

i added the full match parameters: volume - in-use, project_id and volume_id but always get the error "Error: Unable to detach volume: Volume".

I don't know what the conditions are. But when I work on the dashboard, I get the error "Cannot detach a root device volume". Here my actions: instance information

my actions

step 2: and ERROR

**My wish is:

  • I have 3 snapshots and want to revert the data to the 2nd snapshot. But I can't revert. Because the condition volume must be available. So I have to separate the original volume from the instance or create a new volume from that snapshot. Then attach to the original instance and need to remove the old volume.**
unLimit
  • 11

1 Answers1

1

Detaching a root volume is not possible, not even if you shutdown the instance. That's by design. If rolling back to a snapshot (how exactly is the snapshot created?) requires an available volume, you can set the volume's state to available without actually detaching it:

control:~# openstack volume set --state available --detached <VOLUME>

Note that this only changes the database entry, it doesn't actually detach the volume. But it might achieve what you're asking for, but make sure to set the state back to "attached" and "in-use" after you're done. You might require admin rights for that, so that could be an obstacle. I recommend to test this first on a test instance.

eblock
  • 577
  • 1
  • 3
  • 6