Skip to content

Instantly share code, notes, and snippets.

@olivierlambert
Last active January 28, 2018 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olivierlambert/7c73f460ecfeb8ef336c8af1d56f67c6 to your computer and use it in GitHub Desktop.
Save olivierlambert/7c73f460ecfeb8ef336c8af1d56f67c6 to your computer and use it in GitHub Desktop.
unlock coalesce

Find if coalesce

px axf | grep coalesce

If nothing, rescan SR and repeat the ps

Force it

If still said lock active, remove the lock:

rm /var/lock/sm/<SR_UUID>/gc_active

Rescan and wait up to 10 min, while tailing SMlog

If coalesce errors

Scan all VDI on SR:

vhd-util scan -f -c -p  -m /var/run/sr-mount/<SR_UUID>/*.vhd

If no error, check error from SMlog on coalesce, like these (coalesce EXCEPTIONS).

Jan 28 15:56:11 xen01 SMGC: [23350]          ***********************
Jan 28 15:56:11 xen01 SMGC: [23350]          *  E X C E P T I O N  *
Jan 28 15:56:11 xen01 SMGC: [23350]          ***********************
Jan 28 15:56:11 xen01 SMGC: [23350] coalesce: EXCEPTION <class 'util.SMException'>, VHD *811e7004(80.000G/2.155G) corrupted
Jan 28 15:56:11 xen01 SMGC: [23350]   File "/opt/xensource/sm/cleanup.py", line 1542, in coalesce
Jan 28 15:56:11 xen01 SMGC: [23350]     self._coalesce(vdi)

Find the UUID incriminated (here 811e7004…), and test it:

vhd-util check --debug -n /var/run/sr-mount/<SR_UUID>/<VDI_UUID>.vhd

Eg:

primary footer invalid: invalid cookie

Repair it:

vhd-util repair -n /var/run/sr-mount/<SR_UUID>/<VDI_UUID>.vhd

Recheck it, should be OK now.

Remove the lock, and wait a bit, coalesce should start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment