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

Exception when cloning VMs from one LVM thin pool to another #3257

Closed
na-- opened this Issue Oct 29, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@na--

na-- commented Oct 29, 2017

Qubes OS version:

R4.0 RC2

Affected TemplateVMs:

none (dom0 issue)


Steps to reproduce the behavior:

  1. Create a new LVM thin pool: lvcreate --type thin-pool --poolmetadatasize 1G -l '100%FREE' -n new_thin_pool_name some_lvm_volume_group
  2. Create a new qubes storage pool that uses it: qvm-pool -a new-lvm-pool lvm_thin -o volume_group=some_lvm_volume_group,thin_pool=new_thin_pool_name,revisions_to_keep=3
  3. Try to clone an existing VM from the default pool to the new: qvm-clone -P new-lvm-pool old-vm-name new-vm-name

Expected behavior:

The VM is cloned successfully

Actual behavior:

qvm-clone exits with the following exception:

old-vm-name: Cloning private volume
Traceback (most recent call last):
  File "/usr/bin/qvm-clone", line 9, in <module>
    load_entry_point('qubesadmin==4.0.9', 'console_scripts', 'qvm-clone')()
  File "/usr/lib/python3.5/site-packages/qubesadmin/tools/qvm_clone.py", line 73, in main
    app.clone_vm(src_vm, new_name, new_cls=args.cls, pool=pool, pools=pools)
  File "/usr/lib/python3.5/site-packages/qubesadmin/app.py", line 389, in clone_vm
    dst_volume.clone(src_volume)
  File "/usr/lib/python3.5/site-packages/qubesadmin/storage.py", line 222, in clone
    self._qubesd_call('CloneTo', payload=token)
  File "/usr/lib/python3.5/site-packages/qubesadmin/storage.py", line 76, in _qubesd_call
    payload_stream=payload_stream)
  File "/usr/lib/python3.5/site-packages/qubesadmin/app.py", line 481, in qubesd_call
    return self._parse_qubesd_response(return_data)
  File "/usr/lib/python3.5/site-packages/qubesadmin/base.py", line 103, in _parse_qubesd_response
    raise exc_class(format_string, *args)
qubesadmin.exc.StoragePoolException: Failed to import volume 'lvm:qubes_dom0/vm-old-vm-name-private', dd exit code: 1

and the following lines can be found with journalctl:

dom0 qubesd[15619]: dd: writing to '/dev/some_lvm_volume_group/vm-new-vm-name-private': No space left on device
dom0 qubesd[15619]: 4194305+0 records in
dom0 qubesd[15619]: 4194304+0 records out
dom0 qubesd[15619]: 2147483648 bytes (2.1 GB, 2.0 GiB) copied, 20.8849 s, 103 MB/s
dom0 qubesd[15619]: StoragePoolException("Failed to import volume 'lvm:qubes_dom0/vm-old-vm-name-private', dd exit code: 1",) while calling src=b'dom0' meth=b'admin.vm.volume.CloneTo' dest=b'new-vm-name' arg=b'private' len(untrusted_payload)=32
dom0 qubesd[15619]: Removing volume private: some_lvm_volume_group/vm-new-vm-name-private
dom0 qubesd[15619]: Removing volume root: qubes_dom0/vm-new-vm-name-root
dom0 qubesd[15619]: Removing volume kernel: 4.9.56-21
dom0 qubesd[15619]: Removing volume volatile: some_lvm_volume_group/vm-new-vm-name-volatile

General notes:

I think that this happens because the VM I am trying to clone has an extended private size, while the clone tool allocates only 2GB for it in the receiving pool. The new thin pool has 140GB free as shown by lvs, so there's plenty of free space.


Related issues:

None that I could find

@na--

This comment has been minimized.

Show comment
Hide comment
@na--

na-- Oct 29, 2017

Yeah, the extended size of the VM's private volume seems like the reason, cloning a VM with 2GB private size was successful and the newly cloned VM runs with no issues.

na-- commented Oct 29, 2017

Yeah, the extended size of the VM's private volume seems like the reason, cloning a VM with 2GB private size was successful and the newly cloned VM runs with no issues.

@andrewdavidwong andrewdavidwong added this to the Release 4.0 milestone Oct 29, 2017

@na-- na-- referenced this issue in QubesOS/qubes-core-admin-client Oct 29, 2017

Closed

Fix inter-pool cloning of VMs with extended private volumes #34

marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Nov 5, 2017

marmarek added a commit to marmarek/qubes-core-admin that referenced this issue Nov 7, 2017

@qubesos-bot

This comment has been minimized.

Show comment
Hide comment
@qubesos-bot

qubesos-bot Nov 21, 2017

Automated announcement from builder-github

The package qubes-core-dom0-4.0.12-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

Automated announcement from builder-github

The package qubes-core-dom0-4.0.12-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 qubesos-bot referenced this issue in QubesOS/updates-status Nov 21, 2017

Closed

core-admin v4.0.12 (r4.0) #313

@qubesos-bot

This comment has been minimized.

Show comment
Hide comment
@qubesos-bot

qubesos-bot Dec 12, 2017

Automated announcement from builder-github

The package qubes-core-dom0-4.0.14-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

Automated announcement from builder-github

The package qubes-core-dom0-4.0.14-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