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.**
9
  • can you show exactly what you're doing, not a screenshot of API docs, and a vague description full of typos - e.g. what have you put in the request body? Apr 12, 2023 at 2:16
  • Thanks for suggest. I edited post. My english is not good
    – unLimit
    Apr 12, 2023 at 2:32
  • the error is different to what you said. "Cannot detach root device volume" seems perfectly correct, since that's the volume that is being used by the server to actually run. Perhaps you need to stop the server first? But then, detaching the volume will mean the server can't ever run Apr 12, 2023 at 2:36
  • yes, the instance can pause to detach the volume and then I will reattach it and the instance can continue working right. Is there anything else I can do to make that happen. I tried adding another volume and assigning the new volume to the original volume. Then separate the current volume. Is that a reasonable option? If so, I can't find the exact original volume assignment
    – unLimit
    Apr 12, 2023 at 2:44
  • perhaps if you explain why are you trying to detach the root volume from the server (add it to the question) - because I'm pretty sure doing so is not a good thing Apr 12, 2023 at 2:51

1 Answer 1

0

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .