Score:1

How to detach volume in server

mg flag

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.**
Jaromanda X avatar
ru flag
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?
unLimit avatar
mg flag
Thanks for suggest. I edited post. My english is not good
Jaromanda X avatar
ru flag
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
unLimit avatar
mg flag
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
Jaromanda X avatar
ru flag
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
unLimit avatar
mg flag
yes. i edited post
djdomi avatar
za flag
usually regardless which operating system you will try - removing the root drive will fail the VM. And as Stated in the Admin-Web-Panel Screenshots, the VM is running. And Maybe thats the issue?
unLimit avatar
mg flag
I shut off the instance but still the error. Maybe I'm missing a condition
djdomi avatar
za flag
since it looks like a admin panel, from a hoster, how's about a support ticket?
Score:0
us flag

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.

unLimit avatar
mg flag
thanks you, i try it
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.