-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detaching disk issue: "error detaching VM Disk: Could not detach sdc from" #4164
Comments
atodorov-storpool
added a commit
to atodorov-storpool/one
that referenced
this issue
Feb 7, 2020
Signed-off-by: Anton Todorov <a.todorov@storpool.com>
atodorov-storpool
added a commit
to atodorov-storpool/one
that referenced
this issue
Feb 19, 2020
Signed-off-by: Anton Todorov <a.todorov@storpool.com>
rsmontero
pushed a commit
that referenced
this issue
Feb 19, 2020
rsmontero
pushed a commit
that referenced
this issue
Feb 19, 2020
merged |
rsmontero
added a commit
to OpenNebula/docs
that referenced
this issue
Feb 19, 2020
xorel
added a commit
to xorel/one
that referenced
this issue
Feb 20, 2020
xorel
added a commit
to xorel/one
that referenced
this issue
Feb 20, 2020
xorel
added a commit
to xorel/one
that referenced
this issue
Feb 20, 2020
rsmontero
pushed a commit
that referenced
this issue
Feb 20, 2020
rsmontero
pushed a commit
that referenced
this issue
Feb 20, 2020
atodorov-storpool
pushed a commit
to storpool/one
that referenced
this issue
Feb 21, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
While detaching disk from VM in some cases an error could be thrown like: "error detaching VM Disk: Could not detach sdc from ".
To Reproduce
Expected behavior
Disk detached, no error thrown.
Details
Additional context
We noticed that "detach_disk" script (vmm_mad/remotes/kvm/detach_disk) should use a more efficient way to check whether a disk detached or not.
While detaching disk from VM in some cases an error could be thrown like: "error detaching VM Disk: Could not detach sdc from ".
But in fact, the disk has been detached from the VM and it can be confirmed via "virsh dumpxml" command.
There is a piece of code in the script:
Here we have
grep $TARGET
part where $TARGET turns into a device name (i.e. vda, sda, sdc, etc...).Let's say we are trying to detach a scsi disk "sda", so the script will run a check with
grep sda
.And an interesting part is if the owner of the VM is a user with a name: sdaniel, which is reflected in the domain xml metadata section, grep will return some data and
if [ $? -eq 0 ] ;
piece will return an error and script will exit with rc=-1 in spite the disk has been detached from the domain.Proposed changes for the script:
virsh --connect $LIBVIRT_URI dumpxml $DOMAIN | grep dev=\'$TARGET\' > /dev/null 2>&1
Just be more specific about what to grep and extend the regexp to
dev=\'$TARGET\'
.Progress Status
The text was updated successfully, but these errors were encountered: