Jump to content
Welcome to our new Citrix community!
  • 0

Can't delete vdi-snapshot


Ruben Cardenal1709162194

Question

Hello,

 

In order to take a backup (aimed to perform a massive migration) I issued:

 

# xe vdi-snapshot uuid=3e95ae6d-1d4c-4881-9641-7dab726d5cdf
4400088a-bab4-4585-920c-dc376a30f498

 

and then exported it:

 

# xe vdi-export uuid=4400088a-bab4-4585-920c-dc376a30f498 filename=test.vhd format=vhd --progress
[|] ######################################################> (100% ETA 00:00:00) 
Total time: 00:17:40

 

All was nice until this moment.

 

But now I can't find a way of deleting that vdi.

 

I've tried (as indicated in other places) this but...

 

# xe vbd-unplug uuid=8eb03e49-e333-0d02-19f0-092d3d14c05c
The server failed to handle your request, due to an internal error.  The given message may give details useful for debugging the problem.
message: Expected 0 or 1 VDI with datapath, had 2

 

that uuid came from "list_domains" and the only vbd-list owned by the control domain:

 

# list_domains 
 id |                                 uuid |  state
  0 | ac0e38bd-d861-4e8e-a915-a8786359504d |     R 

 

# xe vbd-list vm-uuid=ac0e38bd-d861-4e8e-a915-a8786359504d
uuid ( RO)             : 8eb03e49-e333-0d02-19f0-092d3d14c05c
          vm-uuid ( RO): ac0e38bd-d861-4e8e-a915-a8786359504d
    vm-name-label ( RO): Control domain on host: XXXXXXXXXXXX
         vdi-uuid ( RO): 4400088a-bab4-4585-920c-dc376a30f498
            empty ( RO): false
           device ( RO): sm/backend/1fd4ba67-7045-c9a7-43b6-3264996519c0/4400088a-bab4-4585-920c-dc376a30f498
 

So how can I fix this situation? I'm trying to get snapshots/copies of individual VDIs in order to export them, and import them in other DC under a new pool without stopping the running VMs since they are critical (and since they don't have volatile data in ram, a live copy is an option).

 

These other commands just don't work either:

 

# xe vdi-destroy uuid=4400088a-bab4-4585-920c-dc376a30f498
This operation cannot be performed because this VDI is in use by some other operation
vdi: 4400088a-bab4-4585-920c-dc376a30f498 (source VM disk name)
operation: destroy

 

# xe vdi-forget uuid=4400088a-bab4-4585-920c-dc376a30f498
This operation cannot be performed because this VDI is in use by some other operation
vdi: 4400088a-bab4-4585-920c-dc376a30f498 (source VM disk name)
operation: forget

 

The "force" switch has no effect. And restarting the Xen host is not an option.

 

Also that object (4400088a-bab4-4585-920c-dc376a30f498) can't be deleted from XenCenter.

 

I'm also aware of https://discussions.citrix.com/topic/399792-xenserver-72-error-message-expected-0-or-1-vdi-with-datapath-had-2/

 

Thanks.

Link to comment

2 answers to this question

Recommended Posts

  • 0
2 hours ago, Tobias Kreidl said:

Is the VM the VDI attached to still active? You may need to do a power state reset on that VM and make sure it's properly shut down before a VDI can be detached and deleted.

 

-=Tobias

 

Hello Tobias,

 

In fact turning the VM off/on ("The IT Crowd mode") is one of the first things I tried. And after doing it, it refused to boot with:

 

Internal error:xenopsd internal error: Storage_interface.Illegal_transition

 

I detached the disk from the VM, attached it again, and then it was able to boot again.  But that vdi couldn't be deleted, and it still can't be deleted.

 

Doesn't bother me a lot for that particular VM since it's not important (that's why I chose it to make the test) but would be good having a way of deleting those VDIs in order to create backups of certain VMs without turning them off for our migration between DCs.

 

In fact I've seen that in the NAUbackup/VmBackup script, the procedure is exactly the same approach I tried

 

247 # take a vdi-snapshot of this vm

248 cmd = '%s/xe vdi-snapshot uuid=%s' % (xe_path, xvda_uuid)

...

271 # actual-backup: vdi-export vdi-snapshot

272 cmd = '%s/xe vdi-export format=%s uuid=%s' % (xe_path, config['vdi_export_format'], snap_vdi_uuid)

...

286 # cleanup: vdi-destroy vdi-snapshot

287 cmd = '%s/xe vdi-destroy uuid=%s' % (xe_path, snap_vdi_uuid)

 

But in my case (Xenserver 7.2) and at least with this VM, the last part just fails.

 

Thanks.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...