cannot trim whonix-ws template anymore

61 views
Skip to first unread message

Sven Semmler

unread,
Oct 18, 2017, 4:11:53 PM10/18/17
to qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I regularly trim my templates after updating them. I don't recall this
process ever being interrupted, but it appears that something got
corrupted once when trimming whonix-ws. What I have already done:

* deleted /var/lib/qubes/appvms/trim-whonix-ws multiple times
* completely uninstalled and reinstalled the whonix templates

Never the less, I get the following error:

Disk usage before:
2574760 /var/lib/qubes/vm-templates/whonix-ws/root.img
Creating temporary VM...
Traceback (most recent call last):
File "/usr/bin/qvm-trim-template", line 172, in <module>
main()
File "/usr/bin/qvm-trim-template", line 115, in main
fstrim_vm.create_on_disk()
File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py",
line 1317, in create_on_disk
self._update_libvirt_domain()
File "/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py",
line 764, in _update_libvirt_domain
raise e
libvirt.libvirtError: operation failed: domain 'trim-whonix-ws' already
exists with uuid 34bfb7d4-b96d-4d8d-9042-53e212761316

It appears that the VM 'trim-whonix-ws' gets created during the trim
operation and that the operation now fails, since the same name is
already registered somewhere. I checked /var/lib/qubes/qubes.xml ...
it's not in there.

Any ideas where to check?

/Sven



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJZ57WCAAoJENpuFnuPVB+2XOgP/RC9i4p+C83XXYDx17HimO2/
LHBJf82TRV6U57SEQ1YNs74X7FZRSRQyVAP9VcxmTrAO7ts2LtUX4a7wdKZjbHU0
zEhlGCbbiybsC87jVz3LpzwOzfv4TWdinjcD9Fjc833j/qkXhmxTBTI7KAyROAco
K7+JEru2VIGLMAsmrVzTUSkDCcN5WY3aTWOiBFip3ECEU5uXdiHevXIaH95zkrkE
AR6URQfsvlS0UM6wqDpHCCyavhrwHMlo6Sft6JcqvFRw9Z1zLVcv3TrTUPGbLWzB
Dfz2CM0E1T0ohGqh4/C933Eb30mN8os6aL92C3HRmzqHPtQuI9uYhef362PDIML6
fiIi8auC42ehF//IQ2jDFvr5mywyhCyoly50A4aTHlIqjOymrbXXe+JtN/LUVqs6
Rreb8JeD28524HSJzRceHgRk1/6WwPa47naOYcN4zXYl/yCmdnLqCdhy5ydr7xaU
fhq5wPBkg0qBBFzuRsBdJ6dEB8w0aLJEN/dTvTBlTD09JtRvy5q6U54crFODsEL8
Js8wpnzo0CAFe98F3tyMchYPfrodWeXf1Dchy7TUJfnRXnv2bEC1/VzsVzB5mKjF
HPzZsV6etkAp2XfPuGpOJTjqZy/VWpFOg2jd/8Ob8WhXOZ4KfmXJRzsY9Vf53riA
3f3boyIUNdJQpYzb08c3
=eCsr
-----END PGP SIGNATURE-----

yura...@gmail.com

unread,
Oct 18, 2017, 9:50:13 PM10/18/17
to qubes-users

This is a temporary folder being made in the /var/lib/qubes/appvms/ despite it being a template. It creates the volatile .img in the /appvms/ folder, before fixing the template folder in /var/lib/qubes/vm-templates.

Therefore, try look at /var/lib/qubes/appvms/trim-whonix-ws/

Like you suggested, I would also try move the folder away, and see if it fixes things without breaking something. I haven't done this before, but perhaps it's best to make a quick copy backup of whonix-ws first, just to be safe.

Also, try trim another template (where trim works and succeeds), while having the window manager open at /var/lib/qubes/appvms/, you will notice the temporary folder being made, while the trimming is working.

Noor Christensen

unread,
Oct 20, 2017, 11:25:12 AM10/20/17
to qubes-users
On Wed, Oct 18, 2017 at 06:50:13PM -0700, yura...@gmail.com wrote:
> [...]
If it still does not work, you could use virsh to force removal of the
Xen domain:

$ virsh destroy 34bfb7d4-b96d-4d8d-9042-53e212761316
$ virsh undefine 34bfb7d4-b96d-4d8d-9042-53e212761316
$ virsh vol-delete --pool vg0 34bfb7d4-b96d-4d8d-9042-53e212761316.img

Make sure you use the correct UUID when running these commands. It
should be the one from that error message you quoted:

> > libvirt.libvirtError: operation failed: domain 'trim-whonix-ws' already
> > exists with uuid 34bfb7d4-b96d-4d8d-9042-53e212761316

-- noor

|_|O|_|
|_|_|O| Noor Christensen
|O|O|O| 0x401DA1E0
signature.asc

Sven Semmler

unread,
Oct 23, 2017, 6:47:56 PM10/23/17
to qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 10/20/2017 10:25 AM, Noor Christensen wrote:
> $ virsh undefine 34bfb7d4-b96d-4d8d-9042-53e212761316

Thank you Noor!

The above command did the trick.

/Sven


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJZ7nGUAAoJENpuFnuPVB+2Oo4QAKFSqV6D3viMZccDjq13qsVw
yuggf4mUfyRZX1s2M8L2R0TOn6Z4eof8X9z1Zfj/dKfcWXJFdbLOwhKmHTXS+i2X
cPgCWdHuXg2RoPe77GKjp1buJ0YlbLvpUxPEcAVScOwCET/0shZ02UF0Cr7imsHl
jvNZdB4kd4VS3O0s21ED/L8upAUsen5Fn3P09om0lMMasrRMOrpBOeJ/wYQbBJA9
7klPpcbgli+zh1hAPcnRpu8tQU777pbbbkmMgaSxSNFUmXsjh3SDHQO/kS4ol+Cz
eGRsNLuZ7eohr0p3ObO1EXgW2c7E3+YEZs/uSwhGSFPwB3SMzprhWO2z+6ZBiUgY
Komd6FK7WrcOoDEEe4hjowGBnxmhtK8Wg8MMfpKPtIMck7f3GhE8vHMBVyP6YMVi
pK5u6uw0a0j2nM4fu4g3X+Yh2T8C0G/Zfk7BktLRMhf7UikHxb0GD8MvYJBGmPib
RKj86B1rpRdngFOApbxynJRA8MRqTTULxRzx3yA3ByCtZrADOmnBH7gv1lVOavCI
hQzzP/J4dIOfaLTyLT/Z3dGA0Ue/nGNHoNGHhDpCuVCGWBukGn6eht8bK/xmtfz5
NwbrqdRQnebA9NgGH4VqjIw7TscMjL1Y31I5o1BncrjJ8hYVQLOjdeWApKaurtLs
tmslBaZc235FL6lKAA3A
=wVtg
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages