Skip to content
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

Prevent removing storage pool if any VM is using it #4454

Closed
marmarek opened this issue Oct 29, 2018 · 4 comments
Closed

Prevent removing storage pool if any VM is using it #4454

marmarek opened this issue Oct 29, 2018 · 4 comments
Labels
C: core P: major Priority: major. Between "default" and "critical" in severity. r4.0-dom0-stable T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@marmarek
Copy link
Member

Qubes OS version:

R4.0

Affected component(s):

core-admin


Steps to reproduce the behavior:

qvm-pool --add new-pool ...
qvm-create -P new-pool ...
qvm-pool --remove new-pool

Expected behavior:

qvm-pool --remove fails because is used by a VM

Actual behavior:

qvm-pool --remove actually removes the pool. Everything works until qubesd service restart. But the service doesn't start anymore - fails on loading qubes.xml:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/qubes/app.py", line 1234, in get_pool
    return self.pools[pool]
KeyError: 'new-pool'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/qubesd", line 5, in <module>
    sys.exit(main())
  File "/usr/lib/python3.5/site-packages/qubes/tools/qubesd.py", line 33, in main
    args = parser.parse_args(args)
  File "/usr/lib/python3.5/site-packages/qubes/tools/__init__.py", line 362, in parse_args
    offline_mode=namespace.offline_mode)
  File "/usr/lib/python3.5/site-packages/qubes/app.py", line 794, in __init__
    self.load(lock=lock)
  File "/usr/lib/python3.5/site-packages/qubes/app.py", line 903, in load
    vm.fire_event('domain-load')
  File "/usr/lib/python3.5/site-packages/qubes/events.py", line 198, in fire_event
    pre_event=pre_event)
  File "/usr/lib/python3.5/site-packages/qubes/events.py", line 166, in _fire_event
    effect = func(self, event, **kwargs)
  File "/usr/lib/python3.5/site-packages/qubes/vm/qubesvm.py", line 806, in on_domain_init_loaded
    self.storage = qubes.storage.Storage(self)
  File "/usr/lib/python3.5/site-packages/qubes/storage/__init__.py", line 362, in __init__
    self.init_volume(name, conf)
  File "/usr/lib/python3.5/site-packages/qubes/storage/__init__.py", line 404, in init_volume
    pool = self.vm.app.get_pool(volume_config['pool'])
  File "/usr/lib/python3.5/site-packages/qubes/app.py", line 1236, in get_pool
    raise qubes.exc.QubesException('Unknown storage pool ' + pool)
qubes.exc.QubesException: Unknown storage pool new-pool

General notes:


Related issues:

@marmarek marmarek added T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. C: core P: major Priority: major. Between "default" and "critical" in severity. labels Oct 29, 2018
@marmarek marmarek added this to the Release 4.0 updates milestone Oct 29, 2018
@GammaSQ
Copy link

GammaSQ commented Feb 17, 2019

I just ran into this issue and fixed it by editing /var/lib/qubes/qubes.xml, replacing any occurrence of the deleted group with an existing one. However, now removing the offending VM doesn't work, I get the error VM default-mgmt-dvm cannot be removed. It is in use as:

@marmarek
Copy link
Member Author

I think your problem is unrelated to this ticket. The default-mgmt-dvm VM is in use because it's set to management_dispvm global property. The problem is qvm-remove doesn't list it.

marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Feb 18, 2019
marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Feb 18, 2019
marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Feb 24, 2019
marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Feb 24, 2019
marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Feb 25, 2019
marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Feb 25, 2019
marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Feb 27, 2019
@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-core-dom0-4.0.41-1.fc25 has been pushed to the r4.0 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

@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-core-dom0-4.0.41-1.fc25 has been pushed to the r4.0 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
Labels
C: core P: major Priority: major. Between "default" and "critical" in severity. r4.0-dom0-stable T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

No branches or pull requests

3 participants