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

qvm-trim-template fails on long-named VM's #1655

Closed
marmarek opened this Issue Jan 17, 2016 · 2 comments

Comments

Projects
None yet
1 participant
@marmarek
Member

marmarek commented Jan 17, 2016

https://groups.google.com/d/msgid/qubes-users/566510CD.7020309%40gmail.com

I have a Fedora 21 TemplateVM that I'm trying to upgrade to Fedora 23.
This TemplateVM has a fairly long name, though one that is completely
allowed by the Qubes VM Manager GUI. The clone and distro-sync steps
went just fine. Upon trying to trim the template, I got this:

$ qvm-trim-template fedora-23-openjdk-ant-git
Disk usage before:
8488996 /var/lib/qubes/vm-templates/fedora-23-openjdk-ant-git/root.img
Creating temporary VM...
Traceback (most recent call last):
  File "/usr/bin/qvm-trim-template", line 160, in <module>
    main()
  File "/usr/bin/qvm-trim-template", line 98, in main
    netvm=None,
  File "/usr/lib64/python2.7/site-packages/qubes/qubes.py", line 346,
in add_new_vm
    vm = vm_cls(qid=qid, collection=self, **kwargs)
  File
"/usr/lib64/python2.7/site-packages/qubes/modules/000QubesVm.py", line
314, in __init__
    raise QubesException(msg)
qubes.qubes.QubesException: 'fedora-23-openjdk-ant-git-fstrim' is
invalid VM name (invalid characters, over 31 chars long, or one of
'none', 'true', 'false')

I was able to rename the TemplateVM to something shorter using Qubes
VM Manager, at which point the qvm-trim-template command worked fine.
I was then able to rename it back to the longer name.

While the workaround is obvious to people who are reasonably skilled,
this is still a usability issue, given that some users won't
understand what's going on, and it's inconvenient even for the users
who do see how to fix it.

Any chance qvm-trim-template could be patched so that the temporary VM
has a name which is no longer than the argument VM?

@marmarek marmarek added this to the Release 3.0 updates milestone Jan 17, 2016

marmarek added a commit to QubesOS/qubes-core-admin that referenced this issue Jun 25, 2016

trim-template: Fix handling long named templates
Trim template name to fit full VM name in 31 chars.
At the same time, check if the VM already exists - if so - remove it
first (or error out asking the user to remove it manually - if VM isn't
marked as internal).
Now that VM is created as internal, to skip appmenus creation.

QubesOS/qubes-issues#1910
Fixes QubesOS/qubes-issues#1655

(cherry picked from commit 10f0716)
@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 25, 2016

Member

Automated announcement from builder-github

The package qubes-core-dom0-3.1.17-1.fc20 has been pushed to the r3.1 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

Member

marmarek commented Jun 25, 2016

Automated announcement from builder-github

The package qubes-core-dom0-3.1.17-1.fc20 has been pushed to the r3.1 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 25, 2016

Member

Automated announcement from builder-github

The package qubes-core-dom0-3.1.17-1.fc20 has been pushed to the r3.1 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Member

marmarek commented Jul 25, 2016

Automated announcement from builder-github

The package qubes-core-dom0-3.1.17-1.fc20 has been pushed to the r3.1 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

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