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

Qubes storage pools of type LVM issues #3438

Open
zander opened this Issue Jan 1, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@zander

zander commented Jan 1, 2018

This is a list of issues found in usage of pools in Qubes4RC3, as per private email I register them here to allow everyone to keep track of these;

  • creating an qvm-thinpool pool with arguments that is not a lvm thinpool should fail. (example)
    This is the purpose of VmCreationManager, but that covers only vm creation...

Per design, creating a pool creates a corresponding dir under /usr/lib/qubes/appvms
I’ve had two issues with that.

  • creating a VM with a ‘-p root=myPool --template=foo’ will fail if the
    template is not on the same pool. AND it will leave the directory behind.
    I expect failures to not leave a dir behind. Either check first or clean up on fail.

Which naturally leads to;

  • creating a new VM will cause an internal exception if the dir in /usr/lib/qubes
    already exists. I expect this to end up with a user-visible error from the API.

  • Creating a qvm pool with argument revisions_to_keep=0 will cause the qvm-
    create later to exit based on it not being able to make a backup or
    something.
    Error detection should happen in the qvm-pool command.

  • Calling qvm-create with the root-pool being different from the pool the template is in gives you;
    app: Error creating VM: Can't clone a snapshot volume root to pool qubes_ssd

I think what it meant to say is that the root has to be in the same pool as
the template it is based on.
This is probably just a case of improving the error message.

  • Requesting qvm-pool -i POOL lists the size of zero when just created.

  • Qubes creates a snapshot at every start which turns into a backup partition when it exits. The problem is that qubes never garbage collects old backups. They continue getting created and sudo lvs gets quite lengthy after some time.

@zander

This comment has been minimized.

Show comment
Hide comment
@zander

zander Jan 7, 2018

@andrewdavidwong can you please remove the 'installer' tag? This is about the qvm-* commands only. Thanks!

zander commented Jan 7, 2018

@andrewdavidwong can you please remove the 'installer' tag? This is about the qvm-* commands only. Thanks!

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 7, 2018

Member

Requesting qvm-pool -i POOL lists the size of zero when just created. It is a number much larger than the physical size after some usage. Similarly, the 'usage' shows a much higher number than it should.

I can't reproduce the latter, it shows me the right number, the same as "LSize" column in lvs output. Anything special about your pool?

Member

marmarek commented Jan 7, 2018

Requesting qvm-pool -i POOL lists the size of zero when just created. It is a number much larger than the physical size after some usage. Similarly, the 'usage' shows a much higher number than it should.

I can't reproduce the latter, it shows me the right number, the same as "LSize" column in lvs output. Anything special about your pool?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 7, 2018

Member

Storing a VM (template) on a LVM based pool causes qvm-start to show a bug in timing.
Calling qvm-start normally will not return until the VM fully started and is operational. This is not the case on a lvm based pool. The qvm-start command returns immediately and as a side-effect the qemu bios window is shown.
This is an important functional issue as this means disposable VMs can't be stored on such a pool due to the timing issue causing them to exit before really having been started.

This isn't related to LVM. The template has a set of "features" (see qvm-features). If qrexec is not set there, qvm-start does not wait for qrexec startup. Similary, if gui is not set there, gui-agent is assumed to be missing and emulated VGA is used.
Those features should be set during template installation, but if weren't, you can set them manually.

Member

marmarek commented Jan 7, 2018

Storing a VM (template) on a LVM based pool causes qvm-start to show a bug in timing.
Calling qvm-start normally will not return until the VM fully started and is operational. This is not the case on a lvm based pool. The qvm-start command returns immediately and as a side-effect the qemu bios window is shown.
This is an important functional issue as this means disposable VMs can't be stored on such a pool due to the timing issue causing them to exit before really having been started.

This isn't related to LVM. The template has a set of "features" (see qvm-features). If qrexec is not set there, qvm-start does not wait for qrexec startup. Similary, if gui is not set there, gui-agent is assumed to be missing and emulated VGA is used.
Those features should be set during template installation, but if weren't, you can set them manually.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jan 7, 2018

Member

Qubes creates a snapshot at every start which turns into a backup partition when it exits. The problem is that qubes never garbage collects old backups. They continue getting created and sudo lvs gets quite lengthy after some time.

What is revisions_to_keep value in that pool?

Member

marmarek commented Jan 7, 2018

Qubes creates a snapshot at every start which turns into a backup partition when it exits. The problem is that qubes never garbage collects old backups. They continue getting created and sudo lvs gets quite lengthy after some time.

What is revisions_to_keep value in that pool?

@zander

This comment has been minimized.

Show comment
Hide comment
@zander

zander Jan 7, 2018

Requesting qvm-pool -i POOL lists the size of zero when just created. It is a number much larger
than the physical size after some usage. Similarly, the 'usage' shows a much higher number than it
should.

I can't reproduce the latter, it shows me the right number, the same as "LSize" column in lvs output.

You are right, this is due to the usage of GiB in lvs where I expected GB. The only issue really here seems to be that the values at the beginning were zero. (I know that for a fact, I copy pasted that in an email).
Maybe just an issue of not calculating stuff until a VM actually uses the pool.

I'll update the issue above to avoid confusing people coming in later.

zander commented Jan 7, 2018

Requesting qvm-pool -i POOL lists the size of zero when just created. It is a number much larger
than the physical size after some usage. Similarly, the 'usage' shows a much higher number than it
should.

I can't reproduce the latter, it shows me the right number, the same as "LSize" column in lvs output.

You are right, this is due to the usage of GiB in lvs where I expected GB. The only issue really here seems to be that the values at the beginning were zero. (I know that for a fact, I copy pasted that in an email).
Maybe just an issue of not calculating stuff until a VM actually uses the pool.

I'll update the issue above to avoid confusing people coming in later.

@zander

This comment has been minimized.

Show comment
Hide comment
@zander

zander Jan 7, 2018

What is revisions_to_keep value in that pool?

Confusing :)

qvm-pool doesn't list it. In the <pools> section of qubes.xml there is no mention either.

On each individual domain/volume that uses this pool, the xml-attribute is set to 1 (except for volatile, which is zero, for obvious reasons).

Oh, and I set it to two initially.

zander commented Jan 7, 2018

What is revisions_to_keep value in that pool?

Confusing :)

qvm-pool doesn't list it. In the <pools> section of qubes.xml there is no mention either.

On each individual domain/volume that uses this pool, the xml-attribute is set to 1 (except for volatile, which is zero, for obvious reasons).

Oh, and I set it to two initially.

marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Jan 11, 2018

storage/lvm: fix size reporting just after creating LV
Force cache refresh after registering new pool - it might be just
created.

QubesOS/qubes-issues#3438

marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Jan 12, 2018

storage/lvm: check for LVM LV existence and type when creating ThinPool
Check if requested thin pool exists and really is thin pool.

QubesOS/qubes-issues#3438

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Mar 29, 2018

Closed

core-admin v4.0.25 (r4.0) #469

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